-
Notifications
You must be signed in to change notification settings - Fork 34
/
.eslintrc.js
98 lines (97 loc) · 2.18 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
95
96
97
98
const {resolve} = require('path');
const gtsPkgJsonPath = require.resolve('gts/package.json');
const gtsPath = resolve(gtsPkgJsonPath, '..');
module.exports = {
ignorePatterns: [
'node_modules',
'stencil-generated',
'dist',
'www',
'!.storybook',
'scripts/deploy/execute-deployment-pipeline.mjs',
'build',
'.deployment.config.json',
],
env: {
jest: true,
es6: true,
},
extends: ['plugin:prettier/recommended'],
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
},
overrides: [
{
files: ['**/package-lock.json'],
parser: 'eslint-plugin-json-es',
plugins: ['package-lock'],
rules: {
'package-lock/lock-file-version': [
'error',
{
version: 3,
},
],
},
},
{
// Note: *.md files are directly checked using cspell cli in lint-staged
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx', '**/*.mjs'],
extends: ['plugin:@cspell/recommended'],
rules: {
'@cspell/spellchecker': ['error'],
},
},
{
files: ['**/*.ts', '**/*.tsx'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
extends: [gtsPath],
parserOptions: {
jsxPragma: 'h',
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
ignoreRestSiblings: true,
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-empty-interface': [
'error',
{
allowSingleExtends: true,
},
],
},
},
{
files: ['**/*.js', '**/*.jsx'],
extends: ['eslint:recommended'],
rules: {
'no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
},
],
},
env: {
node: true,
},
},
{
files: '**/*.mjs',
parserOptions: {
sourceType: 'module',
ecmaVersion: 2022,
},
},
],
root: true,
};