Skip to content

Commit

Permalink
Merge pull request #18666 from calixteman/update_loading_icon_alt_text
Browse files Browse the repository at this point in the history
[Editor] Update the loading icon when wait for ML to take into account prefered-reduced-motion setting
  • Loading branch information
calixteman authored Aug 30, 2024
2 parents f6216df + 36c5d19 commit 7494dbc
Show file tree
Hide file tree
Showing 5 changed files with 953 additions and 118 deletions.
21 changes: 21 additions & 0 deletions .svglintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default {
rules: {
valid: true,

custom: [
(reporter, $, ast, { filename }) => {
reporter.name = "no-svg-fill-context-fill";

const svg = $.find("svg");
const fill = svg.attr("fill");
if (fill === "context-fill") {
reporter.error(
"Fill attribute on svg element must not be set to 'context-fill'",
svg[0],
ast
);
}
},
],
},
};
28 changes: 25 additions & 3 deletions gulpfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1897,7 +1897,7 @@ gulp.task(

gulp.task("lint", function (done) {
console.log();
console.log("### Linting JS/CSS/JSON files");
console.log("### Linting JS/CSS/JSON/SVG files");

// Ensure that we lint the Firefox specific *.jsm files too.
const esLintOptions = [
Expand Down Expand Up @@ -1930,6 +1930,12 @@ gulp.task("lint", function (done) {
prettierOptions.push("--log-level", "warn", "--check");
}

const svgLintOptions = [
"node_modules/svglint/bin/cli.js",
"web/**/*.svg",
"--ci",
];

const esLintProcess = startNode(esLintOptions, { stdio: "inherit" });
esLintProcess.on("close", function (esLintCode) {
if (esLintCode !== 0) {
Expand All @@ -1950,8 +1956,24 @@ gulp.task("lint", function (done) {
done(new Error("Prettier failed."));
return;
}
console.log("files checked, no errors found");
done();

const svgLintProcess = startNode(svgLintOptions, {
stdio: "pipe",
});
svgLintProcess.stdout.setEncoding("utf8");
svgLintProcess.stdout.on("data", m => {
m = m.toString().replace(/-+ Summary -+.*/ms, "");
console.log(m);
});
svgLintProcess.on("close", function (svgLintCode) {
if (svgLintCode !== 0) {
done(new Error("svglint failed."));
return;
}

console.log("files checked, no errors found");
done();
});
});
});
});
Expand Down
Loading

0 comments on commit 7494dbc

Please sign in to comment.