forked from import-js/eslint-plugin-import
-
-
Notifications
You must be signed in to change notification settings - Fork 19
/
.eslintrc.js
122 lines (119 loc) · 3.07 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/**
* @type {import('eslint').Linter.Config}
*/
module.exports = {
root: true,
reportUnusedDisableDirectives: true,
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:eslint-plugin/recommended',
'plugin:import-x/recommended',
'plugin:n/recommended',
'plugin:unicorn/recommended',
'plugin:prettier/recommended',
],
env: {
node: true,
es6: true,
es2017: true,
},
parserOptions: {
sourceType: 'module',
ecmaVersion: 2020,
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-require-imports': 'off',
'eslint-plugin/consistent-output': ['error', 'always'],
'eslint-plugin/meta-property-ordering': 'error',
'eslint-plugin/no-deprecated-context-methods': 'error',
'eslint-plugin/no-deprecated-report-api': 'off',
'eslint-plugin/prefer-replace-text': 'error',
'eslint-plugin/report-message-format': 'error',
'eslint-plugin/require-meta-docs-description': [
'error',
{ pattern: String.raw`^(Enforce|Ensure|Prefer|Forbid).+\.$` },
],
'eslint-plugin/require-meta-schema': 'error',
'eslint-plugin/require-meta-type': 'error',
'n/no-extraneous-require': 'off',
'n/no-missing-import': 'off',
'n/no-missing-require': 'off',
'n/no-unsupported-features/es-syntax': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-array-reduce': 'off',
'unicorn/no-null': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-at': 'off',
// dog fooding
'import-x/no-extraneous-dependencies': [
'error',
{
devDependencies: ['test/**'],
optionalDependencies: false,
peerDependencies: true,
bundledDependencies: false,
},
],
'import-x/unambiguous': 'off',
},
overrides: [
{
files: ['*.ts'],
excludedFiles: ['test/fixtures'],
rules: {
'@typescript-eslint/array-type': [
2,
{
default: 'array-simple',
},
],
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/consistent-type-imports': [
'error',
{
fixStyle: 'inline-type-imports',
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'import-x/consistent-type-specifier-style': 'error',
'import-x/order': [
'error',
{
alphabetize: {
order: 'asc',
},
'newlines-between': 'always',
},
],
},
settings: {
'import-x/resolver': {
typescript: {
project: 'tsconfig.base.json',
},
},
},
},
{
files: 'test/**',
env: {
jest: true,
},
},
{
files: 'global.d.ts',
rules: {
'import-x/no-extraneous-dependencies': 0,
},
},
],
}