eslint-config-xo-react
Advanced tools
Comparing version 0.17.0 to 0.18.0
132
index.js
@@ -11,2 +11,7 @@ 'use strict'; | ||
], | ||
settings: { | ||
react: { | ||
version: 'detect' | ||
} | ||
}, | ||
rules: { | ||
@@ -37,8 +42,10 @@ 'react/boolean-prop-naming': 'error', | ||
'react/no-unused-state': 'error', | ||
'react/no-will-update-set-state': 'error', | ||
'react/prop-types': 'error', | ||
'react/react-in-jsx-scope': 'error', | ||
'react/require-default-props': ['error', { | ||
forbidDefaultForRequired: true | ||
}], | ||
'react/require-default-props': [ | ||
'error', | ||
{ | ||
forbidDefaultForRequired: true | ||
} | ||
], | ||
'react/self-closing-comp': 'error', | ||
@@ -48,16 +55,37 @@ 'react/style-prop-object': 'error', | ||
'react/jsx-boolean-value': 'error', | ||
'react/jsx-closing-bracket-location': ['error', { | ||
nonEmpty: 'tag-aligned', | ||
selfClosing: false | ||
}], | ||
'react/jsx-closing-bracket-location': [ | ||
'error', | ||
{ | ||
nonEmpty: 'tag-aligned', | ||
selfClosing: false | ||
} | ||
], | ||
'react/jsx-closing-tag-location': 'error', | ||
'react/jsx-curly-spacing': ['error', 'never'], | ||
'react/jsx-equals-spacing': ['error', 'never'], | ||
'react/jsx-indent': ['error', 'tab'], | ||
'react/jsx-indent-props': ['error', 'tab'], | ||
'react/jsx-curly-spacing': [ | ||
'error', | ||
'never' | ||
], | ||
'react/jsx-equals-spacing': [ | ||
'error', | ||
'never' | ||
], | ||
'react/jsx-indent': [ | ||
'error', | ||
'tab', | ||
{ | ||
checkAttributes: true | ||
} | ||
], | ||
'react/jsx-indent-props': [ | ||
'error', | ||
'tab' | ||
], | ||
'react/jsx-key': 'error', | ||
'react/jsx-max-props-per-line': ['error', { | ||
maximum: 3, | ||
when: 'multiline' | ||
}], | ||
'react/jsx-max-props-per-line': [ | ||
'error', | ||
{ | ||
maximum: 3, | ||
when: 'multiline' | ||
} | ||
], | ||
'react/jsx-no-bind': [ | ||
@@ -70,34 +98,54 @@ 'error', | ||
'react/jsx-no-comment-textnodes': 'error', | ||
'react/jsx-no-duplicate-props': ['error', { | ||
ignoreCase: true | ||
}], | ||
'react/jsx-no-duplicate-props': [ | ||
'error', | ||
{ | ||
ignoreCase: true | ||
} | ||
], | ||
'react/jsx-no-target-blank': 'error', | ||
'react/jsx-no-undef': 'error', | ||
// 'react/jsx-one-expression-per-line': 'error', | ||
'react/jsx-curly-brace-presence': ['error', 'never'], | ||
// Disabled for now as it produces too many errors | ||
// 'react/jsx-one-expression-per-line': ['error', {allow: 'single-child'}], | ||
'react/jsx-curly-brace-presence': [ | ||
'error', | ||
'never' | ||
], | ||
'react/jsx-fragments': [ | ||
'error', | ||
'syntax' | ||
], | ||
'react/jsx-pascal-case': 'error', | ||
'react/jsx-sort-props': ['error', { | ||
callbacksLast: true, | ||
shorthandFirst: true, | ||
noSortAlphabetically: true, | ||
reservedFirst: true | ||
}], | ||
'react/jsx-tag-spacing': ['error', { | ||
closingSlash: 'never', | ||
beforeSelfClosing: 'never', | ||
afterOpening: 'never', | ||
beforeClosing: 'never' | ||
}], | ||
'react/jsx-sort-props': [ | ||
'error', | ||
{ | ||
callbacksLast: true, | ||
shorthandFirst: true, | ||
noSortAlphabetically: true, | ||
reservedFirst: true | ||
} | ||
], | ||
'react/jsx-tag-spacing': [ | ||
'error', | ||
{ | ||
closingSlash: 'never', | ||
beforeSelfClosing: 'never', | ||
afterOpening: 'never', | ||
beforeClosing: 'never' | ||
} | ||
], | ||
'react/jsx-uses-react': 'error', | ||
'react/jsx-uses-vars': 'error', | ||
'react/jsx-wrap-multilines': ['error', { | ||
declaration: 'parens-new-line', | ||
assignment: 'parens-new-line', | ||
return: 'parens-new-line', | ||
arrow: 'parens-new-line', | ||
condition: 'ignore', | ||
logical: 'ignore', | ||
prop: 'ignore' | ||
}] | ||
'react/jsx-wrap-multilines': [ | ||
'error', | ||
{ | ||
declaration: 'parens-new-line', | ||
assignment: 'parens-new-line', | ||
return: 'parens-new-line', | ||
arrow: 'parens-new-line', | ||
condition: 'ignore', | ||
logical: 'ignore', | ||
prop: 'ignore' | ||
} | ||
] | ||
} | ||
}; |
{ | ||
"name": "eslint-config-xo-react", | ||
"version": "0.17.0", | ||
"version": "0.18.0", | ||
"description": "ESLint shareable config for React to be used with eslint-config-xo", | ||
@@ -54,5 +54,5 @@ "license": "MIT", | ||
"devDependencies": { | ||
"ava": "*", | ||
"eslint": "^5.0.1", | ||
"eslint-plugin-react": "^7.10.0", | ||
"ava": "^1.1.0", | ||
"eslint": "^5.12.0", | ||
"eslint-plugin-react": "^7.12.3", | ||
"is-plain-obj": "^1.0.0", | ||
@@ -63,4 +63,4 @@ "temp-write": "^3.1.0" | ||
"eslint": ">=5", | ||
"eslint-plugin-react": ">=7.10.0" | ||
"eslint-plugin-react": ">=7.12.3" | ||
} | ||
} |
6916
156