3 ms·
Request for comment: Linters are by far powerful enough by now. Can we (as community) switch to documenting style guides as linter rulesets + custom linters.
by andreasklinger 11y ago
Request for comment:
Linters are by far powerful enough by now.
Can we (as community) switch to documenting style guides as linter rulesets + custom linters. Eg for javascript: eslint and jscs
Written style guides are good for understanding why - but linters actually help others to adapt to it quicker
- deanclatworthy 11y agoCouldn't agree more. And you should in theory be able to generate a style guide document from a linter. I know you can do it for CSS
- greg5green 11y agoAirBnB has a similar style guide for React and has a linter file for eslint with the React plugin. Works pretty well. I'd like to see more style guides come with similar set ups.
- pbreit 11y agoIs it available?
- themichaellai 11y agoYes: https://github.com/airbnb/javascript https://github.com/airbnb/javascript
- bronson 11y agoor `npm install --save-dev eslint-config-airbnb`
- prezjordan 11y agoFor what it's worth our linter is also open source [0] :) I do like the idea of combining the two and have it self-document, though. [0]: https://github.com/Khan/khan-linter https://github.com/Khan/khan-linter
- exogen 11y agoSomeone on my team has started such a project, encoding a few companies' style guides as eslint defaults: https://github.com/walmartlabs/eslint-config-defaults https://github.com/walmartlabs/eslint-config-defaults You can then use eslint's `extends` feature to use them as a base for your own code.