Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up`--fix` specific rules for incremental adoption #668
Comments
mightyiam
changed the title
`--fix` specific rules for incremental adoptation
`--fix` specific rules for incremental adoption
Oct 26, 2016
dcousens
added
the
question
label
Oct 26, 2016
This comment has been minimized.
This comment has been minimized.
dougwilson
commented
Oct 27, 2016
|
I have done this a fee times on some enormous projects. I have always followed your exact method you described:
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. |
This comment has been minimized.
This comment has been minimized.
|
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
closed this
Feb 9, 2017
This comment has been minimized.
This comment has been minimized.
|
BTW, I wrote this: |
mightyiam commentedOct 26, 2016
•
edited by dcousens
Running
standard --fixon 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.jsI 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 --fixand 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?