Add AirBnB linting rules for React best practices. Bump to v0.10.0. (#13259)

This commit is contained in:
CJ Cenizal 2017-08-03 08:18:08 -07:00 committed by GitHub
parent c68c0d6588
commit b670baeeec
2 changed files with 12 additions and 1 deletions

View file

@ -89,6 +89,7 @@ module.exports = {
'object-curly-spacing': 'off', // overriden with babel/object-curly-spacing
'babel/object-curly-spacing': [ 'error', 'always' ],
'jsx-quotes': ['error', 'prefer-double'],
'react/jsx-uses-react': 'error',
'react/react-in-jsx-scope': 'error',
'react/jsx-uses-vars': 'error',
@ -96,6 +97,7 @@ module.exports = {
'react/jsx-pascal-case': 'error',
'react/jsx-closing-bracket-location': ['error', 'line-aligned'],
'react/jsx-closing-tag-location': 'error',
'react/jsx-curly-spacing': ['error', 'never', { allowMultiline: true }],
'react/jsx-indent-props': ['error', 2],
'react/jsx-max-props-per-line': ['error', { maximum: 1, when: 'multiline' }],
'react/jsx-no-duplicate-props': ['error', { ignoreCase: true }],
@ -109,6 +111,15 @@ module.exports = {
'react/jsx-first-prop-new-line': ['error', 'multiline-multiprop'],
'react/jsx-equals-spacing': ['error', 'never'],
'react/jsx-indent': ['error', 2],
'react/no-did-mount-set-state': 'error',
'react/no-did-update-set-state': 'error',
'react/no-will-update-set-state': 'error',
'react/no-is-mounted': 'error',
'react/no-multi-comp': ['error', { ignoreStateless: true }],
'react/no-unknown-property': 'error',
'react/prefer-es6-class': ['error', 'always'],
'react/prefer-stateless-function': ['error', { ignorePureComponents: true }],
'react/no-unescaped-entities': 'error',
'mocha/handle-done-callback': 'error',
'mocha/no-exclusive-tests': 'error',

View file

@ -1,6 +1,6 @@
{
"name": "@elastic/eslint-config-kibana",
"version": "0.9.0",
"version": "0.10.0",
"description": "The eslint config used by the kibana team",
"main": ".eslintrc.js",
"scripts": {