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?
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.
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.
BTW, I wrote this:
https://www.npmjs.com/package/setup-eslint
Most helpful comment
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.