forked from i18next/i18next
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
104 lines (95 loc) · 2.49 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
99
100
101
102
103
104
/* eslint-disable @typescript-eslint/naming-convention */
/** @type {import('eslint').Linter.Config} */
module.exports = {
root: true,
reportUnusedDisableDirectives: true,
env: {
mocha: true,
browser: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.lint.json',
},
settings: {
'import/resolver': {
typescript: {
project: './tsconfig.lint.json',
},
},
},
plugins: ['@typescript-eslint'],
extends: ['airbnb-base', 'plugin:@typescript-eslint/strict', 'prettier'],
rules: {
'no-plusplus': 'off',
'no-param-reassign': 'off',
'prefer-destructuring': 'off',
'default-param-last': 'off',
'prefer-spread': 'off',
'no-continue': 'off',
'no-constructor-return': 'off',
'consistent-return': 'off',
'import/extensions': 'off',
'import/no-extraneous-dependencies': [
'error',
{ devDependencies: ['./vitest.*.mts', 'rollup.config.mjs', './test/**'] },
],
/** @todo consider to replace `any` with `unknown` */
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': 'error',
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: ['import', 'parameter'],
format: ['camelCase', 'PascalCase'],
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'interface',
format: ['PascalCase'],
filter: 'i18n',
},
{
selector: 'typeAlias',
format: ['PascalCase'],
leadingUnderscore: 'allow',
},
],
},
overrides: [
{
files: ['./test/**/*'],
rules: {
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/ban-ts-comment': [
'error',
{
// this is used for typechecking tests
'ts-expect-error': false,
},
],
},
},
],
};