Re:Khan Academy's React style guide
by prezjordan on Wednesday October 21, 2015 @11:11AM
(#10425957)
For 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.
Someone on my team has started such a project, encoding a few companies' style guides as eslint 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.
Re:Khan Academy's React style guide
by greg5green on Wednesday October 21, 2015 @10:44AM
(#10425749)
AirBnB 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.
Is it available?
Re:Khan Academy's React style guide
by themichaellai on Wednesday October 21, 2015 @12:25PM
(#10426516)
or `npm install --save-dev eslint-config-airbnb`
Re:Khan Academy's React style guide
by deanclatworthy on Wednesday October 21, 2015 @10:40AM
(#10425718)
Couldn'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
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