-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy path.eslintrc.js
94 lines (91 loc) · 2.8 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
'use strict';
const legacyFiles = require('./eslint_rules/legacy_files_list');
const vendoredFiles = './src/vendored/**/*.js';
const protobufFiles = './src/**/*_pb.js';
module.exports = {
root: true,
ignorePatterns: ['node_modules', 'build', 'deploy'],
extends: ['./eslint_rules/base.js', './eslint_rules/imports.js'],
overrides: [
/* all new js code */
{
files: './**/*.js',
excludedFiles: [...legacyFiles, vendoredFiles, protobufFiles],
extends: ['./eslint_rules/prettier.js'],
},
/* web application */
{
files: './src/**/*.js',
extends: ['./eslint_rules/relax_webapp_js.js', './eslint_rules/imports_webapp.js'],
env: {
browser: true,
es2020: true,
commonjs: true,
},
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
},
globals: {
NODE_ENV: true,
RELEASE_VER: true,
},
},
/* web application legacy code*/
{
files: legacyFiles,
extends: ['./eslint_rules/relax_legacy.js', './eslint_rules/imports_relax_legacy.js'],
},
/* vendored files*/
{
files: vendoredFiles,
extends: ['./eslint_rules/relax_vendored.js', './eslint_rules/imports_relax_vendored.js'],
},
/* auto-generated files */
{
files: protobufFiles,
extends: ['./eslint_rules/relax_protobuf.js', './eslint_rules/imports_relax_protobuf.js'],
},
/* tests code */
{
files: './test/**/*.js',
excludedFiles: './test/karma.conf.js',
parser: 'babel-eslint',
extends: ['./eslint_rules/relax_tests.js', './eslint_rules/imports_tests.js'],
env: {
browser: true,
mocha: true,
es2020: true,
},
parserOptions: {
sourceType: 'module',
},
globals: {
require: true,
assert: true,
},
},
/* config code */
{
files: [
'./webpack/**/*.js',
'./test/karma.conf.js',
'./scripts/**/*.js',
'./eslint_rules/*.js',
'./.eslintrc.js',
],
env: {
node: true,
es2017: true,
},
extends: ['./eslint_rules/imports_configs.js'],
},
/* command line scripts */
{
files: ['./scripts/build.js', './webpack/webpack.config.js'],
rules: {
'no-console': 'off',
},
},
],
};