forked from vpalmisano/webrtcperf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
86 lines (86 loc) · 2.33 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
module.exports = {
env: {
browser: false,
commonjs: true,
es6: true,
node: true,
// 'jest/globals': true,
},
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:import/warnings',
// 'plugin:jest/recommended',
'plugin:prettier/recommended', // make sure this is the last plugin
],
ignorePatterns: [],
plugins: ['simple-import-sort', 'unused-imports'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {},
ecmaVersion: 2020,
sourceType: 'module',
tsconfigRootDir: './',
},
overrides: [
{
// enable the rule specifically for TypeScript files
files: ['*.ts', '*.tsx'],
parserOptions: {
project: ['./tsconfig.json'], // Specify it only for TypeScript files
},
extends: [
'eslint:recommended',
'plugin:import/errors',
'plugin:@typescript-eslint/recommended',
'plugin:import/warnings',
// 'plugin:jest/recommended',
'plugin:prettier/recommended', // make sure this is the last plugin
],
rules: {
'prettier/prettier': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'sort-imports': 'off',
'import/order': 'off',
'unused-imports/no-unused-imports-ts': 'error',
'unused-imports/no-unused-vars-ts': [
'warn',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-non-null-assertion': ['error'],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-var-requires': 'warn',
},
},
{
// enable the rule specifically for TypeScript files
files: ['*.js'],
env: {
browser: true,
node: true,
},
},
],
rules: {
'prettier/prettier': 'error',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'sort-imports': 'off',
'import/order': 'off',
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
paths: ['node_modules/', 'node_modules/@types/'],
},
typescript: {},
},
},
}