Lint-staged: Get rid of advanced config options

Created on 13 Sep 2017  路  6Comments  路  Source: okonet/lint-staged

From the beginning the separation of "simple" and "advanced" options felt wrong for me but some requirements wouldn't be met without that. In case we can resolve #271 there is no actual need in other options to be in config.

  • [x] gitDir should be resolved automatically. See #271
  • [x] Deprecate subTaskConcurrency since it's not safe to take any other value than 1
  • [x] chunkSize can be set automatically depending on OS
  • [x] concurrent can be deprecated since it is only misused ATM and make execution slower and there is no benefit in setting it
  • [x] verbose should not be in config but a CLI argument IMO. Done in #344
  • [x] globOptions is probably be coupled with each glob pattern separately and just go inside the single linter's config after #273 is merged
  • [x] ignore should be part of each glob pattern somehow. See https://github.com/okonet/lint-staged/pull/273#issuecomment-330183246

This would allow simplifying the configuration and validation of user configs and make it even more easier to use.

Any thoughts?

Idea enhancement question

All 6 comments

  • gitDir should be resolved automatically.
  • chunkSize can be set automatically depending on OS

Good improvements for UX, +1 for these..

  • verbose should not be in config but a CLI argument IMO

Why don't we support it both as CLI argument and also in the config file?

Why don't we support it both as CLI argument and also in the config file?

because this will require to keep the advanced config which I want to drop. Also feels wrong from the UI perspective: verbose mode is intended to be used when something doesn't work as supposed and not something you configure to run all the time.

@okonet thank you so much for this fantastic library! I see you are figuring out what to do about ignore. Is there a place where we can see some working code with that? I am trying to ignore my test files in React and cannot seem to do so! The test files are being included in the linting itself. Any help would be appreciated, and I have also attached a screenshot of my project structure for reference :)

"lint-staged": { "linters": { "src/**/*.js": [ "npm run lint", "npm run prettier", "git add" ] }, "ignore": ["src/**/*.test.js"] },

Screen Shot 2019-06-28 at 5 17 31 PM

You can check #639

@okonet concurrent was actually useful to our use case because we couldn't have linting run in parallel across multiple files. Yes it is slower, but it actively prevents us from having collisions by Prettier and ESLint when they are combined in our CLI that we run. Should it not be the choice of the user to go slower in this case? I'd like to advocate that it be brought back, especially since you are just passing an option to Listr. I would have spoken up prior to v9, but I didn't follow along and know this was coming (sorry).

I wanted to reach out and post here first before having to decide how we refactor to support this now since we have users who all have concurrent set to disabled.

I have been running eslint, prettier, tslint and many other linters in parallel without issues for years now so I鈥檓 wondering why are you having them. Concurrent was only set to the different globs and was always false for the same glob. The only scenario where I could imagine collisions is when your globs match same files.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kachkaev picture kachkaev  路  5Comments

benjamincharity picture benjamincharity  路  4Comments

okcoker picture okcoker  路  4Comments

thedamon picture thedamon  路  3Comments

okonet picture okonet  路  5Comments