1 | module.exports = {
|
2 | 'parser': 'babel-eslint',
|
3 | 'env': {
|
4 | 'browser': true,
|
5 | 'node': true,
|
6 | 'es6': true,
|
7 | 'jest': true,
|
8 | 'commonjs': true,
|
9 | },
|
10 | 'plugins': [
|
11 | 'import',
|
12 | 'module',
|
13 | ],
|
14 | 'parserOptions': {
|
15 | 'sourceType': 'module',
|
16 | 'ecmaVersion': 6,
|
17 | 'ecmaFeatures': {
|
18 | 'jsx': true,
|
19 | 'generators': true,
|
20 | 'experimentalObjectRestSpread': true,
|
21 | },
|
22 | },
|
23 | 'settings': {},
|
24 | 'rules': {
|
25 | |
26 |
|
27 |
|
28 | 'no-const-assign': 'error',
|
29 | 'no-class-assign': 'error',
|
30 | 'no-dupe-class-members': 'error',
|
31 | 'rest-spread-spacing': 'error',
|
32 | 'no-duplicate-imports': 'error',
|
33 | 'no-useless-rename': 'error',
|
34 | 'arrow-spacing': 'error',
|
35 | 'no-useless-computed-key': 'error',
|
36 | 'template-curly-spacing': 'error',
|
37 | 'generator-star-spacing': ['error', {'before': false, 'after': true}],
|
38 | 'yield-star-spacing': ['error', {'before': false, 'after': true}],
|
39 | 'no-undef': 'error',
|
40 | 'dot-notation': ['error', {
|
41 | 'allowKeywords': true,
|
42 | }],
|
43 | 'no-extend-native': 'error',
|
44 | 'no-native-reassign': 'error',
|
45 | 'no-constant-condition': ['error', {
|
46 | 'checkLoops': false,
|
47 | }],
|
48 | 'no-caller': 'error',
|
49 | 'no-return-assign': 'off',
|
50 | 'no-loop-func': 'off',
|
51 | 'strict': ['off', 'global'],
|
52 | 'global-strict': ['off', 'always'],
|
53 | 'no-extra-strict': 'off',
|
54 | 'no-shadow': 'off',
|
55 | 'no-unused-vars': ['off', {
|
56 | 'vars': 'local',
|
57 | 'args': 'after-used',
|
58 | 'varsIgnorePattern': 'createElement',
|
59 | }],
|
60 | 'no-unused-expressions': 'off',
|
61 | 'no-use-before-define': 'off',
|
62 | 'no-array-constructor': 'off',
|
63 | 'yoda': 'off',
|
64 | 'eqeqeq': 'off',
|
65 | 'no-new': 'off',
|
66 | 'consistent-return': 'off',
|
67 | 'prefer-const': 'off',
|
68 | |
69 |
|
70 |
|
71 | 'no-catch-shadow': 'error',
|
72 | 'quotes': ['error', 'single', 'avoid-escape'],
|
73 | 'brace-style': ['error', '1tbs', {
|
74 | 'allowSingleLine': false,
|
75 | }],
|
76 | 'comma-spacing': ['error', {
|
77 | 'before': false,
|
78 | 'after': true,
|
79 | }],
|
80 | 'comma-style': ['error', 'last'],
|
81 | 'new-cap': ['error', {
|
82 | 'newIsCap': true,
|
83 | 'capIsNew': false
|
84 | }],
|
85 | 'key-spacing': ['error', {
|
86 | 'beforeColon': false,
|
87 | 'afterColon': true,
|
88 | }],
|
89 | 'no-mixed-spaces-and-tabs': 'error',
|
90 | 'no-multi-spaces': 'error',
|
91 | 'no-multiple-empty-lines': 'error',
|
92 | 'no-new-object': 'error',
|
93 | 'no-spaced-func': 'error',
|
94 | 'no-tabs': 'error',
|
95 | 'no-trailing-spaces': 'error',
|
96 | 'no-extra-parens': ['error', 'all', { ignoreJSX: 'all' }],
|
97 | 'padded-blocks': ['error', 'never'],
|
98 | 'semi': 'error',
|
99 | 'semi-spacing': 'error',
|
100 | 'keyword-spacing': 'error',
|
101 | 'space-before-blocks': 'error',
|
102 | 'space-before-function-paren': ['error', 'never'],
|
103 | 'space-infix-ops': 'error',
|
104 | 'spaced-comment': ['error', 'always', {
|
105 | 'line': {
|
106 | 'markers': ['/'],
|
107 | 'exceptions': ['-', '+'],
|
108 | },
|
109 | 'block': {
|
110 | 'markers': ['!'],
|
111 | 'exceptions': ['*'],
|
112 | 'balanced': true,
|
113 | },
|
114 | }],
|
115 | 'no-console': 'off',
|
116 | 'no-new-require': 'off',
|
117 | 'no-mixed-requires': ['off', false],
|
118 | 'no-path-concat': 'off',
|
119 | 'handle-callback-err': 'off',
|
120 | 'eol-last': 'off',
|
121 | 'func-names': 'off',
|
122 | 'no-empty': 'off',
|
123 | 'indent': ['error', 2, {
|
124 | 'SwitchCase': 1,
|
125 | }],
|
126 | 'camelcase': ['off', {
|
127 | 'properties': 'always',
|
128 | }],
|
129 |
|
130 | |
131 |
|
132 |
|
133 | 'import/newline-after-import': 'error',
|
134 | 'import/no-duplicates': 'error',
|
135 | 'import/no-extraneous-dependencies': [
|
136 | 'error',
|
137 | {
|
138 | 'peerDependencies': true,
|
139 | 'devDependencies': [
|
140 | '**/scripts/*.js',
|
141 | '**/scripts/**/*.js',
|
142 | '**/__tests__/*.js',
|
143 | '**/__tests__/**/*.js',
|
144 | '**/*.config.js',
|
145 | '**/config/*.js',
|
146 | '**/*.conf.js',
|
147 | '**/tests/*.test.js',
|
148 | '**/demo/**'
|
149 | ],
|
150 | },
|
151 | ],
|
152 | 'module/no-implicit-dependencies': ['error', {
|
153 | 'peerDependencies': true,
|
154 | 'devDependencies': [
|
155 | '**/scripts/*.js',
|
156 | '**/scripts/**/*.js',
|
157 | '**/__tests__/*.js',
|
158 | '**/__tests__/**/*.js',
|
159 | '**/*.config.js',
|
160 | '**/config/*.js',
|
161 | '**/*.conf.js',
|
162 | '**/tests/*.test.js',
|
163 | '**/demo/**'
|
164 | ]
|
165 | }]
|
166 | },
|
167 | };
|