forked from matecat/MateCat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
62 lines (58 loc) · 1.55 KB
/
.eslintrc.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
const nodeEcmaVersion = 2018
const browserEcmaVersion = 2018
module.exports = {
ignorePatterns: ['**/public/js/lib/**/*.js'],
extends: ['eslint:recommended'],
rules: {
'no-extra-semi': 'off',
'no-undef': 'warn',
},
overrides: [
// nodejs 9.11 related files
{
files: ['*.js', '**/support_scripts/**/*.js'],
parserOptions: {
ecmaVersion: nodeEcmaVersion,
},
env: {node: true},
},
// jest related files
{
files: ['**/*.jest.js', '**/*.test.js', '**/mocks/**/*.js'],
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
ecmaVersion: nodeEcmaVersion,
ecmaFeatures: {jsx: true},
},
env: {jest: true, node: true, browser: true, es6: true},
extends: [
'plugin:jest/recommended',
'plugin:jest-dom/recommended',
'plugin:testing-library/react',
],
},
// grunt browserify compiled files
{
files: ['**/cat_source/**/*.js', '**/js/*.js'],
parser: '@babel/eslint-parser',
env: {es6: true},
parserOptions: {
sourceType: 'module',
ecmaVersion: browserEcmaVersion,
ecmaFeatures: {jsx: true},
},
extends: ['plugin:react/recommended', 'plugin:react-hooks/recommended'],
settings: {
react: {version: '16.9'},
},
rules: {'react/prop-types': 'off'},
},
// grunt concat related files
{
files: ['**/public/js/**/*.js'],
env: {browser: true},
parserOptions: {ecmaVersion: browserEcmaVersion},
},
],
}