Convert to .eslintrc.js
This commit is contained in:
parent
f8046f2dc2
commit
b271efb7d3
66
.eslintrc
66
.eslintrc
|
@ -1,66 +0,0 @@
|
|||
---
|
||||
parser: babel-eslint
|
||||
|
||||
extends:
|
||||
- ./node_modules/fbjs-scripts/eslint/.eslintrc.js
|
||||
|
||||
plugins:
|
||||
- react
|
||||
- react-internal
|
||||
|
||||
ecmaFeatures:
|
||||
modules: false
|
||||
|
||||
# We're stricter than the default config, mostly. We'll override a few rules and
|
||||
# then enable some React specific ones.
|
||||
rules:
|
||||
accessor-pairs: 0
|
||||
brace-style: [2, 1tbs]
|
||||
comma-dangle: [2, always-multiline]
|
||||
consistent-return: 2
|
||||
dot-location: [2, property]
|
||||
dot-notation: 2
|
||||
eol-last: 2
|
||||
eqeqeq: [2, allow-null]
|
||||
indent: [2, 2, {SwitchCase: 1}]
|
||||
jsx-quotes: [2, prefer-double]
|
||||
no-bitwise: 0
|
||||
no-dupe-class-members: 2
|
||||
no-multi-spaces: 2
|
||||
no-restricted-syntax: [2, WithStatement]
|
||||
no-shadow: 2
|
||||
no-unused-expressions: 2
|
||||
no-unused-vars: [2, {args: none}]
|
||||
quotes: [2, single, avoid-escape]
|
||||
space-after-keywords: 2
|
||||
space-before-blocks: 2
|
||||
space-before-keywords: 2
|
||||
strict: [2, global]
|
||||
|
||||
# JSX
|
||||
# Our transforms set this automatically
|
||||
react/display-name: 0
|
||||
react/jsx-boolean-value: [2, always]
|
||||
react/jsx-no-undef: 2
|
||||
# We don't care to do this
|
||||
react/jsx-sort-prop-types: 0
|
||||
react/jsx-sort-props: 0
|
||||
react/jsx-uses-react: 2
|
||||
react/jsx-uses-vars: 2
|
||||
# It's easier to test some things this way
|
||||
react/no-did-mount-set-state: 0
|
||||
react/no-did-update-set-state: 0
|
||||
# We define multiple components in test files
|
||||
react/no-multi-comp: 0
|
||||
react/no-unknown-property: 2
|
||||
# This isn't useful in our test code
|
||||
react/prop-types: 0
|
||||
react/react-in-jsx-scope: 2
|
||||
react/self-closing-comp: 2
|
||||
# We don't care to do this
|
||||
react/sort-comp: 0
|
||||
react/wrap-multilines: [2, {declaration: false, assignment: false}]
|
||||
|
||||
# CUSTOM RULES
|
||||
# the second argument of warning/invariant should be a literal string
|
||||
react-internal/warning-and-invariant-args: 2
|
|
@ -0,0 +1,73 @@
|
|||
const OFF = 0;
|
||||
const WARNING = 1;
|
||||
const ERROR = 2;
|
||||
|
||||
module.exports = {
|
||||
parser: 'babel-eslint',
|
||||
|
||||
extends: './node_modules/fbjs-scripts/eslint/.eslintrc.js',
|
||||
|
||||
plugins: [
|
||||
'react',
|
||||
'react-internal',
|
||||
],
|
||||
|
||||
ecmaFeatures: {
|
||||
modules: false
|
||||
},
|
||||
|
||||
// We're stricter than the default config, mostly. We'll override a few rules
|
||||
// and then enable some React specific ones.
|
||||
rules: {
|
||||
'accessor-pairs': OFF,
|
||||
'brace-style': [ERROR, '1tbs'],
|
||||
'comma-dangle': [ERROR, 'always-multiline'],
|
||||
'consistent-return': ERROR,
|
||||
'dot-location': [ERROR, 'property'],
|
||||
'dot-notation': ERROR,
|
||||
'eol-last': ERROR,
|
||||
'eqeqeq': [ERROR, 'allow-null'],
|
||||
'indent': [ERROR, 2, {SwitchCase: 1}],
|
||||
'jsx-quotes': [ERROR, 'prefer-double'],
|
||||
'no-bitwise': OFF,
|
||||
'no-dupe-class-members': ERROR,
|
||||
'no-multi-spaces': ERROR,
|
||||
'no-restricted-syntax': [ERROR, 'WithStatement'],
|
||||
'no-shadow': ERROR,
|
||||
'no-unused-expressions': ERROR,
|
||||
'no-unused-vars': [ERROR, {args: 'none'}],
|
||||
'quotes': [ERROR, 'single', 'avoid-escape'],
|
||||
'space-after-keywords': ERROR,
|
||||
'space-before-blocks': ERROR,
|
||||
'space-before-keywords': ERROR,
|
||||
'strict': [ERROR, 'global'],
|
||||
|
||||
// React & JSX
|
||||
// Our transforms set this automatically
|
||||
'react/display-name': OFF,
|
||||
'react/jsx-boolean-value': [ERROR, 'always'],
|
||||
'react/jsx-no-undef': ERROR,
|
||||
// We don't care to do this
|
||||
'react/jsx-sort-prop-types': OFF,
|
||||
'react/jsx-sort-props': OFF,
|
||||
'react/jsx-uses-react': ERROR,
|
||||
'react/jsx-uses-vars': ERROR,
|
||||
// It's easier to test some things this way
|
||||
'react/no-did-mount-set-state': OFF,
|
||||
'react/no-did-update-set-state': OFF,
|
||||
// We define multiple components in test files
|
||||
'react/no-multi-comp': OFF,
|
||||
'react/no-unknown-property': ERROR,
|
||||
// This isn't useful in our test code
|
||||
'react/prop-types': OFF,
|
||||
'react/react-in-jsx-scope': ERROR,
|
||||
'react/self-closing-comp': ERROR,
|
||||
// We don't care to do this
|
||||
'react/sort-comp': OFF,
|
||||
'react/wrap-multilines': [ERROR, {declaration: false, assignment: false}],
|
||||
|
||||
// CUSTOM RULES
|
||||
// the second argument of warning/invariant should be a literal string
|
||||
'react-internal/warning-and-invariant-args': ERROR,
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue