-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: reduce excess stylelint warnings from bundle module #3655
base: main
Are you sure you want to change the base?
Conversation
File metricsSummaryTotal size: 2.24 MB* 🎉 No changes detected in any packages * Size is the sum of all main files for packages in the library.* An ASCII character in UTF-8 is 8 bits or 1 byte. |
🚀 Deployed on https://pr-3655--spectrum-css.netlify.app |
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.
12afb4d
to
1ac3153
Compare
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One note about where we list our ignored files, otherwise this works for me when I pull it down locally.
ignoreFiles: [ | ||
"tools/bundle/dist/*.css", | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I'm reading this correctly, I think we should be using either the .stylelintignore file or the ignoreFiles
property in the config. I'm flexible with whichever approach we use but I'd like to see all the same data in it. Would you mind either migrating the content from the stylelintignore to here or moving this out to the stylelintignore file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Part of the problem is that there appears to be that the .stylelintignore
file is disregarded by whatever stylelint is running after yarn start. It seems to be only when stylelint is running from the storybook directory. The existing ignored dist
in the .stylelintignore
should already cover these files, and it seems to work if I manually run the stylelint command from the root. But not if I run it from .storybook
. Should I track that as a separate bug? I wasn't able to track down why; I tried all kinds of variations and path.resolve for the ignorePath
setting in the two separate postcss.config.js files, without any luck. So this is somewhat of a workaround for the time being.
Edit: I also could leave this specific change off if we want to address that bug separately. I was on the fence about it.
@@ -235,5 +238,17 @@ module.exports = { | |||
], | |||
} | |||
}, | |||
{ | |||
/* Module CSS file classes have an underscore before classes, and use underscores instead of a dash as separators (e.g. _spectrum_well) */ | |||
files: ["tools/bundle/**/*.module.css"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know if this works if we simplify it to just files:["*.module.css"],
- I'm just thinking all module files would have these same linting issues so if we add more, it'd be lovely to be able to inherit these automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should work. I can test and make that change.
Description
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.CSS-1155
How and where has this been tested?
Please tag yourself on the tests you've marked complete to confirm the tests have been run by someone other than the author.
Validation steps
Pull down the branch locally and:
yarn install
andyarn start
. After Storybook starts up (after loader and pages are functional), you should not see the 9k stylelint warnings related to "._" classes expecting to match pattern. No[stylelint]
labeled warnings should appear for the bundle dist file.ignoreFiles
property in the rootstylelint.config.js
and runyarn start
again. There should only be a few dozen stylelint warnings for the module file, instead of 9k.Screenshots
Original problem:
To-do list