Skip to content

Commit

Permalink
add default config to all rules which take a config
Browse files Browse the repository at this point in the history
  • Loading branch information
tikotzky committed Dec 23, 2015
1 parent b36f21d commit 732e253
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions packages/eslint-config-airbnb/rules/react.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ 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)
'react/forbid-prop-types': 0,
'react/forbid-prop-types': [0, {'forbid': ['any', 'array', 'object']}],
// Enforce boolean attributes notation in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-boolean-value.md
'react/jsx-boolean-value': [2, 'never'],
Expand All @@ -21,28 +21,34 @@ 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}],
// Validate props indentation in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-indent-props.md
'react/jsx-indent-props': [2, 2],
// Limit maximum of props on a single line in JSX
'react/jsx-max-props-per-line': 0,
'react/jsx-max-props-per-line': [0, {'maximum': 1}],
// Prevent usage of .bind() and arrow functions in JSX props
'react/jsx-no-bind': 0,
// 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
'react/jsx-no-literals': 0,
// Disallow undeclared variables in JSX
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-no-undef.md
'react/jsx-no-undef': 2,
// 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, {'pragma': 'React'}],
Expand Down Expand Up @@ -82,7 +88,7 @@ module.exports = {
'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,
Expand Down

0 comments on commit 732e253

Please sign in to comment.