Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Allow to disable some rules when fixing on save #89

Closed
pvdlg opened this issue Nov 22, 2017 · 2 comments · Fixed by #90
Closed

Allow to disable some rules when fixing on save #89

pvdlg opened this issue Nov 22, 2017 · 2 comments · Fixed by #90

Comments

@pvdlg
Copy link
Contributor

pvdlg commented Nov 22, 2017

The Fix on Save feature is really useful, but with some rules it can sometime get in the way.
For example with the capitalized-comments.

When developing is sometimes to comment out a few lines of code to test something and revert the commenting to re-eanable the code.

With the capitalized-comments rule, if Fix on Save is enable, commenting a few line of code will capitalize the first letter. When un-commenting the capital letter will stay and has to be manually fixed.

For example, this following code might create a problem and I comment it to test:

// if (condition) {
//   createPossibleProblem();
// }

On save if becomes If:

// If (condition) {
//   createPossibleProblem();
// }

When I un-comment the code If stay capitalized.

See the same feature on linter-eslint : AtomLinter/linter-eslint#795

@pvdlg
Copy link
Contributor Author

pvdlg commented Nov 26, 2017

Related avajs/eslint-plugin-ava#173

Unfortunately since the 4.3.0 release of eslint-plugin-ava the fix on save feature has to be disabled if you use ava...

@sindresorhus
Copy link
Owner

Yes, this would be a useful feature. We could include some by default, like capitalized-comments and ava/no-only-test. Pull request welcome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants