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

`--fix` specific rules for incremental adoption #668

Closed
mightyiam opened this issue Oct 26, 2016 · 3 comments

Comments

@mightyiam
Copy link
Contributor

commented Oct 26, 2016

Running standard --fix on any file that's not very small, can be quite the meticulous challenge. Even if tests pass and there's excellent coverage, I would read everything.

Would it be more nice, to apply an incremental approach to adopting the standard style?

Instead of converting file-by-file, converting rule-by-rule.

Actually, I'm sure many have thought about this. I wouldn't be surprised if this didn't come up here before. Yet, I couldn't find it.

So, if I could do $ standard --fix no-unused-vars lib/index.js I would be really happy. This way I could go over the entire rule set one by one.

I guess I can do this by using eslint --fix and specifying the rules in a configuration that incrementally gets more similar to eslint-config-standard, and then finally replacing that with standard itself...

Has anyone walked this path before?

@mightyiam mightyiam changed the title `--fix` specific rules for incremental adoptation `--fix` specific rules for incremental adoption Oct 26, 2016

@dcousens dcousens added the question label Oct 26, 2016

@dougwilson

This comment has been minimized.

Copy link

commented Oct 27, 2016

I have done this a fee times on some enormous projects. I have always followed your exact method you described:

I guess I can do this by using eslint --fix and specifying the rules in a configuration that incrementally gets more similar to eslint-config-standard, and then finally replacing that with standard itself...

At least in my experience, where many developers were committing against the project several times a day, that is the only approach that would work, as a command argument to standard fix would not actually prevent any check ins from violating the partial rule set like the eslint config method does.

Also, I didn't build up to be similar to standard, instead I added the eslint-config-standard and disabled all the rules that had violations at the moment and then slowly removed the exceptions.

@feross

This comment has been minimized.

Copy link
Member

commented Feb 9, 2017

This is a cool idea, but it would add a lot of complexity to the internals of standard so I'd prefer to recommend your manual approach for now. Maybe when we're caught up on the other issues and new rules we can reconsider this.

@feross feross closed this Feb 9, 2017

@mightyiam

This comment has been minimized.

Copy link
Contributor Author

commented Feb 9, 2017

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.