forked from Automattic/jetpack
/
.eslintrc.react.js
42 lines (41 loc) · 1.19 KB
/
.eslintrc.react.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// eslint config for react-using projects. Extend this instead of .eslintrc.js, probably like this:
//
// ```
// const loadIgnorePatterns = require( '../../../tools/js-tools/load-eslint-ignore.js' );
// module.exports = {
// // This project uses react, so load the shared react config.
// root: true,
// extends: [ '../../../.eslintrc.react.js' ],
// ignorePatterns: loadIgnorePatterns( __dirname ),
// parserOptions: {
// babelOptions: {
// configFile: require.resolve( './babel.config.js' ),
// },
// },
// };
// ```
module.exports = {
root: true,
parser: '@babel/eslint-parser',
extends: [ 'wpcalypso/react', './.eslintrc.js' ],
parserOptions: {
requireConfigFile: true,
},
settings: {
react: {
version: 'detect', // React version. "detect" automatically picks the version you have installed.
},
},
rules: {
'react/jsx-curly-spacing': [ 2, 'always' ],
'react/jsx-no-bind': 2,
// 'react/jsx-space-before-closing': 2,
'react/jsx-tag-spacing': [ 2, { beforeSelfClosing: 'always' } ],
'react/no-danger': 2,
'react/no-did-mount-set-state': 2,
'react/no-did-update-set-state': 2,
'react/no-is-mounted': 2,
'react/prefer-es6-class': 1,
'react/no-string-refs': 0,
},
};