@aryaemami59/eslint-config 0.0.4 → 0.0.6

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/disabledRules.ts","../src/globalIgnores.ts","../src/globals.ts","../src/shareableConfigs.ts","../src/utils.ts"],"mappings":";;;;;;;;;;;;;;cASa,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAb;cCEa,aAAA;EAAA,SAoBc,OAAA;EAAA,SAAA,IAAA;AAAA;;;;;;;;;;ADtB3B;cEEa,aAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;cA8BA,OAAA;EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAA,CAAO,MAAA"}
package/dist/index.js CHANGED
@@ -1,216 +1,327 @@
1
- // src/index.ts
2
1
  import js from "@eslint/js";
3
- import prettierConfig from "eslint-config-prettier";
2
+ import prettierConfig from "eslint-config-prettier/flat";
4
3
  import globalIdentifiers from "globals";
5
- import { config, configs, parser } from "typescript-eslint";
6
- var { browser, node, nodeBuiltin } = globalIdentifiers;
7
- var globalIgnores = {
8
- name: "@aryaemami59/global-ignores",
9
- ignores: [
10
- "**/dist/",
11
- "**/.yalc/",
12
- "**/build/",
13
- "**/lib/",
14
- "**/temp/",
15
- "**/.yarn/",
16
- "**/coverage/"
17
- ]
4
+ import { config, configs, parser, plugin } from "typescript-eslint";
5
+ import { defineConfig } from "eslint/config";
6
+
7
+ //#region src/disabledRules.ts
8
+ /**
9
+ * An object comprised of ESLint rules to disable.
10
+ * These rules are disabled in {@linkcode flatESLintConfig}.
11
+ *
12
+ * @since 0.0.3
13
+ * @public
14
+ */
15
+ const disabledRules = {
16
+ "@typescript-eslint/ban-ts-comment": [0, {
17
+ minimumDescriptionLength: 3,
18
+ "ts-check": false,
19
+ "ts-expect-error": "allow-with-description",
20
+ "ts-ignore": true,
21
+ "ts-nocheck": true
22
+ }],
23
+ "@typescript-eslint/consistent-generic-constructors": [0],
24
+ "@typescript-eslint/no-unused-vars": [0, {
25
+ args: "after-used",
26
+ argsIgnorePattern: "^_",
27
+ caughtErrors: "all",
28
+ caughtErrorsIgnorePattern: "^_",
29
+ destructuredArrayIgnorePattern: "^_",
30
+ ignoreClassWithStaticInitBlock: false,
31
+ ignoreRestSiblings: false,
32
+ reportUsedIgnorePattern: false,
33
+ vars: "all",
34
+ varsIgnorePattern: "^_"
35
+ }],
36
+ "no-undef": [0, { typeof: false }]
18
37
  };
19
- var vitestGlobals = {
20
- suite: "writable",
21
- test: "writable",
22
- describe: "writable",
23
- it: "writable",
24
- expectTypeOf: "writable",
25
- assertType: "writable",
26
- expect: "writable",
27
- assert: "writable",
28
- vitest: "writable",
29
- vi: "writable",
30
- beforeAll: "writable",
31
- afterAll: "writable",
32
- beforeEach: "writable",
33
- afterEach: "writable",
34
- onTestFailed: "writable",
35
- onTestFinished: "writable"
38
+
39
+ //#endregion
40
+ //#region src/external.ts
41
+ const { browser, node, nodeBuiltin, vitest } = globalIdentifiers;
42
+
43
+ //#endregion
44
+ //#region package.json
45
+ var name = "@aryaemami59/eslint-config";
46
+
47
+ //#endregion
48
+ //#region src/packageJsonName.ts
49
+ /**
50
+ * This is used because if we import the package name from the
51
+ * `package.json` file, it will be bundled into the final output,
52
+ * which is not desired.
53
+ *
54
+ * @since 0.0.5
55
+ * @internal
56
+ */
57
+ const packageJsonName = name;
58
+
59
+ //#endregion
60
+ //#region src/globalIgnores.ts
61
+ /**
62
+ * An object representing
63
+ * {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files | **global ignore patterns**}
64
+ * for ESLint configuration.
65
+ *
66
+ * @since 0.0.3
67
+ * @public
68
+ */
69
+ const globalIgnores = {
70
+ ignores: [
71
+ "**/__snapshots__/",
72
+ "**/.docusaurus/",
73
+ "**/.expo/",
74
+ "**/.next/",
75
+ "**/.playwright/",
76
+ "**/.temp/",
77
+ "**/.tmp/",
78
+ "**/.turbo/",
79
+ "**/.wrangler/",
80
+ "**/.yalc/",
81
+ "**/.yarn/",
82
+ "**/*.snap",
83
+ "**/build/",
84
+ "**/coverage/",
85
+ "**/dist/",
86
+ "**/temp/"
87
+ ],
88
+ name: `${packageJsonName}/global-ignores`
36
89
  };
37
- var globals = /* @__PURE__ */ Object.assign(
38
- vitestGlobals,
39
- browser,
40
- node,
41
- nodeBuiltin
42
- );
43
- var rulesToDisable = {
44
- "no-undef": [0],
45
- "@typescript-eslint/no-unused-vars": [
46
- 0,
47
- {
48
- vars: "all",
49
- args: "after-used",
50
- caughtErrors: "all",
51
- ignoreRestSiblings: false,
52
- reportUsedIgnorePattern: false
53
- }
54
- ],
55
- "@typescript-eslint/ban-ts-comment": [
56
- 0,
57
- [
58
- {
59
- "ts-expect-error": "allow-with-description",
60
- "ts-ignore": true,
61
- "ts-nocheck": true,
62
- "ts-check": false,
63
- minimumDescriptionLength: 3
64
- }
65
- ]
66
- ]
67
- };
68
- var flatESLintConfig = /* @__PURE__ */ config(
69
- // `ignores` must be first.
70
- // config with just `ignores` is the replacement for `.eslintignore`
71
- globalIgnores,
72
- { name: "@aryaemami59/javascript", ...js.configs.recommended },
73
- ...configs.recommended,
74
- ...configs.stylistic,
75
- { name: "@aryaemami59/prettier-config", ...prettierConfig },
76
- {
77
- name: "@aryaemami59/main",
78
- languageOptions: {
79
- globals,
80
- parser,
81
- parserOptions: {
82
- projectService: {
83
- allowDefaultProject: [".*.js", ".*.mjs", ".*.cjs"],
84
- defaultProject: "./tsconfig.json"
85
- },
86
- ecmaVersion: "latest"
87
- }
88
- },
89
- rules: {
90
- "@typescript-eslint/consistent-type-imports": [
91
- 2,
92
- {
93
- prefer: "type-imports",
94
- fixStyle: "separate-type-imports",
95
- disallowTypeAnnotations: true
96
- }
97
- ],
98
- "@typescript-eslint/consistent-type-exports": [
99
- 2,
100
- { fixMixedExportsWithInlineTypeSpecifier: false }
101
- ],
102
- "@typescript-eslint/no-explicit-any": [
103
- 2,
104
- { fixToUnknown: false, ignoreRestArgs: false }
105
- ],
106
- "@typescript-eslint/no-empty-object-type": [
107
- 2,
108
- { allowInterfaces: "never", allowObjectTypes: "never" }
109
- ],
110
- "@typescript-eslint/no-restricted-types": [
111
- 2,
112
- {
113
- types: {
114
- "{}": {
115
- message: `
116
- - If you want to represent an empty object, use \`type EmptyObject = Record<string, never>\`.
117
- - If you want to represent an object literal, use either \`type AnyObject = Record<string, any>\` or \`object\`.
118
- - If you want to represent any non-nullish value, use \`type AnyNonNullishValue = NonNullable<unknown>\`.`,
119
- suggest: [
120
- "AnyNonNullishValue",
121
- "EmptyObject",
122
- "AnyObject",
123
- "object",
124
- "Record<string, never>",
125
- "Record<string, any>",
126
- "NonNullable<unknown>"
127
- ]
128
- }
129
- }
130
- }
131
- ],
132
- "@typescript-eslint/no-namespace": [
133
- 2,
134
- { allowDeclarations: false, allowDefinitionFiles: true }
135
- ],
136
- "@typescript-eslint/consistent-type-definitions": [2, "type"],
137
- "sort-imports": [
138
- 2,
139
- {
140
- ignoreCase: false,
141
- ignoreDeclarationSort: true,
142
- ignoreMemberSort: false,
143
- memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
144
- allowSeparatedGroups: true
145
- }
146
- ],
147
- "@typescript-eslint/unified-signatures": [2],
148
- "@typescript-eslint/dot-notation": [
149
- 2,
150
- {
151
- // Related issue: https://github.com/typescript-eslint/typescript-eslint/issues/10338
152
- // Base ESLint default options
153
- allowKeywords: true,
154
- allowPattern: "",
155
- // TypeScript ESLint default options
156
- allowPrivateClassPropertyAccess: false,
157
- allowProtectedClassPropertyAccess: false,
158
- allowIndexSignaturePropertyAccess: false
159
- }
160
- ],
161
- "@typescript-eslint/no-unnecessary-type-parameters": [2],
162
- "@typescript-eslint/no-invalid-void-type": [2],
163
- "@typescript-eslint/no-confusing-void-expression": [2],
164
- "@typescript-eslint/no-duplicate-type-constituents": [2],
165
- "@typescript-eslint/require-await": [2],
166
- "@typescript-eslint/no-redundant-type-constituents": [2],
167
- "@typescript-eslint/no-unnecessary-type-arguments": [2],
168
- "@typescript-eslint/no-unnecessary-type-assertion": [2],
169
- "@typescript-eslint/prefer-nullish-coalescing": [2],
170
- "@typescript-eslint/no-inferrable-types": [2],
171
- "@typescript-eslint/no-empty-function": [
172
- 2,
173
- {
174
- // Related issue: https://github.com/typescript-eslint/typescript-eslint/issues/10338
175
- // Base ESLint default options
176
- allow: []
177
- }
178
- ],
179
- "@typescript-eslint/no-unused-expressions": [
180
- 2,
181
- {
182
- // Related issue: https://github.com/typescript-eslint/typescript-eslint/issues/10338
183
- // Base ESLint default options
184
- allowShortCircuit: false,
185
- allowTernary: false,
186
- allowTaggedTemplates: false,
187
- enforceForJSX: false
188
- }
189
- ],
190
- "object-shorthand": [2],
191
- ...rulesToDisable
192
- },
193
- linterOptions: { reportUnusedDisableDirectives: 2 }
194
- },
195
- {
196
- name: "@aryaemami59/commonjs",
197
- files: ["**/*.c[jt]s"],
198
- languageOptions: { sourceType: "commonjs" },
199
- rules: {
200
- "@typescript-eslint/no-require-imports": [
201
- 0,
202
- [{ allow: [], allowAsImport: false }]
203
- ]
204
- }
205
- }
206
- );
207
- var createESLintConfig = (additionalOverrides = []) => /* @__PURE__ */ config(...flatESLintConfig, ...additionalOverrides);
208
- export {
209
- createESLintConfig,
210
- flatESLintConfig,
211
- globalIgnores,
212
- globals,
213
- rulesToDisable,
214
- vitestGlobals
90
+
91
+ //#endregion
92
+ //#region src/globals.ts
93
+ /**
94
+ * An object representing the
95
+ * {@link https://vitest.dev/config/#globals | globals} provided by
96
+ * {@link https://vitest.dev | **Vitest**} for use in testing.
97
+ *
98
+ * @since 0.0.3
99
+ * @public
100
+ */
101
+ const vitestGlobals = {
102
+ afterAll: "writable",
103
+ afterEach: "writable",
104
+ assert: "writable",
105
+ assertType: "writable",
106
+ beforeAll: "writable",
107
+ beforeEach: "writable",
108
+ chai: "writable",
109
+ describe: "writable",
110
+ expect: "writable",
111
+ expectTypeOf: "writable",
112
+ it: "writable",
113
+ onTestFailed: "writable",
114
+ onTestFinished: "writable",
115
+ suite: "writable",
116
+ test: "writable",
117
+ vi: "writable",
118
+ vitest: "writable"
215
119
  };
120
+ /**
121
+ * An object that specifies which global
122
+ * variables are available during linting.
123
+ *
124
+ * @since 0.0.3
125
+ * @public
126
+ */
127
+ const globals = /* @__PURE__ */ Object.assign({
128
+ ...browser,
129
+ ...node,
130
+ ...nodeBuiltin
131
+ }, {
132
+ ...vitest,
133
+ ...vitestGlobals
134
+ });
135
+
136
+ //#endregion
137
+ //#region src/shareableConfigs.ts
138
+ /**
139
+ * Flat ESLint configuration tailored for projects using TypeScript.
140
+ *
141
+ * @example
142
+ * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>
143
+ *
144
+ * ```ts
145
+ * import { flatESLintConfig } from '@aryaemami59/eslint-config'
146
+ *
147
+ * export default flatESLintConfig
148
+ * ```
149
+ *
150
+ * @example
151
+ * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>
152
+ *
153
+ * ```ts
154
+ * const { flatESLintConfig } = require('@aryaemami59/eslint-config')
155
+ *
156
+ * module.exports = flatESLintConfig
157
+ * ```
158
+ *
159
+ * @example
160
+ * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)__</caption>
161
+ *
162
+ * ```ts
163
+ * module.exports = (async () =>
164
+ * (await import('@aryaemami59/eslint-config')).flatESLintConfig)()
165
+ * ```
166
+ *
167
+ * @example
168
+ * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>
169
+ *
170
+ * ```ts
171
+ * import eslintConfigModule = require('@aryaemami59/eslint-config')
172
+ * import flatESLintConfig = eslintConfigModule.flatESLintConfig
173
+ *
174
+ * export = flatESLintConfig
175
+ * ```
176
+ *
177
+ * @since 0.0.3
178
+ * @public
179
+ */
180
+ const flatESLintConfig = [
181
+ globalIgnores,
182
+ {
183
+ name: `${js.meta.name}/recommended`,
184
+ ...js.configs.recommended
185
+ },
186
+ {
187
+ languageOptions: {
188
+ globals,
189
+ parserOptions: {
190
+ ecmaVersion: "latest",
191
+ projectService: true
192
+ }
193
+ },
194
+ linterOptions: {
195
+ reportUnusedDisableDirectives: 2,
196
+ reportUnusedInlineConfigs: 2
197
+ },
198
+ name: `${packageJsonName}/defaults/overrides`,
199
+ rules: {
200
+ "object-shorthand": [
201
+ 2,
202
+ "always",
203
+ {
204
+ avoidExplicitReturnArrows: true,
205
+ avoidQuotes: true,
206
+ ignoreConstructors: true,
207
+ methodsIgnorePattern: ""
208
+ }
209
+ ],
210
+ "sort-imports": [2, {
211
+ allowSeparatedGroups: true,
212
+ ignoreCase: false,
213
+ ignoreDeclarationSort: true,
214
+ ignoreMemberSort: false,
215
+ memberSyntaxSortOrder: [
216
+ "none",
217
+ "all",
218
+ "multiple",
219
+ "single"
220
+ ]
221
+ }],
222
+ ...disabledRules
223
+ }
224
+ },
225
+ {
226
+ files: ["**/*.cjs"],
227
+ languageOptions: { sourceType: "commonjs" },
228
+ name: `${packageJsonName}/commonjs-files`,
229
+ rules: { "@typescript-eslint/no-require-imports": [0, {
230
+ allow: [],
231
+ allowAsImport: false
232
+ }] }
233
+ },
234
+ prettierConfig
235
+ ];
236
+
237
+ //#endregion
238
+ //#region src/utils.ts
239
+ /**
240
+ * A function that returns {@linkcode flatESLintConfig}
241
+ * along with optional additional overrides.
242
+ * It's made mainly to provide intellisense and eliminate
243
+ * the need for manual type annotations using JSDoc comments.
244
+ *
245
+ * @param [additionalOverrides=[]] - **Optional** additional overrides to apply to the configuration.
246
+ * @returns An augmented version of the default {@linkcode flatESLintConfig}, incorporating any provided overrides.
247
+ *
248
+ * @example
249
+ * <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>
250
+ *
251
+ * ```ts
252
+ * import { createESLintConfig } from '@aryaemami59/eslint-config'
253
+ *
254
+ * export default createESLintConfig([
255
+ * {
256
+ * rules: {
257
+ * 'no-console': [0],
258
+ * },
259
+ * },
260
+ * {
261
+ * // ...Other additional overrides
262
+ * },
263
+ * ])
264
+ * ```
265
+ *
266
+ * @example
267
+ * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>
268
+ *
269
+ * ```ts
270
+ * const { createESLintConfig } = require('@aryaemami59/eslint-config')
271
+ *
272
+ * module.exports = createESLintConfig([
273
+ * {
274
+ * rules: {
275
+ * 'no-console': [0],
276
+ * },
277
+ * },
278
+ * {
279
+ * // ...Other additional overrides
280
+ * },
281
+ * ])
282
+ * ```
283
+ *
284
+ * @example
285
+ * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)__</caption>
286
+ *
287
+ * ```ts
288
+ * module.exports = (async () =>
289
+ * (await import('@aryaemami59/eslint-config')).createESLintConfig([
290
+ * {
291
+ * rules: {
292
+ * 'no-console': [0],
293
+ * },
294
+ * },
295
+ * {
296
+ * // ...Other additional overrides
297
+ * },
298
+ * ]))()
299
+ * ```
300
+ *
301
+ * @example
302
+ * <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>
303
+ *
304
+ * ```ts
305
+ * import eslintConfigModule = require('@aryaemami59/eslint-config')
306
+ * import createESLintConfig = eslintConfigModule.createESLintConfig
307
+ *
308
+ * export = createESLintConfig([
309
+ * {
310
+ * rules: {
311
+ * 'no-console': [0],
312
+ * },
313
+ * },
314
+ * {
315
+ * // ...Other additional overrides
316
+ * },
317
+ * ])
318
+ * ```
319
+ *
320
+ * @since 0.0.3
321
+ * @public
322
+ */
323
+ const createESLintConfig = (additionalOverrides = []) => /* @__PURE__ */ defineConfig(...flatESLintConfig, ...additionalOverrides);
324
+
325
+ //#endregion
326
+ export { config, configs, createESLintConfig, disabledRules, flatESLintConfig, globalIgnores, globals, js, parser, plugin, prettierConfig, vitestGlobals };
216
327
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import js from '@eslint/js'\nimport type { TSESLint } from '@typescript-eslint/utils'\nimport type { Linter } from 'eslint'\nimport prettierConfig from 'eslint-config-prettier'\nimport globalIdentifiers from 'globals'\nimport type { ConfigWithExtends } from 'typescript-eslint'\nimport { config, configs, parser } from 'typescript-eslint'\n\nconst { browser, node, nodeBuiltin } = globalIdentifiers\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 name: '@aryaemami59/global-ignores',\n ignores: [\n '**/dist/',\n '**/.yalc/',\n '**/build/',\n '**/lib/',\n '**/temp/',\n '**/.yarn/',\n '**/coverage/',\n ],\n} as const satisfies Linter.Config\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 suite: 'writable',\n test: 'writable',\n describe: 'writable',\n it: 'writable',\n expectTypeOf: 'writable',\n assertType: 'writable',\n expect: 'writable',\n assert: 'writable',\n vitest: 'writable',\n vi: 'writable',\n beforeAll: 'writable',\n afterAll: 'writable',\n beforeEach: 'writable',\n afterEach: 'writable',\n onTestFailed: 'writable',\n onTestFinished: 'writable',\n} as const satisfies Linter.Globals\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: typeof vitestGlobals &\n typeof browser &\n typeof node &\n typeof nodeBuiltin = /* @__PURE__ */ Object.assign(\n vitestGlobals,\n browser,\n node,\n nodeBuiltin,\n) satisfies Linter.Globals\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 rulesToDisable = {\n 'no-undef': [0],\n '@typescript-eslint/no-unused-vars': [\n 0,\n {\n vars: 'all',\n args: 'after-used',\n caughtErrors: 'all',\n ignoreRestSiblings: false,\n reportUsedIgnorePattern: false,\n },\n ],\n '@typescript-eslint/ban-ts-comment': [\n 0,\n [\n {\n 'ts-expect-error': 'allow-with-description',\n 'ts-ignore': true,\n 'ts-nocheck': true,\n 'ts-check': false,\n minimumDescriptionLength: 3,\n },\n ],\n ],\n} as const satisfies Linter.RulesRecord\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: TSESLint.FlatConfig.Config[] =\n /* @__PURE__ */ config(\n // `ignores` must be first.\n // config with just `ignores` is the replacement for `.eslintignore`\n globalIgnores,\n { name: '@aryaemami59/javascript', ...js.configs.recommended },\n ...configs.recommended,\n ...configs.stylistic,\n { name: '@aryaemami59/prettier-config', ...prettierConfig },\n {\n name: '@aryaemami59/main',\n languageOptions: {\n globals,\n parser,\n parserOptions: {\n projectService: {\n allowDefaultProject: ['.*.js', '.*.mjs', '.*.cjs'],\n defaultProject: './tsconfig.json',\n },\n ecmaVersion: 'latest',\n },\n },\n rules: {\n '@typescript-eslint/consistent-type-imports': [\n 2,\n {\n prefer: 'type-imports',\n fixStyle: 'separate-type-imports',\n disallowTypeAnnotations: true,\n },\n ],\n '@typescript-eslint/consistent-type-exports': [\n 2,\n { fixMixedExportsWithInlineTypeSpecifier: false },\n ],\n '@typescript-eslint/no-explicit-any': [\n 2,\n { fixToUnknown: false, ignoreRestArgs: false },\n ],\n '@typescript-eslint/no-empty-object-type': [\n 2,\n { allowInterfaces: 'never', allowObjectTypes: 'never' },\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-namespace': [\n 2,\n { allowDeclarations: false, allowDefinitionFiles: true },\n ],\n '@typescript-eslint/consistent-type-definitions': [2, 'type'],\n 'sort-imports': [\n 2,\n {\n ignoreCase: false,\n ignoreDeclarationSort: true,\n ignoreMemberSort: false,\n memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],\n allowSeparatedGroups: true,\n },\n ],\n '@typescript-eslint/unified-signatures': [2],\n '@typescript-eslint/dot-notation': [\n 2,\n {\n // Related issue: https://github.com/typescript-eslint/typescript-eslint/issues/10338\n // Base ESLint default options\n allowKeywords: true,\n allowPattern: '',\n // TypeScript ESLint default options\n allowPrivateClassPropertyAccess: false,\n allowProtectedClassPropertyAccess: false,\n allowIndexSignaturePropertyAccess: false,\n },\n ],\n '@typescript-eslint/no-unnecessary-type-parameters': [2],\n '@typescript-eslint/no-invalid-void-type': [2],\n '@typescript-eslint/no-confusing-void-expression': [2],\n '@typescript-eslint/no-duplicate-type-constituents': [2],\n '@typescript-eslint/require-await': [2],\n '@typescript-eslint/no-redundant-type-constituents': [2],\n '@typescript-eslint/no-unnecessary-type-arguments': [2],\n '@typescript-eslint/no-unnecessary-type-assertion': [2],\n '@typescript-eslint/prefer-nullish-coalescing': [2],\n '@typescript-eslint/no-inferrable-types': [2],\n '@typescript-eslint/no-empty-function': [\n 2,\n {\n // Related issue: https://github.com/typescript-eslint/typescript-eslint/issues/10338\n // Base ESLint default options\n allow: [],\n },\n ],\n '@typescript-eslint/no-unused-expressions': [\n 2,\n {\n // Related issue: https://github.com/typescript-eslint/typescript-eslint/issues/10338\n // Base ESLint default options\n allowShortCircuit: false,\n allowTernary: false,\n allowTaggedTemplates: false,\n enforceForJSX: false,\n },\n ],\n 'object-shorthand': [2],\n ...rulesToDisable,\n },\n linterOptions: { reportUnusedDisableDirectives: 2 },\n },\n {\n name: '@aryaemami59/commonjs',\n files: ['**/*.c[jt]s'],\n languageOptions: { sourceType: 'commonjs' },\n rules: {\n '@typescript-eslint/no-require-imports': [\n 0,\n [{ allow: [], allowAsImport: false }],\n ],\n },\n },\n )\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: ConfigWithExtends[] = [],\n): TSESLint.FlatConfig.Config[] =>\n /* @__PURE__ */ config(...flatESLintConfig, ...additionalOverrides)\n"],"mappings":";AAAA,OAAO,QAAQ;AAGf,OAAO,oBAAoB;AAC3B,OAAO,uBAAuB;AAE9B,SAAS,QAAQ,SAAS,cAAc;AAExC,IAAM,EAAE,SAAS,MAAM,YAAY,IAAI;AAUhC,IAAM,gBAAgB;AAAA,EAC3B,MAAM;AAAA,EACN,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAUO,IAAM,gBAAgB;AAAA,EAC3B,OAAO;AAAA,EACP,MAAM;AAAA,EACN,UAAU;AAAA,EACV,IAAI;AAAA,EACJ,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,IAAI;AAAA,EACJ,WAAW;AAAA,EACX,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,cAAc;AAAA,EACd,gBAAgB;AAClB;AASO,IAAM,UAG0B,uBAAO;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AASO,IAAM,iBAAiB;AAAA,EAC5B,YAAY,CAAC,CAAC;AAAA,EACd,qCAAqC;AAAA,IACnC;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,cAA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,CAAC,CAAC;AAAA,MACtB,GAAG;AAAA,IACL;AAAA,IACA,eAAe,EAAE,+BAA+B,EAAE;AAAA,EACpD;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO,CAAC,aAAa;AAAA,IACrB,iBAAiB,EAAE,YAAY,WAAW;AAAA,IAC1C,OAAO;AAAA,MACL,yCAAyC;AAAA,QACvC;AAAA,QACA,CAAC,EAAE,OAAO,CAAC,GAAG,eAAe,MAAM,CAAC;AAAA,MACtC;AAAA,IACF;AAAA,EACF;AACF;AAsFK,IAAM,qBAAqB,CAChC,sBAA2C,CAAC,MAE5B,uBAAO,GAAG,kBAAkB,GAAG,mBAAmB;","names":[]}
1
+ {"version":3,"file":"index.js","names":["packageJson.name"],"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,aAA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