Skip to content
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

Lint dirty files only #30

Closed
athyuttamre opened this issue Aug 24, 2016 · 2 comments
Closed

Lint dirty files only #30

athyuttamre opened this issue Aug 24, 2016 · 2 comments

Comments

@athyuttamre
Copy link

athyuttamre commented Aug 24, 2016

When trying to introduce stylelint to an existing codebase, it can be very hard if the webpack console blows up with errors from across the codebase.

It would be great to have an option lintDirtyModulesOnly: true, that would:

  • Skip linting files the first time it encounters them (to avoid linting during Webpack's first run)
  • Only lint edited files during incremental builds

At a high level, this could be achieved if the plugin stores a stateful map between module names and the number of times it has processed them. If the number of times is greater than 1, and Webpack has processed the file (i.e. it has changed), then we can lint it.

@JaKXz
Copy link
Contributor

JaKXz commented Sep 29, 2016

Thanks for the suggestion @athyuttamre - want to take a crack at a PR? :)

@JaKXz JaKXz removed the PRs welcome label Dec 9, 2016
sergesemashko pushed a commit to sergesemashko/stylelint-webpack-plugin that referenced this issue Jan 4, 2017
@JaKXz JaKXz closed this as completed in 7e60e9b Jan 16, 2017
@JaKXz
Copy link
Contributor

JaKXz commented Feb 12, 2017

Thanks to @sergesemashko this has been published in + [email protected] :) please give it a shot, hopefully it helps!

joshwiens pushed a commit that referenced this issue Mar 31, 2018
* resolves #30 - add lint dirty files only flag

* Separate logic to extract changed style files.

 - Add tests for lintDirtyFilesOnly flag

* Added a test case for non style file change

* Add unit test for getChangedFiles

* Remove unused dependencies

* Quiet Stylelint during tests

* Refactore lint dirty modules into plugin in separate file

* Add testdouble

* Fix lint warnings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants