-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Linting should be skipped for generated files during local build and test #11564
Comments
This may be somewhat related, but the better solution may be to just lint files that have diff. Currently, |
Hello, is anybody investigating this issue? If not I don't mind looking into it! |
@tenebrius1 I don't think anyone is doing that. Please proceed. |
@fsgmhoward I have a few questions regarding this issue:
|
|
@fsgmhoward Thanks for the clarification! I will look into whether there is a way to only run linting on files with |
…ildand test (#11910) * Fix lint:css issue * Update lint:spaces to ignore build files * Update linting to use git diff * update linting routine to be ran as pre-commit hook * improve linting on github actions * modify git diff command to work on github actions * add fetch-depth flag to actions/checkout * remove trailing space * remove pre-commit hook Co-authored-by: Nicolas Chang Weng Yew <[email protected]> Co-authored-by: Zhao Jingjing <[email protected]>
This is a very minor improvement which would improve local testing efficiency in my opinion.
Steps to reproduce
Run
npm lint
(specifically, it affectslint:css
andlint:space
).Basically, the auto generated files of
npm run build
has been linted, resulting a large number of errors thrown out. Also, json files generated by lnp tests also fails the test.Expected behaviour
Only linting whatever to be pushed to the git repository, skipping all the auto-generated items (such as those listed in
.gitignore
).Additional info
For the
lint:css
, issue is resolved by adding--ignore-pattern \"src/web/dist/*.css\"
behind the current command line strings. This instructs thestylelint
not to check files indist
folder (the generated ones for production).For the
lint:space
,lintspaces
program does not have a good way to skip certain files. Probably a better matching rules needed to match files for linting.The text was updated successfully, but these errors were encountered: