@aryaemami59/eslint-config 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +99 -195
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +98 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +98 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +94 -167
- package/dist/index.js.map +1 -1
- package/package.json +13 -16
- package/src/disabledRules.ts +1 -1
- package/src/external.ts +23 -9
- package/src/globalIgnores.ts +1 -1
- package/src/globals.ts +15 -8
- package/src/index.ts +11 -10
- package/src/packageJsonName.ts +1 -1
- package/src/shareableConfigs.ts +147 -135
package/src/shareableConfigs.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import packageJson from '
|
|
1
|
+
import packageJson from '@aryaemami59/eslint-config/package.json' with { type: 'json' }
|
|
2
2
|
import { disabledRules } from './disabledRules.js'
|
|
3
|
-
import type { Config,
|
|
4
|
-
import {
|
|
3
|
+
import type { Config, ESLint, Linter, TSESLintFlatConfig } from './external.js'
|
|
4
|
+
import {
|
|
5
|
+
js,
|
|
6
|
+
prettierConfig,
|
|
7
|
+
tseslintConfigs,
|
|
8
|
+
tseslintParser,
|
|
9
|
+
tseslintPlugin,
|
|
10
|
+
} from './external.js'
|
|
5
11
|
import { globalIgnores } from './globalIgnores.js'
|
|
6
|
-
import {
|
|
12
|
+
import { sharedEnvironmentGlobals } from './globals.js'
|
|
7
13
|
|
|
8
14
|
/**
|
|
9
15
|
* Flat ESLint configuration tailored for projects using TypeScript.
|
|
@@ -55,155 +61,161 @@ export const flatESLintConfig = [
|
|
|
55
61
|
{
|
|
56
62
|
name: `${js.meta.name}/recommended`,
|
|
57
63
|
...js.configs.recommended,
|
|
58
|
-
} as const satisfies
|
|
64
|
+
} as const satisfies TSESLintFlatConfig.Config satisfies Config,
|
|
59
65
|
|
|
60
66
|
// TODO: You can remove the type assertion in the next major version of `typescript-eslint`.
|
|
61
67
|
// TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
|
|
62
|
-
|
|
68
|
+
...(tseslintConfigs.recommended satisfies TSESLintFlatConfig.Config[] satisfies Config[] as Config[]),
|
|
63
69
|
// TODO: You can remove the type assertion in the next major version of `typescript-eslint`.
|
|
64
70
|
// TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
|
|
65
|
-
|
|
71
|
+
...(tseslintConfigs.stylistic satisfies TSESLintFlatConfig.Config[] satisfies Config[] as Config[]),
|
|
66
72
|
|
|
67
73
|
{
|
|
68
74
|
languageOptions: {
|
|
69
|
-
globals,
|
|
75
|
+
globals: sharedEnvironmentGlobals,
|
|
76
|
+
parser:
|
|
77
|
+
tseslintParser satisfies TSESLintFlatConfig.Parser satisfies Linter.Parser as Linter.Parser,
|
|
70
78
|
parserOptions: {
|
|
71
79
|
ecmaVersion: 'latest',
|
|
72
80
|
projectService: true,
|
|
73
|
-
} as const satisfies
|
|
74
|
-
},
|
|
81
|
+
} as const satisfies TSESLintFlatConfig.ParserOptions satisfies Linter.ParserOptions,
|
|
82
|
+
} as const satisfies TSESLintFlatConfig.LanguageOptions satisfies Linter.LanguageOptions,
|
|
75
83
|
linterOptions: {
|
|
76
84
|
reportUnusedDisableDirectives: 2,
|
|
77
85
|
reportUnusedInlineConfigs: 2,
|
|
78
86
|
},
|
|
79
87
|
name: `${packageJson.name}/defaults/overrides`,
|
|
88
|
+
plugins: {
|
|
89
|
+
'@typescript-eslint':
|
|
90
|
+
tseslintPlugin satisfies TSESLintFlatConfig.Plugin satisfies ESLint.Plugin as ESLint.Plugin,
|
|
91
|
+
},
|
|
80
92
|
|
|
81
93
|
rules: {
|
|
82
94
|
// TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.
|
|
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
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
95
|
+
'@typescript-eslint/consistent-type-definitions': [2, 'type'],
|
|
96
|
+
'@typescript-eslint/consistent-type-exports': [
|
|
97
|
+
2,
|
|
98
|
+
{ fixMixedExportsWithInlineTypeSpecifier: false },
|
|
99
|
+
],
|
|
100
|
+
'@typescript-eslint/consistent-type-imports': [
|
|
101
|
+
2,
|
|
102
|
+
{
|
|
103
|
+
disallowTypeAnnotations: true,
|
|
104
|
+
fixStyle: 'separate-type-imports',
|
|
105
|
+
prefer: 'type-imports',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
'@typescript-eslint/no-confusing-void-expression': [
|
|
109
|
+
2,
|
|
110
|
+
{
|
|
111
|
+
ignoreArrowShorthand: false,
|
|
112
|
+
ignoreVoidOperator: false,
|
|
113
|
+
ignoreVoidReturningFunctions: false,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
'@typescript-eslint/no-duplicate-type-constituents': [
|
|
117
|
+
2,
|
|
118
|
+
{
|
|
119
|
+
ignoreIntersections: false,
|
|
120
|
+
ignoreUnions: false,
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
'@typescript-eslint/no-empty-object-type': [
|
|
124
|
+
2,
|
|
125
|
+
{
|
|
126
|
+
allowInterfaces: 'never',
|
|
127
|
+
allowObjectTypes: 'never',
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
'@typescript-eslint/no-explicit-any': [
|
|
131
|
+
2,
|
|
132
|
+
{
|
|
133
|
+
fixToUnknown: false,
|
|
134
|
+
ignoreRestArgs: false,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
'@typescript-eslint/no-inferrable-types': [
|
|
138
|
+
2,
|
|
139
|
+
{
|
|
140
|
+
ignoreParameters: false,
|
|
141
|
+
ignoreProperties: false,
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
'@typescript-eslint/no-invalid-void-type': [
|
|
145
|
+
2,
|
|
146
|
+
{
|
|
147
|
+
allowAsThisParameter: false,
|
|
148
|
+
allowInGenericTypeArguments: true,
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
'@typescript-eslint/no-namespace': [
|
|
152
|
+
2,
|
|
153
|
+
{
|
|
154
|
+
allowDeclarations: false,
|
|
155
|
+
allowDefinitionFiles: true,
|
|
156
|
+
},
|
|
157
|
+
],
|
|
158
|
+
'@typescript-eslint/no-redundant-type-constituents': [2],
|
|
159
|
+
'@typescript-eslint/no-require-imports': [
|
|
160
|
+
2,
|
|
161
|
+
{
|
|
162
|
+
allow: [],
|
|
163
|
+
allowAsImport: true,
|
|
164
|
+
},
|
|
165
|
+
],
|
|
166
|
+
'@typescript-eslint/no-restricted-types': [
|
|
167
|
+
2,
|
|
168
|
+
{
|
|
169
|
+
types: {
|
|
170
|
+
'{}': {
|
|
171
|
+
message: `
|
|
172
|
+
- If you want to represent an empty object, use \`type EmptyObject = Record<string, never>\`.
|
|
173
|
+
- If you want to represent an object literal, use either \`type AnyObject = Record<string, any>\` or \`object\`.
|
|
174
|
+
- If you want to represent any non-nullish value, use \`type AnyNonNullishValue = NonNullable<unknown>\`.`,
|
|
175
|
+
suggest: [
|
|
176
|
+
'AnyNonNullishValue',
|
|
177
|
+
'EmptyObject',
|
|
178
|
+
'AnyObject',
|
|
179
|
+
'object',
|
|
180
|
+
'Record<string, never>',
|
|
181
|
+
'Record<string, any>',
|
|
182
|
+
'NonNullable<unknown>',
|
|
183
|
+
],
|
|
184
|
+
},
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
'@typescript-eslint/no-unnecessary-type-arguments': [2],
|
|
189
|
+
'@typescript-eslint/no-unnecessary-type-assertion': [
|
|
190
|
+
2,
|
|
191
|
+
{ typesToIgnore: [] },
|
|
192
|
+
],
|
|
193
|
+
'@typescript-eslint/no-unnecessary-type-parameters': [2],
|
|
194
|
+
'@typescript-eslint/prefer-nullish-coalescing': [
|
|
195
|
+
2,
|
|
196
|
+
{
|
|
197
|
+
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
|
|
198
|
+
ignoreBooleanCoercion: false,
|
|
199
|
+
ignoreConditionalTests: true,
|
|
200
|
+
ignoreIfStatements: false,
|
|
201
|
+
ignoreMixedLogicalExpressions: false,
|
|
202
|
+
ignorePrimitives: {
|
|
203
|
+
bigint: false,
|
|
204
|
+
boolean: false,
|
|
205
|
+
number: false,
|
|
206
|
+
string: false,
|
|
207
|
+
},
|
|
208
|
+
ignoreTernaryTests: false,
|
|
209
|
+
},
|
|
210
|
+
],
|
|
211
|
+
'@typescript-eslint/require-await': [2],
|
|
212
|
+
'@typescript-eslint/unified-signatures': [
|
|
213
|
+
2,
|
|
214
|
+
{
|
|
215
|
+
ignoreDifferentlyNamedParameters: false,
|
|
216
|
+
ignoreOverloadsWithDifferentJSDoc: false,
|
|
217
|
+
},
|
|
218
|
+
],
|
|
207
219
|
'object-shorthand': [
|
|
208
220
|
2,
|
|
209
221
|
'always',
|
|
@@ -233,7 +245,7 @@ export const flatESLintConfig = [
|
|
|
233
245
|
files: ['**/*.cjs'],
|
|
234
246
|
languageOptions: {
|
|
235
247
|
sourceType: 'commonjs',
|
|
236
|
-
} as const satisfies
|
|
248
|
+
} as const satisfies TSESLintFlatConfig.LanguageOptions satisfies Linter.LanguageOptions,
|
|
237
249
|
name: `${packageJson.name}/commonjs-files`,
|
|
238
250
|
rules: {
|
|
239
251
|
'@typescript-eslint/no-require-imports': [
|