mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 13:08:06 -05:00
Merge pull request #346 from justjake/jake/eslint-react
add eslint rules for JSX style from issue #345
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
{
|
||||
"parser": "babel-eslint",
|
||||
"plugins": [
|
||||
"react"
|
||||
],
|
||||
"env": {
|
||||
"browser": true,
|
||||
"node": true
|
||||
@@ -164,6 +167,46 @@
|
||||
"space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren
|
||||
"space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops
|
||||
"space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case
|
||||
"spaced-line-comment": 2 // http://eslint.org/docs/rules/spaced-line-comment
|
||||
"spaced-line-comment": 2, // http://eslint.org/docs/rules/spaced-line-comment
|
||||
|
||||
/**
|
||||
* JSX style
|
||||
*/
|
||||
"react/display-name": 0,
|
||||
"react/jsx-boolean-value": 2,
|
||||
"react/jsx-quotes": [2, "double"],
|
||||
"react/jsx-no-undef": 2,
|
||||
"react/jsx-sort-props": 0,
|
||||
"react/jsx-sort-prop-types": 0,
|
||||
"react/jsx-uses-react": 2,
|
||||
"react/jsx-uses-vars": 2,
|
||||
"react/no-did-mount-set-state": [2, "allow-in-func"],
|
||||
"react/no-did-update-set-state": 2,
|
||||
"react/no-multi-comp": 2,
|
||||
"react/no-unknown-property": 2,
|
||||
"react/prop-types": 2,
|
||||
"react/react-in-jsx-scope": 2,
|
||||
"react/self-closing-comp": 2,
|
||||
"react/wrap-multilines": 2,
|
||||
"react/sort-comp": [2, {
|
||||
"order": [
|
||||
"displayName",
|
||||
"mixins",
|
||||
"statics",
|
||||
"propTypes",
|
||||
"getDefaultProps",
|
||||
"getInitialState",
|
||||
"componentWillMount",
|
||||
"componentDidMount",
|
||||
"componentWillReceiveProps",
|
||||
"shouldComponentUpdate",
|
||||
"componentWillUpdate",
|
||||
"componentWillUnmount",
|
||||
"/^on.+$/",
|
||||
"/^get.+$/",
|
||||
"/^render.+$/",
|
||||
"render"
|
||||
]
|
||||
}]
|
||||
}
|
||||
}
|
||||
|
||||
7
linters/README.md
Normal file
7
linters/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
## `.eslintrc`
|
||||
|
||||
Our `.eslintrc` requires the following NPM packages packages:
|
||||
|
||||
- `eslint`
|
||||
- `babel-eslint`
|
||||
- `eslint-plugin-react`
|
||||
Reference in New Issue
Block a user