forked from momentum-design/momentum-design
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
93 lines (93 loc) · 2.34 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
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'airbnb-base',
'plugin:json/recommended',
'plugin:astro/recommended',
],
globals: {
BufferEncoding: 'readonly',
},
ignorePatterns: ['**/dist/**', '*.hbs', 'scripts/**', '**/husky/**', '**/Dockerfile.*'],
overrides: [
{
files: ['**/*.test.ts'],
env: {
jest: true,
node: true,
},
},
{
// Define the configuration for `.astro` file.
files: ['*.astro'],
// Allows Astro components to be parsed.
parser: 'astro-eslint-parser',
// Parse the script in `.astro` as TypeScript by adding the following configuration.
// It's the setting you need when using TypeScript.
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro'],
},
rules: {
'prettier/prettier': 'off',
'no-tabs': 'off',
},
},
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
'eslint-plugin-tsdoc',
],
rules: {
'@typescript-eslint/quotes': [
'error',
'single',
{
allowTemplateLiterals: true,
},
],
'linebreak-style': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'class-methods-use-this': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': ['off', {
devDependencies: [
'**/config/**/*.*',
'**/jest.config.*',
'**/test/**/*.*',
],
}],
'import/no-relative-packages': 'off',
'import/prefer-default-export': 'off',
'no-confusing-arrow': 'off',
'no-shadow': 'off',
'no-unused-vars': 'off',
'max-len': ['error', { code: 120 }],
indent: ['error', 2, { ignoredNodes: ['PropertyDefinition'], SwitchCase: 1 }],
'object-curly-newline': 'off',
'tsdoc/syntax': 'warn',
'no-unsafe-optional-chaining': 'off',
'no-nonoctal-decimal-escape': 'off',
'json/*': ['error', { allowComments: true }],
},
settings: {
'import/extensions': ['.js', '.jsx', '.ts', '.tsx'],
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
};