mirror of
https://github.com/airbnb/javascript.git
synced 2026-01-14 04:48:12 -05:00
add default config to all rules which take a config
This commit is contained in:
24
packages/eslint-config-airbnb/rules/react.js
vendored
24
packages/eslint-config-airbnb/rules/react.js
vendored
@@ -10,7 +10,7 @@ module.exports = {
|
||||
'rules': {
|
||||
// Prevent missing displayName in a React component definition
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/display-name.md
|
||||
'react/display-name': 0,
|
||||
'react/display-name': [0, {'acceptTranspilerName', false}],
|
||||
// Forbid certain propTypes (any, array, object)
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-prop-types.md
|
||||
'react/forbid-prop-types': [0, {'forbid': ['any', 'array', 'object']}],
|
||||
@@ -22,7 +22,7 @@ module.exports = {
|
||||
'react/jsx-closing-bracket-location': [2, 'line-aligned'],
|
||||
// Enforce or disallow spaces inside of curly braces in JSX attributes
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-spacing.md
|
||||
'react/jsx-curly-spacing': 0,
|
||||
'react/jsx-curly-spacing': [0, 'never', {'allowMultiline': true}],
|
||||
// Enforce event handler naming conventions in JSX
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-handler-names.md
|
||||
'react/jsx-handler-names': [0, {
|
||||
@@ -43,7 +43,7 @@ module.exports = {
|
||||
'react/jsx-no-bind': 2,
|
||||
// Prevent duplicate props in JSX
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-duplicate-props.md
|
||||
'react/jsx-no-duplicate-props': 0,
|
||||
'react/jsx-no-duplicate-props': [0, {'ignoreCase': false}],
|
||||
// Prevent usage of unwrapped JSX strings
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-literals.md
|
||||
'react/jsx-no-literals': 0,
|
||||
@@ -55,13 +55,19 @@ module.exports = {
|
||||
'react/jsx-pascal-case': 0,
|
||||
// Enforce propTypes declarations alphabetical sorting
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-prop-types.md
|
||||
'react/jsx-sort-prop-types': 0,
|
||||
'react/jsx-sort-prop-types': [0, {
|
||||
'ignoreCase': false,
|
||||
'callbacksLast': false,
|
||||
}],
|
||||
// Enforce props alphabetical sorting
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-sort-props.md
|
||||
'react/jsx-sort-props': 0,
|
||||
'react/jsx-sort-props': [0, {
|
||||
'ignoreCase': false,
|
||||
'callbacksLast': false,
|
||||
}],
|
||||
// Prevent React to be incorrectly marked as unused
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-react.md
|
||||
'react/jsx-uses-react': 2,
|
||||
'react/jsx-uses-react': [2, {'pragma': 'React'}],
|
||||
// Prevent variables used in JSX to be incorrectly marked as unused
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-uses-vars.md
|
||||
'react/jsx-uses-vars': 2,
|
||||
@@ -85,7 +91,7 @@ module.exports = {
|
||||
'react/no-is-mounted': 2,
|
||||
// Prevent multiple component definition per file
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-multi-comp.md
|
||||
'react/no-multi-comp': 2,
|
||||
'react/no-multi-comp': [2, {'ignoreStateless': false}],
|
||||
// Prevent usage of setState
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-set-state.md
|
||||
'react/no-set-state': 0,
|
||||
@@ -100,13 +106,13 @@ module.exports = {
|
||||
'react/prefer-es6-class': [2, 'always'],
|
||||
// Prevent missing props validation in a React component definition
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md
|
||||
'react/prop-types': 2,
|
||||
'react/prop-types': [2, {'ignore': [], customValidators: []}],
|
||||
// Prevent missing React when using JSX
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/react-in-jsx-scope.md
|
||||
'react/react-in-jsx-scope': 2,
|
||||
// Restrict file extensions that may be required
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/require-extension.md
|
||||
'react/require-extension': 0,
|
||||
'react/require-extension': [0, {'extensions': ['.jsx']}],
|
||||
// Prevent extra closing tags for components without children
|
||||
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/self-closing-comp.md
|
||||
'react/self-closing-comp': 2,
|
||||
|
||||
Reference in New Issue
Block a user