Skip to content

Commit 12afb4d

Browse files
committed
fix: reduce excess stylelint warnings from bundle module file
Fixes large number of stylelint warnings appearing after yarn start. These were the result of stylelint running on the tools/bundle/dist/index.module.css file. - Adds stylelint override to better lint module files that have a different class format. - Add ignoreFiles for the tools/bundle/dist, as stylelint should not be running on the dist folders during this step; it seems to be disregarding the .stylelintignore file.
1 parent 9950a1c commit 12afb4d

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

stylelint.config.js

+15
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ module.exports = {
1414
"@spectrum-tools/stylelint-theme-alignment",
1515
// "stylelint-high-performance-animation",
1616
],
17+
ignoreFiles: [
18+
"tools/bundle/dist/*.css",
19+
],
1720
rules: {
1821
/** --------------------------------------------------------------
1922
* Disabled rules
@@ -235,5 +238,17 @@ module.exports = {
235238
],
236239
}
237240
},
241+
{
242+
/* Module CSS file classes have an underscore before classes, and use underscores instead of a dash as separators (e.g. _spectrum_well) */
243+
files: ["tools/bundle/**/*.module.css"],
244+
rules: {
245+
"selector-class-pattern": [
246+
"^_spectrum$|^(_)?(spectrum|is|u)(_|-)[A-Za-z0-9-_]+", {
247+
resolveNestedSelectors: true
248+
}
249+
],
250+
"keyframes-name-pattern": null,
251+
}
252+
},
238253
],
239254
};

0 commit comments

Comments
 (0)