@aryaemami59/eslint-config 0.0.3
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/LICENSE +21 -0
- package/README.md +133 -0
- package/dist/index.cjs +256 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1476 -0
- package/dist/index.d.ts +1476 -0
- package/dist/index.js +216 -0
- package/dist/index.js.map +1 -0
- package/package.json +97 -0
- package/src/index.ts +379 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Arya Emami
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# @aryaemami59/eslint-config
|
|
2
|
+
|
|
3
|
+
Flat ESLint configuration tailored for projects using TypeScript.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
#### NPM
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install --save-dev @aryaemami59/eslint-config
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
#### Yarn
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yarn add --dev @aryaemami59/eslint-config
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
#### PNPM
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pnpm add --save-dev @aryaemami59/eslint-config
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
#### Bun
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
bun add --dev @aryaemami59/eslint-config
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Usage
|
|
32
|
+
|
|
33
|
+
**ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`**:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import { flatESLintConfig } from '@aryaemami59/eslint-config'
|
|
37
|
+
|
|
38
|
+
export default flatESLintConfig
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)**:
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
const { flatESLintConfig } = require('@aryaemami59/eslint-config')
|
|
45
|
+
|
|
46
|
+
module.exports = flatESLintConfig
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)**:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
module.exports = (async () =>
|
|
53
|
+
(await import('@aryaemami59/eslint-config')).flatESLintConfig)()
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)**:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import eslintConfigModule = require('@aryaemami59/eslint-config')
|
|
60
|
+
import flatESLintConfig = eslintConfigModule.flatESLintConfig
|
|
61
|
+
|
|
62
|
+
export = flatESLintConfig
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Navigating ESLint's configuration options can occasionally feel overwhelming, especially when trying to take advantage of TypeScript's strong typing for better IntelliSense support. To alleviate this complexity and enhance your development experience, we also provide a function called `createESLintConfig` that you can import and use to create your own ESLint configuration. This function already includes the default `flatESLintConfig` and you can pass in an array of flat configs as additional overrides.
|
|
66
|
+
|
|
67
|
+
**ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`**:
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import { createESLintConfig } from '@aryaemami59/eslint-config'
|
|
71
|
+
|
|
72
|
+
export default createESLintConfig([
|
|
73
|
+
{
|
|
74
|
+
rules: {
|
|
75
|
+
'no-console': [0],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
// ...Other additional overrides
|
|
80
|
+
},
|
|
81
|
+
])
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)**:
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
const { createESLintConfig } = require('@aryaemami59/eslint-config')
|
|
88
|
+
|
|
89
|
+
module.exports = createESLintConfig([
|
|
90
|
+
{
|
|
91
|
+
rules: {
|
|
92
|
+
'no-console': [0],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
// ...Other additional overrides
|
|
97
|
+
},
|
|
98
|
+
])
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)**:
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
module.exports = (async () =>
|
|
105
|
+
(await import('@aryaemami59/eslint-config')).createESLintConfig([
|
|
106
|
+
{
|
|
107
|
+
rules: {
|
|
108
|
+
'no-console': [0],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
// ...Other additional overrides
|
|
113
|
+
},
|
|
114
|
+
]))()
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)**:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
import eslintConfigModule = require('@aryaemami59/eslint-config')
|
|
121
|
+
import createESLintConfig = eslintConfigModule.createESLintConfig
|
|
122
|
+
|
|
123
|
+
export = createESLintConfig([
|
|
124
|
+
{
|
|
125
|
+
rules: {
|
|
126
|
+
'no-console': [0],
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
// ...Other additional overrides
|
|
131
|
+
},
|
|
132
|
+
])
|
|
133
|
+
```
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
createESLintConfig: () => createESLintConfig,
|
|
34
|
+
flatESLintConfig: () => flatESLintConfig,
|
|
35
|
+
globalIgnores: () => globalIgnores,
|
|
36
|
+
globals: () => globals,
|
|
37
|
+
rulesToDisable: () => rulesToDisable,
|
|
38
|
+
vitestGlobals: () => vitestGlobals
|
|
39
|
+
});
|
|
40
|
+
module.exports = __toCommonJS(src_exports);
|
|
41
|
+
var import_js = __toESM(require("@eslint/js"), 1);
|
|
42
|
+
var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
|
|
43
|
+
var import_globals = __toESM(require("globals"), 1);
|
|
44
|
+
var import_typescript_eslint = require("typescript-eslint");
|
|
45
|
+
var { browser, node, nodeBuiltin } = import_globals.default;
|
|
46
|
+
var globalIgnores = {
|
|
47
|
+
name: "@aryaemami59/global-ignores",
|
|
48
|
+
ignores: [
|
|
49
|
+
"**/dist/",
|
|
50
|
+
"**/.yalc/",
|
|
51
|
+
"**/build/",
|
|
52
|
+
"**/lib/",
|
|
53
|
+
"**/temp/",
|
|
54
|
+
"**/.yarn/",
|
|
55
|
+
"**/coverage/"
|
|
56
|
+
]
|
|
57
|
+
};
|
|
58
|
+
var vitestGlobals = {
|
|
59
|
+
suite: "writable",
|
|
60
|
+
test: "writable",
|
|
61
|
+
describe: "writable",
|
|
62
|
+
it: "writable",
|
|
63
|
+
expectTypeOf: "writable",
|
|
64
|
+
assertType: "writable",
|
|
65
|
+
expect: "writable",
|
|
66
|
+
assert: "writable",
|
|
67
|
+
vitest: "writable",
|
|
68
|
+
vi: "writable",
|
|
69
|
+
beforeAll: "writable",
|
|
70
|
+
afterAll: "writable",
|
|
71
|
+
beforeEach: "writable",
|
|
72
|
+
afterEach: "writable",
|
|
73
|
+
onTestFailed: "writable",
|
|
74
|
+
onTestFinished: "writable"
|
|
75
|
+
};
|
|
76
|
+
var globals = /* @__PURE__ */ Object.assign(
|
|
77
|
+
vitestGlobals,
|
|
78
|
+
browser,
|
|
79
|
+
node,
|
|
80
|
+
nodeBuiltin
|
|
81
|
+
);
|
|
82
|
+
var rulesToDisable = {
|
|
83
|
+
"no-undef": [0],
|
|
84
|
+
"@typescript-eslint/no-unused-vars": [
|
|
85
|
+
0,
|
|
86
|
+
{
|
|
87
|
+
vars: "all",
|
|
88
|
+
args: "after-used",
|
|
89
|
+
caughtErrors: "all",
|
|
90
|
+
ignoreRestSiblings: false,
|
|
91
|
+
reportUsedIgnorePattern: false
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"@typescript-eslint/ban-ts-comment": [
|
|
95
|
+
0,
|
|
96
|
+
[
|
|
97
|
+
{
|
|
98
|
+
"ts-expect-error": "allow-with-description",
|
|
99
|
+
"ts-ignore": true,
|
|
100
|
+
"ts-nocheck": true,
|
|
101
|
+
"ts-check": false,
|
|
102
|
+
minimumDescriptionLength: 3
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
]
|
|
106
|
+
};
|
|
107
|
+
var flatESLintConfig = /* @__PURE__ */ (0, import_typescript_eslint.config)(
|
|
108
|
+
// `ignores` must be first.
|
|
109
|
+
// config with just `ignores` is the replacement for `.eslintignore`
|
|
110
|
+
globalIgnores,
|
|
111
|
+
{ name: "@aryaemami59/javascript", ...import_js.default.configs.recommended },
|
|
112
|
+
...import_typescript_eslint.configs.recommended,
|
|
113
|
+
...import_typescript_eslint.configs.stylistic,
|
|
114
|
+
{ name: "@aryaemami59/prettier-config", ...import_eslint_config_prettier.default },
|
|
115
|
+
{
|
|
116
|
+
name: "@aryaemami59/main",
|
|
117
|
+
languageOptions: {
|
|
118
|
+
globals,
|
|
119
|
+
parser: import_typescript_eslint.parser,
|
|
120
|
+
parserOptions: {
|
|
121
|
+
projectService: {
|
|
122
|
+
allowDefaultProject: [".*.js", ".*.mjs", ".*.cjs"],
|
|
123
|
+
defaultProject: "./tsconfig.json"
|
|
124
|
+
},
|
|
125
|
+
ecmaVersion: "latest"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
rules: {
|
|
129
|
+
"@typescript-eslint/consistent-type-imports": [
|
|
130
|
+
2,
|
|
131
|
+
{
|
|
132
|
+
prefer: "type-imports",
|
|
133
|
+
fixStyle: "separate-type-imports",
|
|
134
|
+
disallowTypeAnnotations: true
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"@typescript-eslint/consistent-type-exports": [
|
|
138
|
+
2,
|
|
139
|
+
{ fixMixedExportsWithInlineTypeSpecifier: false }
|
|
140
|
+
],
|
|
141
|
+
"@typescript-eslint/no-explicit-any": [
|
|
142
|
+
2,
|
|
143
|
+
{ fixToUnknown: false, ignoreRestArgs: false }
|
|
144
|
+
],
|
|
145
|
+
"@typescript-eslint/no-empty-object-type": [
|
|
146
|
+
2,
|
|
147
|
+
{ allowInterfaces: "never", allowObjectTypes: "never" }
|
|
148
|
+
],
|
|
149
|
+
"@typescript-eslint/no-restricted-types": [
|
|
150
|
+
2,
|
|
151
|
+
{
|
|
152
|
+
types: {
|
|
153
|
+
"{}": {
|
|
154
|
+
message: `
|
|
155
|
+
- If you want to represent an empty object, use \`type EmptyObject = Record<string, never>\`.
|
|
156
|
+
- If you want to represent an object literal, use either \`type AnyObject = Record<string, any>\` or \`object\`.
|
|
157
|
+
- If you want to represent any non-nullish value, use \`type AnyNonNullishValue = NonNullable<unknown>\`.`,
|
|
158
|
+
suggest: [
|
|
159
|
+
"AnyNonNullishValue",
|
|
160
|
+
"EmptyObject",
|
|
161
|
+
"AnyObject",
|
|
162
|
+
"object",
|
|
163
|
+
"Record<string, never>",
|
|
164
|
+
"Record<string, any>",
|
|
165
|
+
"NonNullable<unknown>"
|
|
166
|
+
]
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
],
|
|
171
|
+
"@typescript-eslint/no-namespace": [
|
|
172
|
+
2,
|
|
173
|
+
{ allowDeclarations: false, allowDefinitionFiles: true }
|
|
174
|
+
],
|
|
175
|
+
"@typescript-eslint/consistent-type-definitions": [2, "type"],
|
|
176
|
+
"sort-imports": [
|
|
177
|
+
2,
|
|
178
|
+
{
|
|
179
|
+
ignoreCase: false,
|
|
180
|
+
ignoreDeclarationSort: true,
|
|
181
|
+
ignoreMemberSort: false,
|
|
182
|
+
memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
|
|
183
|
+
allowSeparatedGroups: true
|
|
184
|
+
}
|
|
185
|
+
],
|
|
186
|
+
"@typescript-eslint/unified-signatures": [2],
|
|
187
|
+
"@typescript-eslint/dot-notation": [
|
|
188
|
+
2,
|
|
189
|
+
{
|
|
190
|
+
// Related issue: https://github.com/typescript-eslint/typescript-eslint/issues/10338
|
|
191
|
+
// Base ESLint default options
|
|
192
|
+
allowKeywords: true,
|
|
193
|
+
allowPattern: "",
|
|
194
|
+
// TypeScript ESLint default options
|
|
195
|
+
allowPrivateClassPropertyAccess: false,
|
|
196
|
+
allowProtectedClassPropertyAccess: false,
|
|
197
|
+
allowIndexSignaturePropertyAccess: false
|
|
198
|
+
}
|
|
199
|
+
],
|
|
200
|
+
"@typescript-eslint/no-unnecessary-type-parameters": [2],
|
|
201
|
+
"@typescript-eslint/no-invalid-void-type": [2],
|
|
202
|
+
"@typescript-eslint/no-confusing-void-expression": [2],
|
|
203
|
+
"@typescript-eslint/no-duplicate-type-constituents": [2],
|
|
204
|
+
"@typescript-eslint/require-await": [2],
|
|
205
|
+
"@typescript-eslint/no-redundant-type-constituents": [2],
|
|
206
|
+
"@typescript-eslint/no-unnecessary-type-arguments": [2],
|
|
207
|
+
"@typescript-eslint/no-unnecessary-type-assertion": [2],
|
|
208
|
+
"@typescript-eslint/prefer-nullish-coalescing": [2],
|
|
209
|
+
"@typescript-eslint/no-inferrable-types": [2],
|
|
210
|
+
"@typescript-eslint/no-empty-function": [
|
|
211
|
+
2,
|
|
212
|
+
{
|
|
213
|
+
// Related issue: https://github.com/typescript-eslint/typescript-eslint/issues/10338
|
|
214
|
+
// Base ESLint default options
|
|
215
|
+
allow: []
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"@typescript-eslint/no-unused-expressions": [
|
|
219
|
+
2,
|
|
220
|
+
{
|
|
221
|
+
// Related issue: https://github.com/typescript-eslint/typescript-eslint/issues/10338
|
|
222
|
+
// Base ESLint default options
|
|
223
|
+
allowShortCircuit: false,
|
|
224
|
+
allowTernary: false,
|
|
225
|
+
allowTaggedTemplates: false,
|
|
226
|
+
enforceForJSX: false
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"object-shorthand": [2],
|
|
230
|
+
...rulesToDisable
|
|
231
|
+
},
|
|
232
|
+
linterOptions: { reportUnusedDisableDirectives: 2 }
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: "@aryaemami59/commonjs",
|
|
236
|
+
files: ["**/*.c[jt]s"],
|
|
237
|
+
languageOptions: { sourceType: "commonjs" },
|
|
238
|
+
rules: {
|
|
239
|
+
"@typescript-eslint/no-require-imports": [
|
|
240
|
+
0,
|
|
241
|
+
[{ allow: [], allowAsImport: false }]
|
|
242
|
+
]
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
var createESLintConfig = (additionalOverrides = []) => /* @__PURE__ */ (0, import_typescript_eslint.config)(...flatESLintConfig, ...additionalOverrides);
|
|
247
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
248
|
+
0 && (module.exports = {
|
|
249
|
+
createESLintConfig,
|
|
250
|
+
flatESLintConfig,
|
|
251
|
+
globalIgnores,
|
|
252
|
+
globals,
|
|
253
|
+
rulesToDisable,
|
|
254
|
+
vitestGlobals
|
|
255
|
+
});
|
|
256
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +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, ...additionalO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