@aryaemami59/eslint-config 0.0.6 → 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 +103 -205
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +100 -9
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +100 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +97 -182
- package/dist/index.js.map +1 -1
- package/package.json +13 -16
- package/src/disabledRules.ts +2 -2
- package/src/external.ts +25 -8
- package/src/globalIgnores.ts +3 -3
- package/src/globals.ts +15 -8
- package/src/index.ts +13 -9
- package/src/packageJsonName.ts +1 -1
- package/src/shareableConfigs.ts +152 -141
- package/src/utils.ts +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
1
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
4
|
//#region \0rolldown/runtime.js
|
|
3
5
|
var __create = Object.create;
|
|
@@ -32,17 +34,10 @@ let eslint_config_prettier_flat = require("eslint-config-prettier/flat");
|
|
|
32
34
|
eslint_config_prettier_flat = __toESM(eslint_config_prettier_flat);
|
|
33
35
|
let globals = require("globals");
|
|
34
36
|
globals = __toESM(globals);
|
|
35
|
-
let typescript_eslint = require("typescript-eslint");
|
|
36
37
|
let eslint_config = require("eslint/config");
|
|
38
|
+
let typescript_eslint = require("typescript-eslint");
|
|
37
39
|
|
|
38
40
|
//#region src/disabledRules.ts
|
|
39
|
-
/**
|
|
40
|
-
* An object comprised of ESLint rules to disable.
|
|
41
|
-
* These rules are disabled in {@linkcode flatESLintConfig}.
|
|
42
|
-
*
|
|
43
|
-
* @since 0.0.3
|
|
44
|
-
* @public
|
|
45
|
-
*/
|
|
46
41
|
const disabledRules = {
|
|
47
42
|
"@typescript-eslint/ban-ts-comment": [0, {
|
|
48
43
|
minimumDescriptionLength: 3,
|
|
@@ -51,7 +46,6 @@ const disabledRules = {
|
|
|
51
46
|
"ts-ignore": true,
|
|
52
47
|
"ts-nocheck": true
|
|
53
48
|
}],
|
|
54
|
-
"@typescript-eslint/consistent-generic-constructors": [0],
|
|
55
49
|
"@typescript-eslint/no-unused-vars": [0, {
|
|
56
50
|
args: "after-used",
|
|
57
51
|
argsIgnorePattern: "^_",
|
|
@@ -69,34 +63,14 @@ const disabledRules = {
|
|
|
69
63
|
|
|
70
64
|
//#endregion
|
|
71
65
|
//#region src/external.ts
|
|
72
|
-
const { browser, node, nodeBuiltin, vitest } = globals.default;
|
|
66
|
+
const { browser: browserGlobals, node: nodeGlobals, nodeBuiltin: nodeBuiltinGlobals, vitest: vitestTestGlobals } = globals.default;
|
|
73
67
|
|
|
74
68
|
//#endregion
|
|
75
69
|
//#region package.json
|
|
76
70
|
var name = "@aryaemami59/eslint-config";
|
|
77
71
|
|
|
78
|
-
//#endregion
|
|
79
|
-
//#region src/packageJsonName.ts
|
|
80
|
-
/**
|
|
81
|
-
* This is used because if we import the package name from the
|
|
82
|
-
* `package.json` file, it will be bundled into the final output,
|
|
83
|
-
* which is not desired.
|
|
84
|
-
*
|
|
85
|
-
* @since 0.0.5
|
|
86
|
-
* @internal
|
|
87
|
-
*/
|
|
88
|
-
const packageJsonName = name;
|
|
89
|
-
|
|
90
72
|
//#endregion
|
|
91
73
|
//#region src/globalIgnores.ts
|
|
92
|
-
/**
|
|
93
|
-
* An object representing
|
|
94
|
-
* {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files | **global ignore patterns**}
|
|
95
|
-
* for ESLint configuration.
|
|
96
|
-
*
|
|
97
|
-
* @since 0.0.3
|
|
98
|
-
* @public
|
|
99
|
-
*/
|
|
100
74
|
const globalIgnores = {
|
|
101
75
|
ignores: [
|
|
102
76
|
"**/__snapshots__/",
|
|
@@ -116,22 +90,16 @@ const globalIgnores = {
|
|
|
116
90
|
"**/dist/",
|
|
117
91
|
"**/temp/"
|
|
118
92
|
],
|
|
119
|
-
name: `${
|
|
93
|
+
name: `${name}/global-ignores`
|
|
120
94
|
};
|
|
121
95
|
|
|
122
96
|
//#endregion
|
|
123
97
|
//#region src/globals.ts
|
|
124
|
-
/**
|
|
125
|
-
* An object representing the
|
|
126
|
-
* {@link https://vitest.dev/config/#globals | globals} provided by
|
|
127
|
-
* {@link https://vitest.dev | **Vitest**} for use in testing.
|
|
128
|
-
*
|
|
129
|
-
* @since 0.0.3
|
|
130
|
-
* @public
|
|
131
|
-
*/
|
|
132
98
|
const vitestGlobals = {
|
|
133
99
|
afterAll: "writable",
|
|
134
100
|
afterEach: "writable",
|
|
101
|
+
aroundAll: "writable",
|
|
102
|
+
aroundEach: "writable",
|
|
135
103
|
assert: "writable",
|
|
136
104
|
assertType: "writable",
|
|
137
105
|
beforeAll: "writable",
|
|
@@ -148,75 +116,29 @@ const vitestGlobals = {
|
|
|
148
116
|
vi: "writable",
|
|
149
117
|
vitest: "writable"
|
|
150
118
|
};
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
* @since 0.0.3
|
|
156
|
-
* @public
|
|
157
|
-
*/
|
|
158
|
-
const globals$1 = /* @__PURE__ */ Object.assign({
|
|
159
|
-
...browser,
|
|
160
|
-
...node,
|
|
161
|
-
...nodeBuiltin
|
|
119
|
+
const sharedEnvironmentGlobals = /* @__PURE__ */ Object.assign({
|
|
120
|
+
...browserGlobals,
|
|
121
|
+
...nodeGlobals,
|
|
122
|
+
...nodeBuiltinGlobals
|
|
162
123
|
}, {
|
|
163
|
-
...
|
|
124
|
+
...vitestTestGlobals,
|
|
164
125
|
...vitestGlobals
|
|
165
126
|
});
|
|
166
127
|
|
|
167
128
|
//#endregion
|
|
168
129
|
//#region src/shareableConfigs.ts
|
|
169
|
-
/**
|
|
170
|
-
* Flat ESLint configuration tailored for projects using TypeScript.
|
|
171
|
-
*
|
|
172
|
-
* @example
|
|
173
|
-
* <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>
|
|
174
|
-
*
|
|
175
|
-
* ```ts
|
|
176
|
-
* import { flatESLintConfig } from '@aryaemami59/eslint-config'
|
|
177
|
-
*
|
|
178
|
-
* export default flatESLintConfig
|
|
179
|
-
* ```
|
|
180
|
-
*
|
|
181
|
-
* @example
|
|
182
|
-
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>
|
|
183
|
-
*
|
|
184
|
-
* ```ts
|
|
185
|
-
* const { flatESLintConfig } = require('@aryaemami59/eslint-config')
|
|
186
|
-
*
|
|
187
|
-
* module.exports = flatESLintConfig
|
|
188
|
-
* ```
|
|
189
|
-
*
|
|
190
|
-
* @example
|
|
191
|
-
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)__</caption>
|
|
192
|
-
*
|
|
193
|
-
* ```ts
|
|
194
|
-
* module.exports = (async () =>
|
|
195
|
-
* (await import('@aryaemami59/eslint-config')).flatESLintConfig)()
|
|
196
|
-
* ```
|
|
197
|
-
*
|
|
198
|
-
* @example
|
|
199
|
-
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>
|
|
200
|
-
*
|
|
201
|
-
* ```ts
|
|
202
|
-
* import eslintConfigModule = require('@aryaemami59/eslint-config')
|
|
203
|
-
* import flatESLintConfig = eslintConfigModule.flatESLintConfig
|
|
204
|
-
*
|
|
205
|
-
* export = flatESLintConfig
|
|
206
|
-
* ```
|
|
207
|
-
*
|
|
208
|
-
* @since 0.0.3
|
|
209
|
-
* @public
|
|
210
|
-
*/
|
|
211
130
|
const flatESLintConfig = [
|
|
212
131
|
globalIgnores,
|
|
213
132
|
{
|
|
214
133
|
name: `${_eslint_js.default.meta.name}/recommended`,
|
|
215
134
|
..._eslint_js.default.configs.recommended
|
|
216
135
|
},
|
|
136
|
+
...typescript_eslint.configs.recommended,
|
|
137
|
+
...typescript_eslint.configs.stylistic,
|
|
217
138
|
{
|
|
218
139
|
languageOptions: {
|
|
219
|
-
globals:
|
|
140
|
+
globals: sharedEnvironmentGlobals,
|
|
141
|
+
parser: typescript_eslint.parser,
|
|
220
142
|
parserOptions: {
|
|
221
143
|
ecmaVersion: "latest",
|
|
222
144
|
projectService: true
|
|
@@ -226,8 +148,87 @@ const flatESLintConfig = [
|
|
|
226
148
|
reportUnusedDisableDirectives: 2,
|
|
227
149
|
reportUnusedInlineConfigs: 2
|
|
228
150
|
},
|
|
229
|
-
name: `${
|
|
151
|
+
name: `${name}/defaults/overrides`,
|
|
152
|
+
plugins: { "@typescript-eslint": typescript_eslint.plugin },
|
|
230
153
|
rules: {
|
|
154
|
+
"@typescript-eslint/consistent-type-definitions": [2, "type"],
|
|
155
|
+
"@typescript-eslint/consistent-type-exports": [2, { fixMixedExportsWithInlineTypeSpecifier: false }],
|
|
156
|
+
"@typescript-eslint/consistent-type-imports": [2, {
|
|
157
|
+
disallowTypeAnnotations: true,
|
|
158
|
+
fixStyle: "separate-type-imports",
|
|
159
|
+
prefer: "type-imports"
|
|
160
|
+
}],
|
|
161
|
+
"@typescript-eslint/no-confusing-void-expression": [2, {
|
|
162
|
+
ignoreArrowShorthand: false,
|
|
163
|
+
ignoreVoidOperator: false,
|
|
164
|
+
ignoreVoidReturningFunctions: false
|
|
165
|
+
}],
|
|
166
|
+
"@typescript-eslint/no-duplicate-type-constituents": [2, {
|
|
167
|
+
ignoreIntersections: false,
|
|
168
|
+
ignoreUnions: false
|
|
169
|
+
}],
|
|
170
|
+
"@typescript-eslint/no-empty-object-type": [2, {
|
|
171
|
+
allowInterfaces: "never",
|
|
172
|
+
allowObjectTypes: "never"
|
|
173
|
+
}],
|
|
174
|
+
"@typescript-eslint/no-explicit-any": [2, {
|
|
175
|
+
fixToUnknown: false,
|
|
176
|
+
ignoreRestArgs: false
|
|
177
|
+
}],
|
|
178
|
+
"@typescript-eslint/no-inferrable-types": [2, {
|
|
179
|
+
ignoreParameters: false,
|
|
180
|
+
ignoreProperties: false
|
|
181
|
+
}],
|
|
182
|
+
"@typescript-eslint/no-invalid-void-type": [2, {
|
|
183
|
+
allowAsThisParameter: false,
|
|
184
|
+
allowInGenericTypeArguments: true
|
|
185
|
+
}],
|
|
186
|
+
"@typescript-eslint/no-namespace": [2, {
|
|
187
|
+
allowDeclarations: false,
|
|
188
|
+
allowDefinitionFiles: true
|
|
189
|
+
}],
|
|
190
|
+
"@typescript-eslint/no-redundant-type-constituents": [2],
|
|
191
|
+
"@typescript-eslint/no-require-imports": [2, {
|
|
192
|
+
allow: [],
|
|
193
|
+
allowAsImport: true
|
|
194
|
+
}],
|
|
195
|
+
"@typescript-eslint/no-restricted-types": [2, { types: { "{}": {
|
|
196
|
+
message: `
|
|
197
|
+
- If you want to represent an empty object, use \`type EmptyObject = Record<string, never>\`.
|
|
198
|
+
- If you want to represent an object literal, use either \`type AnyObject = Record<string, any>\` or \`object\`.
|
|
199
|
+
- If you want to represent any non-nullish value, use \`type AnyNonNullishValue = NonNullable<unknown>\`.`,
|
|
200
|
+
suggest: [
|
|
201
|
+
"AnyNonNullishValue",
|
|
202
|
+
"EmptyObject",
|
|
203
|
+
"AnyObject",
|
|
204
|
+
"object",
|
|
205
|
+
"Record<string, never>",
|
|
206
|
+
"Record<string, any>",
|
|
207
|
+
"NonNullable<unknown>"
|
|
208
|
+
]
|
|
209
|
+
} } }],
|
|
210
|
+
"@typescript-eslint/no-unnecessary-type-arguments": [2],
|
|
211
|
+
"@typescript-eslint/no-unnecessary-type-assertion": [2, { typesToIgnore: [] }],
|
|
212
|
+
"@typescript-eslint/no-unnecessary-type-parameters": [2],
|
|
213
|
+
"@typescript-eslint/prefer-nullish-coalescing": [2, {
|
|
214
|
+
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
|
|
215
|
+
ignoreBooleanCoercion: false,
|
|
216
|
+
ignoreConditionalTests: true,
|
|
217
|
+
ignoreIfStatements: false,
|
|
218
|
+
ignoreMixedLogicalExpressions: false,
|
|
219
|
+
ignorePrimitives: {
|
|
220
|
+
bigint: false,
|
|
221
|
+
boolean: false,
|
|
222
|
+
number: false,
|
|
223
|
+
string: false
|
|
224
|
+
},
|
|
225
|
+
ignoreTernaryTests: false
|
|
226
|
+
}],
|
|
227
|
+
"@typescript-eslint/require-await": [2],
|
|
228
|
+
"@typescript-eslint/unified-signatures": [2, {
|
|
229
|
+
ignoreDifferentlyNamedParameters: false,
|
|
230
|
+
ignoreOverloadsWithDifferentJSDoc: false
|
|
231
|
+
}],
|
|
231
232
|
"object-shorthand": [
|
|
232
233
|
2,
|
|
233
234
|
"always",
|
|
@@ -256,7 +257,7 @@ const flatESLintConfig = [
|
|
|
256
257
|
{
|
|
257
258
|
files: ["**/*.cjs"],
|
|
258
259
|
languageOptions: { sourceType: "commonjs" },
|
|
259
|
-
name: `${
|
|
260
|
+
name: `${name}/commonjs-files`,
|
|
260
261
|
rules: { "@typescript-eslint/no-require-imports": [0, {
|
|
261
262
|
allow: [],
|
|
262
263
|
allowAsImport: false
|
|
@@ -267,123 +268,20 @@ const flatESLintConfig = [
|
|
|
267
268
|
|
|
268
269
|
//#endregion
|
|
269
270
|
//#region src/utils.ts
|
|
270
|
-
/**
|
|
271
|
-
* A function that returns {@linkcode flatESLintConfig}
|
|
272
|
-
* along with optional additional overrides.
|
|
273
|
-
* It's made mainly to provide intellisense and eliminate
|
|
274
|
-
* the need for manual type annotations using JSDoc comments.
|
|
275
|
-
*
|
|
276
|
-
* @param [additionalOverrides=[]] - **Optional** additional overrides to apply to the configuration.
|
|
277
|
-
* @returns An augmented version of the default {@linkcode flatESLintConfig}, incorporating any provided overrides.
|
|
278
|
-
*
|
|
279
|
-
* @example
|
|
280
|
-
* <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>
|
|
281
|
-
*
|
|
282
|
-
* ```ts
|
|
283
|
-
* import { createESLintConfig } from '@aryaemami59/eslint-config'
|
|
284
|
-
*
|
|
285
|
-
* export default createESLintConfig([
|
|
286
|
-
* {
|
|
287
|
-
* rules: {
|
|
288
|
-
* 'no-console': [0],
|
|
289
|
-
* },
|
|
290
|
-
* },
|
|
291
|
-
* {
|
|
292
|
-
* // ...Other additional overrides
|
|
293
|
-
* },
|
|
294
|
-
* ])
|
|
295
|
-
* ```
|
|
296
|
-
*
|
|
297
|
-
* @example
|
|
298
|
-
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>
|
|
299
|
-
*
|
|
300
|
-
* ```ts
|
|
301
|
-
* const { createESLintConfig } = require('@aryaemami59/eslint-config')
|
|
302
|
-
*
|
|
303
|
-
* module.exports = createESLintConfig([
|
|
304
|
-
* {
|
|
305
|
-
* rules: {
|
|
306
|
-
* 'no-console': [0],
|
|
307
|
-
* },
|
|
308
|
-
* },
|
|
309
|
-
* {
|
|
310
|
-
* // ...Other additional overrides
|
|
311
|
-
* },
|
|
312
|
-
* ])
|
|
313
|
-
* ```
|
|
314
|
-
*
|
|
315
|
-
* @example
|
|
316
|
-
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)__</caption>
|
|
317
|
-
*
|
|
318
|
-
* ```ts
|
|
319
|
-
* module.exports = (async () =>
|
|
320
|
-
* (await import('@aryaemami59/eslint-config')).createESLintConfig([
|
|
321
|
-
* {
|
|
322
|
-
* rules: {
|
|
323
|
-
* 'no-console': [0],
|
|
324
|
-
* },
|
|
325
|
-
* },
|
|
326
|
-
* {
|
|
327
|
-
* // ...Other additional overrides
|
|
328
|
-
* },
|
|
329
|
-
* ]))()
|
|
330
|
-
* ```
|
|
331
|
-
*
|
|
332
|
-
* @example
|
|
333
|
-
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>
|
|
334
|
-
*
|
|
335
|
-
* ```ts
|
|
336
|
-
* import eslintConfigModule = require('@aryaemami59/eslint-config')
|
|
337
|
-
* import createESLintConfig = eslintConfigModule.createESLintConfig
|
|
338
|
-
*
|
|
339
|
-
* export = createESLintConfig([
|
|
340
|
-
* {
|
|
341
|
-
* rules: {
|
|
342
|
-
* 'no-console': [0],
|
|
343
|
-
* },
|
|
344
|
-
* },
|
|
345
|
-
* {
|
|
346
|
-
* // ...Other additional overrides
|
|
347
|
-
* },
|
|
348
|
-
* ])
|
|
349
|
-
* ```
|
|
350
|
-
*
|
|
351
|
-
* @since 0.0.3
|
|
352
|
-
* @public
|
|
353
|
-
*/
|
|
354
271
|
const createESLintConfig = (additionalOverrides = []) => /* @__PURE__ */ (0, eslint_config.defineConfig)(...flatESLintConfig, ...additionalOverrides);
|
|
355
272
|
|
|
356
273
|
//#endregion
|
|
357
|
-
Object.defineProperty(exports, 'config', {
|
|
358
|
-
enumerable: true,
|
|
359
|
-
get: function () {
|
|
360
|
-
return typescript_eslint.config;
|
|
361
|
-
}
|
|
362
|
-
});
|
|
363
|
-
Object.defineProperty(exports, 'configs', {
|
|
364
|
-
enumerable: true,
|
|
365
|
-
get: function () {
|
|
366
|
-
return typescript_eslint.configs;
|
|
367
|
-
}
|
|
368
|
-
});
|
|
369
274
|
exports.createESLintConfig = createESLintConfig;
|
|
275
|
+
exports.defineConfig = eslint_config.defineConfig;
|
|
370
276
|
exports.disabledRules = disabledRules;
|
|
371
277
|
exports.flatESLintConfig = flatESLintConfig;
|
|
372
278
|
exports.globalIgnores = globalIgnores;
|
|
373
|
-
exports.globals = globals$1;
|
|
374
279
|
exports.js = _eslint_js.default;
|
|
375
|
-
Object.defineProperty(exports, 'parser', {
|
|
376
|
-
enumerable: true,
|
|
377
|
-
get: function () {
|
|
378
|
-
return typescript_eslint.parser;
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
Object.defineProperty(exports, 'plugin', {
|
|
382
|
-
enumerable: true,
|
|
383
|
-
get: function () {
|
|
384
|
-
return typescript_eslint.plugin;
|
|
385
|
-
}
|
|
386
|
-
});
|
|
387
280
|
exports.prettierConfig = eslint_config_prettier_flat.default;
|
|
281
|
+
exports.sharedEnvironmentGlobals = sharedEnvironmentGlobals;
|
|
282
|
+
exports.tseslintConfig = typescript_eslint.config;
|
|
283
|
+
exports.tseslintConfigs = typescript_eslint.configs;
|
|
284
|
+
exports.tseslintParser = typescript_eslint.parser;
|
|
285
|
+
exports.tseslintPlugin = typescript_eslint.plugin;
|
|
388
286
|
exports.vitestGlobals = vitestGlobals;
|
|
389
287
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["globalIdentifiers","packageJson.name","globals","js","prettierConfig"],"sources":["../src/disabledRules.ts","../src/external.ts","../package.json","../src/packageJsonName.ts","../src/globalIgnores.ts","../src/globals.ts","../src/shareableConfigs.ts","../src/utils.ts"],"sourcesContent":["import type { Linter } from 'eslint'\n\n/**\n * An object comprised of ESLint rules to disable.\n * These rules are disabled in {@linkcode flatESLintConfig}.\n *\n * @since 0.0.3\n * @public\n */\nexport const disabledRules = {\n '@typescript-eslint/ban-ts-comment': [\n 0,\n {\n minimumDescriptionLength: 3,\n 'ts-check': false,\n 'ts-expect-error': 'allow-with-description',\n 'ts-ignore': true,\n 'ts-nocheck': true,\n },\n ],\n\n // TODO: Remove this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n '@typescript-eslint/consistent-generic-constructors': [0],\n\n '@typescript-eslint/no-unused-vars': [\n 0,\n {\n args: 'after-used',\n // Not included in default options\n argsIgnorePattern: '^_',\n caughtErrors: 'all',\n // Not included in default options\n caughtErrorsIgnorePattern: '^_',\n // Not included in default options\n destructuredArrayIgnorePattern: '^_',\n ignoreClassWithStaticInitBlock: false,\n ignoreRestSiblings: false,\n reportUsedIgnorePattern: false,\n vars: 'all',\n // Not included in default options\n varsIgnorePattern: '^_',\n },\n ],\n 'no-undef': [\n 0,\n {\n typeof: false,\n },\n ],\n} as const satisfies Linter.RulesRecord satisfies Record<\n keyof Linter.RulesRecord,\n [\n ruleSeverity: Extract<Linter.Severity, 0>,\n ...ruleOptions: readonly unknown[],\n ]\n>\n","import js from '@eslint/js'\nimport prettierConfig from 'eslint-config-prettier/flat'\nimport globalIdentifiers from 'globals'\nexport { config, configs, parser, plugin } from 'typescript-eslint'\nexport type {\n Config,\n ConfigArray,\n ConfigWithExtends,\n FlatConfig,\n InfiniteDepthConfigWithExtends,\n} from 'typescript-eslint'\nexport { js, prettierConfig }\nexport const { browser, node, nodeBuiltin, vitest } = globalIdentifiers\n","","import packageJson from '../package.json' with { type: 'json' }\n\n/**\n * This is used because if we import the package name from the\n * `package.json` file, it will be bundled into the final output,\n * which is not desired.\n *\n * @since 0.0.5\n * @internal\n */\nexport const packageJsonName = packageJson.name\n","import type { Config } from 'eslint/config'\nimport { packageJsonName } from './packageJsonName.js'\n\n/**\n * An object representing\n * {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files | **global ignore patterns**}\n * for ESLint configuration.\n *\n * @since 0.0.3\n * @public\n */\nexport const globalIgnores = {\n ignores: [\n '**/__snapshots__/',\n '**/.docusaurus/',\n '**/.expo/',\n '**/.next/',\n '**/.playwright/',\n '**/.temp/',\n '**/.tmp/',\n '**/.turbo/',\n '**/.wrangler/',\n '**/.yalc/',\n '**/.yarn/',\n '**/*.snap',\n '**/build/',\n '**/coverage/',\n '**/dist/',\n '**/temp/',\n ],\n name: `${packageJsonName}/global-ignores`,\n} as const satisfies Config\n","import type { Linter } from 'eslint'\nimport { browser, node, nodeBuiltin, vitest } from './external.js'\n\n/**\n * An object representing the\n * {@link https://vitest.dev/config/#globals | globals} provided by\n * {@link https://vitest.dev | **Vitest**} for use in testing.\n *\n * @since 0.0.3\n * @public\n */\nexport const vitestGlobals = {\n afterAll: 'writable',\n afterEach: 'writable',\n assert: 'writable',\n assertType: 'writable',\n beforeAll: 'writable',\n beforeEach: 'writable',\n chai: 'writable',\n describe: 'writable',\n expect: 'writable',\n expectTypeOf: 'writable',\n it: 'writable',\n onTestFailed: 'writable',\n onTestFinished: 'writable',\n suite: 'writable',\n test: 'writable',\n vi: 'writable',\n vitest: 'writable',\n} as const satisfies Linter.Globals satisfies Record<\n keyof typeof vitest,\n Extract<Linter.GlobalConf, 'writable'>\n>\n\n/**\n * An object that specifies which global\n * variables are available during linting.\n *\n * @since 0.0.3\n * @public\n */\nexport const globals =\n /* @__PURE__ */\n Object.assign(\n {\n ...browser,\n ...node,\n ...nodeBuiltin,\n } as const satisfies Linter.Globals,\n\n {\n ...vitest,\n ...vitestGlobals,\n } as const satisfies Linter.Globals,\n ) satisfies Linter.Globals\n","import type { Linter } from 'eslint'\nimport { disabledRules } from './disabledRules.js'\nimport type { FlatConfig } from './external.js'\nimport { js, prettierConfig } from './external.js'\nimport { globalIgnores } from './globalIgnores.js'\nimport { globals } from './globals.js'\nimport { packageJsonName } from './packageJsonName.js'\n\n/**\n * Flat ESLint configuration tailored for projects using TypeScript.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { flatESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { flatESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).flatESLintConfig)()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import flatESLintConfig = eslintConfigModule.flatESLintConfig\n *\n * export = flatESLintConfig\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const flatESLintConfig = [\n // `ignores` must be first.\n // config with just `ignores` is the replacement for `.eslintignore`\n globalIgnores,\n\n {\n name: `${js.meta.name}/recommended`,\n ...js.configs.recommended,\n } as const satisfies FlatConfig.Config satisfies Linter.Config,\n\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.recommended satisfies Linter.Config[] as Linter.Config<any>[]),\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // ...(configs.stylistic satisfies Linter.Config[] as Linter.Config<any>[]),\n\n {\n languageOptions: {\n globals,\n parserOptions: {\n ecmaVersion: 'latest',\n projectService: true,\n } as const satisfies FlatConfig.ParserOptions satisfies Linter.ParserOptions,\n },\n linterOptions: {\n reportUnusedDisableDirectives: 2,\n reportUnusedInlineConfigs: 2,\n },\n name: `${packageJsonName}/defaults/overrides`,\n\n rules: {\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // '@typescript-eslint/consistent-type-definitions': [2, 'type'],\n // '@typescript-eslint/consistent-type-exports': [\n // 2,\n // { fixMixedExportsWithInlineTypeSpecifier: false },\n // ],\n // '@typescript-eslint/consistent-type-imports': [\n // 2,\n // {\n // disallowTypeAnnotations: true,\n // fixStyle: 'separate-type-imports',\n // prefer: 'type-imports',\n // },\n // ],\n // '@typescript-eslint/no-confusing-void-expression': [\n // 2,\n // {\n // ignoreArrowShorthand: false,\n // ignoreVoidOperator: false,\n // ignoreVoidReturningFunctions: false,\n // },\n // ],\n // '@typescript-eslint/no-duplicate-type-constituents': [\n // 2,\n // {\n // ignoreIntersections: false,\n // ignoreUnions: false,\n // },\n // ],\n // '@typescript-eslint/no-empty-object-type': [\n // 2,\n // {\n // allowInterfaces: 'never',\n // allowObjectTypes: 'never',\n // },\n // ],\n // '@typescript-eslint/no-explicit-any': [\n // 2,\n // {\n // fixToUnknown: false,\n // ignoreRestArgs: false,\n // },\n // ],\n // '@typescript-eslint/no-inferrable-types': [\n // 2,\n // {\n // ignoreParameters: false,\n // ignoreProperties: false,\n // },\n // ],\n // '@typescript-eslint/no-invalid-void-type': [\n // 2,\n // {\n // allowAsThisParameter: false,\n // allowInGenericTypeArguments: true,\n // },\n // ],\n // '@typescript-eslint/no-namespace': [\n // 2,\n // {\n // allowDeclarations: false,\n // allowDefinitionFiles: true,\n // },\n // ],\n // '@typescript-eslint/no-redundant-type-constituents': [2],\n // '@typescript-eslint/no-require-imports': [\n // 2,\n // {\n // allow: [],\n // allowAsImport: true,\n // },\n // ],\n // '@typescript-eslint/no-restricted-types': [\n // 2,\n // {\n // types: {\n // '{}': {\n // message: `\n // - If you want to represent an empty object, use \\`type EmptyObject = Record<string, never>\\`.\n // - If you want to represent an object literal, use either \\`type AnyObject = Record<string, any>\\` or \\`object\\`.\n // - If you want to represent any non-nullish value, use \\`type AnyNonNullishValue = NonNullable<unknown>\\`.`,\n // suggest: [\n // 'AnyNonNullishValue',\n // 'EmptyObject',\n // 'AnyObject',\n // 'object',\n // 'Record<string, never>',\n // 'Record<string, any>',\n // 'NonNullable<unknown>',\n // ],\n // },\n // },\n // },\n // ],\n // '@typescript-eslint/no-unnecessary-type-arguments': [2],\n // '@typescript-eslint/no-unnecessary-type-assertion': [\n // 2,\n // { typesToIgnore: [] },\n // ],\n // '@typescript-eslint/no-unnecessary-type-parameters': [2],\n // '@typescript-eslint/prefer-nullish-coalescing': [\n // 2,\n // {\n // allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,\n // ignoreBooleanCoercion: false,\n // ignoreConditionalTests: true,\n // ignoreIfStatements: false,\n // ignoreMixedLogicalExpressions: false,\n // ignorePrimitives: {\n // bigint: false,\n // boolean: false,\n // number: false,\n // string: false,\n // },\n // ignoreTernaryTests: false,\n // },\n // ],\n // '@typescript-eslint/require-await': [2],\n // '@typescript-eslint/unified-signatures': [\n // 2,\n // {\n // ignoreDifferentlyNamedParameters: false,\n // ignoreOverloadsWithDifferentJSDoc: false,\n // },\n // ],\n 'object-shorthand': [\n 2,\n 'always',\n {\n avoidExplicitReturnArrows: true,\n avoidQuotes: true,\n ignoreConstructors: true,\n methodsIgnorePattern: '',\n },\n ],\n 'sort-imports': [\n 2,\n {\n allowSeparatedGroups: true,\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n },\n ],\n\n ...disabledRules,\n },\n } as const satisfies Linter.Config,\n\n {\n files: ['**/*.cjs'],\n languageOptions: {\n sourceType: 'commonjs',\n } as const satisfies FlatConfig.LanguageOptions satisfies Linter.LanguageOptions,\n name: `${packageJsonName}/commonjs-files`,\n rules: {\n '@typescript-eslint/no-require-imports': [\n 0,\n {\n allow: [],\n allowAsImport: false,\n },\n ],\n },\n } as const satisfies Linter.Config,\n\n prettierConfig,\n] as const satisfies Linter.Config[]\n","import type { Linter } from 'eslint'\nimport { defineConfig } from 'eslint/config'\nimport { flatESLintConfig } from './shareableConfigs.js'\n\n/**\n * A function that returns {@linkcode flatESLintConfig}\n * along with optional additional overrides.\n * It's made mainly to provide intellisense and eliminate\n * the need for manual type annotations using JSDoc comments.\n *\n * @param [additionalOverrides=[]] - **Optional** additional overrides to apply to the configuration.\n * @returns An augmented version of the default {@linkcode flatESLintConfig}, incorporating any provided overrides.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { createESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { createESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ]))()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import createESLintConfig = eslintConfigModule.createESLintConfig\n *\n * export = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const createESLintConfig = (\n additionalOverrides: Parameters<typeof defineConfig> = [],\n): Linter.Config[] =>\n /* @__PURE__ */ defineConfig(...flatESLintConfig, ...additionalOverrides)\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,MAAa,gBAAgB;CAC3B,qCAAqC,CACnC,GACA;EACE,0BAA0B;EAC1B,YAAY;EACZ,mBAAmB;EACnB,aAAa;EACb,cAAc;EACf,CACF;CAGD,sDAAsD,CAAC,EAAE;CAEzD,qCAAqC,CACnC,GACA;EACE,MAAM;EAEN,mBAAmB;EACnB,cAAc;EAEd,2BAA2B;EAE3B,gCAAgC;EAChC,gCAAgC;EAChC,oBAAoB;EACpB,yBAAyB;EACzB,MAAM;EAEN,mBAAmB;EACpB,CACF;CACD,YAAY,CACV,GACA,EACE,QAAQ,OACT,CACF;CACF;;;;ACrCD,MAAa,EAAE,SAAS,MAAM,aAAa,WAAWA;;;;;;;;;;;;;;;;AEFtD,MAAa,kBAAkBC;;;;;;;;;;;;ACC/B,MAAa,gBAAgB;CAC3B,SAAS;EACP;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACD;CACD,MAAM,GAAG,gBAAgB;CAC1B;;;;;;;;;;;;ACpBD,MAAa,gBAAgB;CAC3B,UAAU;CACV,WAAW;CACX,QAAQ;CACR,YAAY;CACZ,WAAW;CACX,YAAY;CACZ,MAAM;CACN,UAAU;CACV,QAAQ;CACR,cAAc;CACd,IAAI;CACJ,cAAc;CACd,gBAAgB;CAChB,OAAO;CACP,MAAM;CACN,IAAI;CACJ,QAAQ;CACT;;;;;;;;AAYD,MAAaC,YAEX,uBAAO,OACL;CACE,GAAG;CACH,GAAG;CACH,GAAG;CACJ,EAED;CACE,GAAG;CACH,GAAG;CACJ,CACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACJH,MAAa,mBAAmB;CAG9B;CAEA;EACE,MAAM,GAAGC,mBAAG,KAAK,KAAK;EACtB,GAAGA,mBAAG,QAAQ;EACf;CASD;EACE,iBAAiB;GACf;GACA,eAAe;IACb,aAAa;IACb,gBAAgB;IACjB;GACF;EACD,eAAe;GACb,+BAA+B;GAC/B,2BAA2B;GAC5B;EACD,MAAM,GAAG,gBAAgB;EAEzB,OAAO;GA8HL,oBAAoB;IAClB;IACA;IACA;KACE,2BAA2B;KAC3B,aAAa;KACb,oBAAoB;KACpB,sBAAsB;KACvB;IACF;GACD,gBAAgB,CACd,GACA;IACE,sBAAsB;IACtB,YAAY;IACZ,uBAAuB;IACvB,kBAAkB;IAClB,uBAAuB;KAAC;KAAQ;KAAO;KAAY;KAAS;IAC7D,CACF;GAED,GAAG;GACJ;EACF;CAED;EACE,OAAO,CAAC,WAAW;EACnB,iBAAiB,EACf,YAAY,YACb;EACD,MAAM,GAAG,gBAAgB;EACzB,OAAO,EACL,yCAAyC,CACvC,GACA;GACE,OAAO,EAAE;GACT,eAAe;GAChB,CACF,EACF;EACF;CAEDC;CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AClKD,MAAa,sBACX,sBAAuD,EAAE,KAEzC,gDAAa,GAAG,kBAAkB,GAAG,oBAAoB"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["packageJson.name","js","tseslintConfigs","tseslintParser","packageJson.name","tseslintPlugin","prettierConfig"],"sources":["../src/disabledRules.ts","../src/external.ts","../package.json","../src/globalIgnores.ts","../src/globals.ts","../src/shareableConfigs.ts","../src/utils.ts"],"sourcesContent":["import type { Linter } from './external.js'\n\n/**\n * An object comprised of ESLint rules to disable.\n * These rules are disabled in {@linkcode flatESLintConfig}.\n *\n * @since 0.0.3\n * @public\n */\nexport const disabledRules = {\n '@typescript-eslint/ban-ts-comment': [\n 0,\n {\n minimumDescriptionLength: 3,\n 'ts-check': false,\n 'ts-expect-error': 'allow-with-description',\n 'ts-ignore': true,\n 'ts-nocheck': true,\n },\n ],\n\n // TODO: Remove this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n // '@typescript-eslint/consistent-generic-constructors': [0],\n\n '@typescript-eslint/no-unused-vars': [\n 0,\n {\n args: 'after-used',\n // Not included in default options\n argsIgnorePattern: '^_',\n caughtErrors: 'all',\n // Not included in default options\n caughtErrorsIgnorePattern: '^_',\n // Not included in default options\n destructuredArrayIgnorePattern: '^_',\n ignoreClassWithStaticInitBlock: false,\n ignoreRestSiblings: false,\n reportUsedIgnorePattern: false,\n vars: 'all',\n // Not included in default options\n varsIgnorePattern: '^_',\n },\n ],\n 'no-undef': [\n 0,\n {\n typeof: false,\n },\n ],\n} as const satisfies Linter.RulesRecord satisfies Record<\n keyof Linter.RulesRecord,\n [\n ruleSeverity: Extract<Linter.Severity, 0>,\n ...ruleOptions: readonly unknown[],\n ]\n>\n","import js from '@eslint/js'\nimport prettierConfig from 'eslint-config-prettier/flat'\nimport globals from 'globals'\nexport type { ESLint, Linter } from 'eslint'\nexport { defineConfig } from 'eslint/config'\nexport type { Config } from 'eslint/config'\nexport {\n config as tseslintConfig,\n configs as tseslintConfigs,\n parser as tseslintParser,\n plugin as tseslintPlugin,\n} from 'typescript-eslint'\nexport type {\n Config as TSESLintConfig,\n ConfigArray as TSESLintConfigArray,\n ConfigWithExtends as TSESLintConfigWithExtends,\n FlatConfig as TSESLintFlatConfig,\n InfiniteDepthConfigWithExtends as TSESLintInfiniteDepthConfigWithExtends,\n} from 'typescript-eslint'\nexport { js, prettierConfig }\nexport const {\n browser: browserGlobals,\n node: nodeGlobals,\n nodeBuiltin: nodeBuiltinGlobals,\n vitest: vitestTestGlobals,\n} = globals\nexport type GlobalsBrowser = typeof browserGlobals\nexport type GlobalsNode = typeof nodeGlobals\nexport type GlobalsNodeBuiltin = typeof nodeBuiltinGlobals\nexport type GlobalsVitest = typeof vitestTestGlobals\n","","import packageJson from '@aryaemami59/eslint-config/package.json' with { type: 'json' }\nimport type { Config } from './external.js'\n\n/**\n * An object representing\n * {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files | **global ignore patterns**}\n * for ESLint configuration.\n *\n * @since 0.0.3\n * @public\n */\nexport const globalIgnores = {\n ignores: [\n '**/__snapshots__/',\n '**/.docusaurus/',\n '**/.expo/',\n '**/.next/',\n '**/.playwright/',\n '**/.temp/',\n '**/.tmp/',\n '**/.turbo/',\n '**/.wrangler/',\n '**/.yalc/',\n '**/.yarn/',\n '**/*.snap',\n '**/build/',\n '**/coverage/',\n '**/dist/',\n '**/temp/',\n ],\n name: `${packageJson.name}/global-ignores`,\n} as const satisfies Config\n","import type { GlobalsVitest, Linter } from './external.js'\nimport {\n browserGlobals,\n nodeBuiltinGlobals,\n nodeGlobals,\n vitestTestGlobals,\n} from './external.js'\n\n/**\n * An object representing the\n * {@link https://vitest.dev/config/#globals | globals} provided by\n * {@link https://vitest.dev | **Vitest**} for use in testing.\n *\n * @since 0.0.3\n * @public\n */\nexport const vitestGlobals = {\n afterAll: 'writable',\n afterEach: 'writable',\n aroundAll: 'writable',\n aroundEach: 'writable',\n assert: 'writable',\n assertType: 'writable',\n beforeAll: 'writable',\n beforeEach: 'writable',\n chai: 'writable',\n describe: 'writable',\n expect: 'writable',\n expectTypeOf: 'writable',\n it: 'writable',\n onTestFailed: 'writable',\n onTestFinished: 'writable',\n suite: 'writable',\n test: 'writable',\n vi: 'writable',\n vitest: 'writable',\n} as const satisfies Linter.Globals satisfies Record<\n 'aroundAll' | 'aroundEach' | keyof GlobalsVitest,\n Extract<Linter.GlobalConf, 'writable'>\n>\n\n/**\n * An object that specifies which global\n * variables are available during linting.\n *\n * @since 0.0.3\n * @public\n */\nexport const sharedEnvironmentGlobals =\n /* @__PURE__ */\n Object.assign(\n {\n ...browserGlobals,\n ...nodeGlobals,\n ...nodeBuiltinGlobals,\n } as const satisfies Linter.Globals,\n\n {\n ...vitestTestGlobals,\n ...vitestGlobals,\n } as const satisfies Linter.Globals,\n ) satisfies Linter.Globals\n","import packageJson from '@aryaemami59/eslint-config/package.json' with { type: 'json' }\nimport { disabledRules } from './disabledRules.js'\nimport type { Config, ESLint, Linter, TSESLintFlatConfig } from './external.js'\nimport {\n js,\n prettierConfig,\n tseslintConfigs,\n tseslintParser,\n tseslintPlugin,\n} from './external.js'\nimport { globalIgnores } from './globalIgnores.js'\nimport { sharedEnvironmentGlobals } from './globals.js'\n\n/**\n * Flat ESLint configuration tailored for projects using TypeScript.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { flatESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { flatESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = flatESLintConfig\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).flatESLintConfig)()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import flatESLintConfig = eslintConfigModule.flatESLintConfig\n *\n * export = flatESLintConfig\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const flatESLintConfig = [\n // `ignores` must be first.\n // config with just `ignores` is the replacement for `.eslintignore`\n globalIgnores,\n\n {\n name: `${js.meta.name}/recommended`,\n ...js.configs.recommended,\n } as const satisfies TSESLintFlatConfig.Config satisfies Config,\n\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n ...(tseslintConfigs.recommended satisfies TSESLintFlatConfig.Config[] satisfies Config[] as Config[]),\n // TODO: You can remove the type assertion in the next major version of `typescript-eslint`.\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n ...(tseslintConfigs.stylistic satisfies TSESLintFlatConfig.Config[] satisfies Config[] as Config[]),\n\n {\n languageOptions: {\n globals: sharedEnvironmentGlobals,\n parser:\n tseslintParser satisfies TSESLintFlatConfig.Parser satisfies Linter.Parser as Linter.Parser,\n parserOptions: {\n ecmaVersion: 'latest',\n projectService: true,\n } as const satisfies TSESLintFlatConfig.ParserOptions satisfies Linter.ParserOptions,\n } as const satisfies TSESLintFlatConfig.LanguageOptions satisfies Linter.LanguageOptions,\n linterOptions: {\n reportUnusedDisableDirectives: 2,\n reportUnusedInlineConfigs: 2,\n },\n name: `${packageJson.name}/defaults/overrides`,\n plugins: {\n '@typescript-eslint':\n tseslintPlugin satisfies TSESLintFlatConfig.Plugin satisfies ESLint.Plugin as ESLint.Plugin,\n },\n\n rules: {\n // TODO: Uncomment this once https://github.com/typescript-eslint/typescript-eslint/issues/11952 is resolved.\n '@typescript-eslint/consistent-type-definitions': [2, 'type'],\n '@typescript-eslint/consistent-type-exports': [\n 2,\n { fixMixedExportsWithInlineTypeSpecifier: false },\n ],\n '@typescript-eslint/consistent-type-imports': [\n 2,\n {\n disallowTypeAnnotations: true,\n fixStyle: 'separate-type-imports',\n prefer: 'type-imports',\n },\n ],\n '@typescript-eslint/no-confusing-void-expression': [\n 2,\n {\n ignoreArrowShorthand: false,\n ignoreVoidOperator: false,\n ignoreVoidReturningFunctions: false,\n },\n ],\n '@typescript-eslint/no-duplicate-type-constituents': [\n 2,\n {\n ignoreIntersections: false,\n ignoreUnions: false,\n },\n ],\n '@typescript-eslint/no-empty-object-type': [\n 2,\n {\n allowInterfaces: 'never',\n allowObjectTypes: 'never',\n },\n ],\n '@typescript-eslint/no-explicit-any': [\n 2,\n {\n fixToUnknown: false,\n ignoreRestArgs: false,\n },\n ],\n '@typescript-eslint/no-inferrable-types': [\n 2,\n {\n ignoreParameters: false,\n ignoreProperties: false,\n },\n ],\n '@typescript-eslint/no-invalid-void-type': [\n 2,\n {\n allowAsThisParameter: false,\n allowInGenericTypeArguments: true,\n },\n ],\n '@typescript-eslint/no-namespace': [\n 2,\n {\n allowDeclarations: false,\n allowDefinitionFiles: true,\n },\n ],\n '@typescript-eslint/no-redundant-type-constituents': [2],\n '@typescript-eslint/no-require-imports': [\n 2,\n {\n allow: [],\n allowAsImport: true,\n },\n ],\n '@typescript-eslint/no-restricted-types': [\n 2,\n {\n types: {\n '{}': {\n message: `\n - If you want to represent an empty object, use \\`type EmptyObject = Record<string, never>\\`.\n - If you want to represent an object literal, use either \\`type AnyObject = Record<string, any>\\` or \\`object\\`.\n - If you want to represent any non-nullish value, use \\`type AnyNonNullishValue = NonNullable<unknown>\\`.`,\n suggest: [\n 'AnyNonNullishValue',\n 'EmptyObject',\n 'AnyObject',\n 'object',\n 'Record<string, never>',\n 'Record<string, any>',\n 'NonNullable<unknown>',\n ],\n },\n },\n },\n ],\n '@typescript-eslint/no-unnecessary-type-arguments': [2],\n '@typescript-eslint/no-unnecessary-type-assertion': [\n 2,\n { typesToIgnore: [] },\n ],\n '@typescript-eslint/no-unnecessary-type-parameters': [2],\n '@typescript-eslint/prefer-nullish-coalescing': [\n 2,\n {\n allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,\n ignoreBooleanCoercion: false,\n ignoreConditionalTests: true,\n ignoreIfStatements: false,\n ignoreMixedLogicalExpressions: false,\n ignorePrimitives: {\n bigint: false,\n boolean: false,\n number: false,\n string: false,\n },\n ignoreTernaryTests: false,\n },\n ],\n '@typescript-eslint/require-await': [2],\n '@typescript-eslint/unified-signatures': [\n 2,\n {\n ignoreDifferentlyNamedParameters: false,\n ignoreOverloadsWithDifferentJSDoc: false,\n },\n ],\n 'object-shorthand': [\n 2,\n 'always',\n {\n avoidExplicitReturnArrows: true,\n avoidQuotes: true,\n ignoreConstructors: true,\n methodsIgnorePattern: '',\n },\n ],\n 'sort-imports': [\n 2,\n {\n allowSeparatedGroups: true,\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n },\n ],\n\n ...disabledRules,\n },\n } as const satisfies Config,\n\n {\n files: ['**/*.cjs'],\n languageOptions: {\n sourceType: 'commonjs',\n } as const satisfies TSESLintFlatConfig.LanguageOptions satisfies Linter.LanguageOptions,\n name: `${packageJson.name}/commonjs-files`,\n rules: {\n '@typescript-eslint/no-require-imports': [\n 0,\n {\n allow: [],\n allowAsImport: false,\n },\n ],\n },\n } as const satisfies Config,\n\n prettierConfig,\n] as const satisfies Config[]\n","import type { Config } from './external.js'\nimport { defineConfig } from './external.js'\nimport { flatESLintConfig } from './shareableConfigs.js'\n\n/**\n * A function that returns {@linkcode flatESLintConfig}\n * along with optional additional overrides.\n * It's made mainly to provide intellisense and eliminate\n * the need for manual type annotations using JSDoc comments.\n *\n * @param [additionalOverrides=[]] - **Optional** additional overrides to apply to the configuration.\n * @returns An augmented version of the default {@linkcode flatESLintConfig}, incorporating any provided overrides.\n *\n * @example\n * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>\n *\n * ```ts\n * import { createESLintConfig } from '@aryaemami59/eslint-config'\n *\n * export default createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>\n *\n * ```ts\n * const { createESLintConfig } = require('@aryaemami59/eslint-config')\n *\n * module.exports = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)__</caption>\n *\n * ```ts\n * module.exports = (async () =>\n * (await import('@aryaemami59/eslint-config')).createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ]))()\n * ```\n *\n * @example\n * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>\n *\n * ```ts\n * import eslintConfigModule = require('@aryaemami59/eslint-config')\n * import createESLintConfig = eslintConfigModule.createESLintConfig\n *\n * export = createESLintConfig([\n * {\n * rules: {\n * 'no-console': [0],\n * },\n * },\n * {\n * // ...Other additional overrides\n * },\n * ])\n * ```\n *\n * @since 0.0.3\n * @public\n */\nexport const createESLintConfig = (\n additionalOverrides: Parameters<typeof defineConfig> = [],\n): Config[] =>\n /* @__PURE__ */ defineConfig(...flatESLintConfig, ...additionalOverrides)\n"],"mappings":"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"}
|