Closed fsgmhoward closed 1 year ago
This may be somewhat related, but the better solution may be to just lint files that have diff. Currently, npm run lint
lints all typescript/html files, which is unnecessarily long. This method will solve this issue and also improve the efficiency of linting.
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:
globby
as suggested in this issue of the lintspaces-cli repo. I have tested this package and it allows for negated patterns e.g. "!src/web/dist/*"
which would effectively exclude all the build files in the dist
folder. src/web/dist
as build files to be excluded. Could you point me to any documentation that mentions where the build files are being generated? @tenebrius1
git diff
only. This will effectively skips files unchanged and those should be excluded (e.g. those in .gitignore
).@fsgmhoward Thanks for the clarification! I will look into whether there is a way to only run linting on files with git diff
.
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.