-
Notifications
You must be signed in to change notification settings - Fork 9
/
base.js
50 lines (40 loc) · 901 Bytes
/
base.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
const { resolve } = require('path');
// Eslint v8+ does not have CLIEngine.
const { CLIEngine: v7AndEarlier } = require('eslint');
const isEslint7 = Boolean(v7AndEarlier);
const esLint7Config = {
root: true,
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
},
env: {
browser: true,
es6: true,
},
plugins: ['decorator-position'],
};
const esLint8Config = {
root: true,
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
ecmaFeatures: {
legacyDecorators: true,
},
babelOptions: {
configFile: resolve(__dirname, '../../babel.config.cjs'),
},
},
env: {
browser: true,
es6: true,
},
plugins: ['decorator-position'],
};
module.exports = isEslint7 ? esLint7Config : esLint8Config;