@aryaemami59/eslint-config 0.0.5 → 0.0.7
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 +1 -1
- package/dist/index.cjs +362 -324
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2523 -1227
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +2523 -1227
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +304 -286
- package/dist/index.js.map +1 -1
- package/package.json +30 -21
- package/src/disabledRules.ts +30 -11
- package/src/external.ts +7 -1
- package/src/globalIgnores.ts +14 -13
- package/src/globals.ts +14 -16
- package/src/index.ts +4 -0
- package/src/{packageName.ts → packageJsonName.ts} +3 -1
- package/src/shareableConfigs.ts +197 -193
- package/src/utils.ts +6 -7
package/dist/index.cjs
CHANGED
|
@@ -1,345 +1,383 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
8
|
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
9
|
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
19
22
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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);
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
globals: () => globals,
|
|
40
|
-
js: () => import_js.default,
|
|
41
|
-
parser: () => import_typescript_eslint.parser,
|
|
42
|
-
plugin: () => import_typescript_eslint.plugin,
|
|
43
|
-
prettierConfig: () => import_flat.default,
|
|
44
|
-
vitestGlobals: () => vitestGlobals
|
|
45
|
-
});
|
|
46
|
-
module.exports = __toCommonJS(src_exports);
|
|
28
|
+
//#endregion
|
|
29
|
+
let _eslint_js = require("@eslint/js");
|
|
30
|
+
_eslint_js = __toESM(_eslint_js);
|
|
31
|
+
let eslint_config_prettier_flat = require("eslint-config-prettier/flat");
|
|
32
|
+
eslint_config_prettier_flat = __toESM(eslint_config_prettier_flat);
|
|
33
|
+
let globals = require("globals");
|
|
34
|
+
globals = __toESM(globals);
|
|
35
|
+
let eslint_config = require("eslint/config");
|
|
36
|
+
let typescript_eslint = require("typescript-eslint");
|
|
47
37
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
38
|
+
//#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
|
+
const disabledRules = {
|
|
47
|
+
"@typescript-eslint/ban-ts-comment": [0, {
|
|
48
|
+
minimumDescriptionLength: 3,
|
|
49
|
+
"ts-check": false,
|
|
50
|
+
"ts-expect-error": "allow-with-description",
|
|
51
|
+
"ts-ignore": true,
|
|
52
|
+
"ts-nocheck": true
|
|
53
|
+
}],
|
|
54
|
+
"@typescript-eslint/consistent-generic-constructors": [0],
|
|
55
|
+
"@typescript-eslint/no-unused-vars": [0, {
|
|
56
|
+
args: "after-used",
|
|
57
|
+
argsIgnorePattern: "^_",
|
|
58
|
+
caughtErrors: "all",
|
|
59
|
+
caughtErrorsIgnorePattern: "^_",
|
|
60
|
+
destructuredArrayIgnorePattern: "^_",
|
|
61
|
+
ignoreClassWithStaticInitBlock: false,
|
|
62
|
+
ignoreRestSiblings: false,
|
|
63
|
+
reportUsedIgnorePattern: false,
|
|
64
|
+
vars: "all",
|
|
65
|
+
varsIgnorePattern: "^_"
|
|
66
|
+
}],
|
|
67
|
+
"no-undef": [0, { typeof: false }]
|
|
73
68
|
};
|
|
74
69
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
var import_typescript_eslint = require("typescript-eslint");
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/external.ts
|
|
72
|
+
const { browser, node, nodeBuiltin, vitest } = globals.default;
|
|
79
73
|
|
|
80
|
-
|
|
81
|
-
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region package.json
|
|
76
|
+
var name = "@aryaemami59/eslint-config";
|
|
82
77
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/globalIgnores.ts
|
|
80
|
+
/**
|
|
81
|
+
* An object representing
|
|
82
|
+
* {@link https://eslint.org/docs/latest/use/configure/ignore#ignoring-files | **global ignore patterns**}
|
|
83
|
+
* for ESLint configuration.
|
|
84
|
+
*
|
|
85
|
+
* @since 0.0.3
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
const globalIgnores = {
|
|
89
|
+
ignores: [
|
|
90
|
+
"**/__snapshots__/",
|
|
91
|
+
"**/.docusaurus/",
|
|
92
|
+
"**/.expo/",
|
|
93
|
+
"**/.next/",
|
|
94
|
+
"**/.playwright/",
|
|
95
|
+
"**/.temp/",
|
|
96
|
+
"**/.tmp/",
|
|
97
|
+
"**/.turbo/",
|
|
98
|
+
"**/.wrangler/",
|
|
99
|
+
"**/.yalc/",
|
|
100
|
+
"**/.yarn/",
|
|
101
|
+
"**/*.snap",
|
|
102
|
+
"**/build/",
|
|
103
|
+
"**/coverage/",
|
|
104
|
+
"**/dist/",
|
|
105
|
+
"**/temp/"
|
|
106
|
+
],
|
|
107
|
+
name: `${name}/global-ignores`
|
|
102
108
|
};
|
|
103
109
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/globals.ts
|
|
112
|
+
/**
|
|
113
|
+
* An object representing the
|
|
114
|
+
* {@link https://vitest.dev/config/#globals | globals} provided by
|
|
115
|
+
* {@link https://vitest.dev | **Vitest**} for use in testing.
|
|
116
|
+
*
|
|
117
|
+
* @since 0.0.3
|
|
118
|
+
* @public
|
|
119
|
+
*/
|
|
120
|
+
const vitestGlobals = {
|
|
121
|
+
afterAll: "writable",
|
|
122
|
+
afterEach: "writable",
|
|
123
|
+
assert: "writable",
|
|
124
|
+
assertType: "writable",
|
|
125
|
+
beforeAll: "writable",
|
|
126
|
+
beforeEach: "writable",
|
|
127
|
+
chai: "writable",
|
|
128
|
+
describe: "writable",
|
|
129
|
+
expect: "writable",
|
|
130
|
+
expectTypeOf: "writable",
|
|
131
|
+
it: "writable",
|
|
132
|
+
onTestFailed: "writable",
|
|
133
|
+
onTestFinished: "writable",
|
|
134
|
+
suite: "writable",
|
|
135
|
+
test: "writable",
|
|
136
|
+
vi: "writable",
|
|
137
|
+
vitest: "writable"
|
|
125
138
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
/**
|
|
140
|
+
* An object that specifies which global
|
|
141
|
+
* variables are available during linting.
|
|
142
|
+
*
|
|
143
|
+
* @since 0.0.3
|
|
144
|
+
* @public
|
|
145
|
+
*/
|
|
146
|
+
const globals$1 = /* @__PURE__ */ Object.assign({
|
|
147
|
+
...browser,
|
|
148
|
+
...node,
|
|
149
|
+
...nodeBuiltin
|
|
150
|
+
}, {
|
|
151
|
+
...vitest,
|
|
152
|
+
...vitestGlobals
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/shareableConfigs.ts
|
|
157
|
+
/**
|
|
158
|
+
* Flat ESLint configuration tailored for projects using TypeScript.
|
|
159
|
+
*
|
|
160
|
+
* @example
|
|
161
|
+
* <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>
|
|
162
|
+
*
|
|
163
|
+
* ```ts
|
|
164
|
+
* import { flatESLintConfig } from '@aryaemami59/eslint-config'
|
|
165
|
+
*
|
|
166
|
+
* export default flatESLintConfig
|
|
167
|
+
* ```
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>
|
|
171
|
+
*
|
|
172
|
+
* ```ts
|
|
173
|
+
* const { flatESLintConfig } = require('@aryaemami59/eslint-config')
|
|
174
|
+
*
|
|
175
|
+
* module.exports = flatESLintConfig
|
|
176
|
+
* ```
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cjs` or `eslint.config.cts` (using dynamic import)__</caption>
|
|
180
|
+
*
|
|
181
|
+
* ```ts
|
|
182
|
+
* module.exports = (async () =>
|
|
183
|
+
* (await import('@aryaemami59/eslint-config')).flatESLintConfig)()
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* @example
|
|
187
|
+
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>
|
|
188
|
+
*
|
|
189
|
+
* ```ts
|
|
190
|
+
* import eslintConfigModule = require('@aryaemami59/eslint-config')
|
|
191
|
+
* import flatESLintConfig = eslintConfigModule.flatESLintConfig
|
|
192
|
+
*
|
|
193
|
+
* export = flatESLintConfig
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* @since 0.0.3
|
|
197
|
+
* @public
|
|
198
|
+
*/
|
|
199
|
+
const flatESLintConfig = [
|
|
200
|
+
globalIgnores,
|
|
201
|
+
{
|
|
202
|
+
name: `${_eslint_js.default.meta.name}/recommended`,
|
|
203
|
+
..._eslint_js.default.configs.recommended
|
|
204
|
+
},
|
|
205
|
+
{
|
|
206
|
+
languageOptions: {
|
|
207
|
+
globals: globals$1,
|
|
208
|
+
parserOptions: {
|
|
209
|
+
ecmaVersion: "latest",
|
|
210
|
+
projectService: true
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
linterOptions: {
|
|
214
|
+
reportUnusedDisableDirectives: 2,
|
|
215
|
+
reportUnusedInlineConfigs: 2
|
|
216
|
+
},
|
|
217
|
+
name: `${name}/defaults/overrides`,
|
|
218
|
+
rules: {
|
|
219
|
+
"object-shorthand": [
|
|
220
|
+
2,
|
|
221
|
+
"always",
|
|
222
|
+
{
|
|
223
|
+
avoidExplicitReturnArrows: true,
|
|
224
|
+
avoidQuotes: true,
|
|
225
|
+
ignoreConstructors: true,
|
|
226
|
+
methodsIgnorePattern: ""
|
|
227
|
+
}
|
|
228
|
+
],
|
|
229
|
+
"sort-imports": [2, {
|
|
230
|
+
allowSeparatedGroups: true,
|
|
231
|
+
ignoreCase: false,
|
|
232
|
+
ignoreDeclarationSort: true,
|
|
233
|
+
ignoreMemberSort: false,
|
|
234
|
+
memberSyntaxSortOrder: [
|
|
235
|
+
"none",
|
|
236
|
+
"all",
|
|
237
|
+
"multiple",
|
|
238
|
+
"single"
|
|
239
|
+
]
|
|
240
|
+
}],
|
|
241
|
+
...disabledRules
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
files: ["**/*.cjs"],
|
|
246
|
+
languageOptions: { sourceType: "commonjs" },
|
|
247
|
+
name: `${name}/commonjs-files`,
|
|
248
|
+
rules: { "@typescript-eslint/no-require-imports": [0, {
|
|
249
|
+
allow: [],
|
|
250
|
+
allowAsImport: false
|
|
251
|
+
}] }
|
|
252
|
+
},
|
|
253
|
+
eslint_config_prettier_flat.default
|
|
254
|
+
];
|
|
137
255
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
"@typescript-eslint/unified-signatures": [
|
|
226
|
-
2,
|
|
227
|
-
{
|
|
228
|
-
ignoreDifferentlyNamedParameters: false,
|
|
229
|
-
ignoreOverloadsWithDifferentJSDoc: false
|
|
230
|
-
}
|
|
231
|
-
],
|
|
232
|
-
"@typescript-eslint/no-unnecessary-type-parameters": [2],
|
|
233
|
-
"@typescript-eslint/no-invalid-void-type": [
|
|
234
|
-
2,
|
|
235
|
-
{
|
|
236
|
-
allowAsThisParameter: false,
|
|
237
|
-
allowInGenericTypeArguments: true
|
|
238
|
-
}
|
|
239
|
-
],
|
|
240
|
-
"@typescript-eslint/no-confusing-void-expression": [
|
|
241
|
-
2,
|
|
242
|
-
{
|
|
243
|
-
ignoreArrowShorthand: false,
|
|
244
|
-
ignoreVoidOperator: false,
|
|
245
|
-
ignoreVoidReturningFunctions: false
|
|
246
|
-
}
|
|
247
|
-
],
|
|
248
|
-
"@typescript-eslint/no-duplicate-type-constituents": [
|
|
249
|
-
2,
|
|
250
|
-
{
|
|
251
|
-
ignoreIntersections: false,
|
|
252
|
-
ignoreUnions: false
|
|
253
|
-
}
|
|
254
|
-
],
|
|
255
|
-
"@typescript-eslint/require-await": [2],
|
|
256
|
-
"@typescript-eslint/no-redundant-type-constituents": [2],
|
|
257
|
-
"@typescript-eslint/no-unnecessary-type-arguments": [2],
|
|
258
|
-
"@typescript-eslint/no-unnecessary-type-assertion": [
|
|
259
|
-
2,
|
|
260
|
-
{ typesToIgnore: [] }
|
|
261
|
-
],
|
|
262
|
-
"@typescript-eslint/prefer-nullish-coalescing": [
|
|
263
|
-
2,
|
|
264
|
-
{
|
|
265
|
-
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false,
|
|
266
|
-
ignoreBooleanCoercion: false,
|
|
267
|
-
ignoreConditionalTests: true,
|
|
268
|
-
ignoreIfStatements: false,
|
|
269
|
-
ignoreMixedLogicalExpressions: false,
|
|
270
|
-
ignorePrimitives: {
|
|
271
|
-
bigint: false,
|
|
272
|
-
boolean: false,
|
|
273
|
-
number: false,
|
|
274
|
-
string: false
|
|
275
|
-
},
|
|
276
|
-
ignoreTernaryTests: false
|
|
277
|
-
}
|
|
278
|
-
],
|
|
279
|
-
"@typescript-eslint/no-inferrable-types": [
|
|
280
|
-
2,
|
|
281
|
-
{
|
|
282
|
-
ignoreParameters: false,
|
|
283
|
-
ignoreProperties: false
|
|
284
|
-
}
|
|
285
|
-
],
|
|
286
|
-
"@typescript-eslint/no-require-imports": [
|
|
287
|
-
2,
|
|
288
|
-
{
|
|
289
|
-
allow: [],
|
|
290
|
-
allowAsImport: true
|
|
291
|
-
}
|
|
292
|
-
],
|
|
293
|
-
"object-shorthand": [
|
|
294
|
-
2,
|
|
295
|
-
"always",
|
|
296
|
-
{
|
|
297
|
-
avoidExplicitReturnArrows: true,
|
|
298
|
-
avoidQuotes: true,
|
|
299
|
-
ignoreConstructors: true,
|
|
300
|
-
methodsIgnorePattern: ""
|
|
301
|
-
}
|
|
302
|
-
],
|
|
303
|
-
...disabledRules
|
|
304
|
-
},
|
|
305
|
-
linterOptions: {
|
|
306
|
-
reportUnusedDisableDirectives: 2
|
|
307
|
-
}
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
name: `${packageName}/commonjs-files`,
|
|
311
|
-
files: ["**/*.cjs"],
|
|
312
|
-
languageOptions: {
|
|
313
|
-
sourceType: "commonjs"
|
|
314
|
-
},
|
|
315
|
-
rules: {
|
|
316
|
-
"@typescript-eslint/no-require-imports": [
|
|
317
|
-
0,
|
|
318
|
-
{
|
|
319
|
-
allow: [],
|
|
320
|
-
allowAsImport: false
|
|
321
|
-
}
|
|
322
|
-
]
|
|
323
|
-
}
|
|
324
|
-
},
|
|
325
|
-
import_flat.default
|
|
326
|
-
);
|
|
256
|
+
//#endregion
|
|
257
|
+
//#region src/utils.ts
|
|
258
|
+
/**
|
|
259
|
+
* A function that returns {@linkcode flatESLintConfig}
|
|
260
|
+
* along with optional additional overrides.
|
|
261
|
+
* It's made mainly to provide intellisense and eliminate
|
|
262
|
+
* the need for manual type annotations using JSDoc comments.
|
|
263
|
+
*
|
|
264
|
+
* @param [additionalOverrides=[]] - **Optional** additional overrides to apply to the configuration.
|
|
265
|
+
* @returns An augmented version of the default {@linkcode flatESLintConfig}, incorporating any provided overrides.
|
|
266
|
+
*
|
|
267
|
+
* @example
|
|
268
|
+
* <caption>#### __ECMAScript Modules (ESM) usage inside a file like `eslint.config.mts` or `eslint.config.mjs`__</caption>
|
|
269
|
+
*
|
|
270
|
+
* ```ts
|
|
271
|
+
* import { createESLintConfig } from '@aryaemami59/eslint-config'
|
|
272
|
+
*
|
|
273
|
+
* export default createESLintConfig([
|
|
274
|
+
* {
|
|
275
|
+
* rules: {
|
|
276
|
+
* 'no-console': [0],
|
|
277
|
+
* },
|
|
278
|
+
* },
|
|
279
|
+
* {
|
|
280
|
+
* // ...Other additional overrides
|
|
281
|
+
* },
|
|
282
|
+
* ])
|
|
283
|
+
* ```
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using `require`)__</caption>
|
|
287
|
+
*
|
|
288
|
+
* ```ts
|
|
289
|
+
* const { createESLintConfig } = require('@aryaemami59/eslint-config')
|
|
290
|
+
*
|
|
291
|
+
* module.exports = createESLintConfig([
|
|
292
|
+
* {
|
|
293
|
+
* rules: {
|
|
294
|
+
* 'no-console': [0],
|
|
295
|
+
* },
|
|
296
|
+
* },
|
|
297
|
+
* {
|
|
298
|
+
* // ...Other additional overrides
|
|
299
|
+
* },
|
|
300
|
+
* ])
|
|
301
|
+
* ```
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` or `eslint.config.cjs` (using dynamic import)__</caption>
|
|
305
|
+
*
|
|
306
|
+
* ```ts
|
|
307
|
+
* module.exports = (async () =>
|
|
308
|
+
* (await import('@aryaemami59/eslint-config')).createESLintConfig([
|
|
309
|
+
* {
|
|
310
|
+
* rules: {
|
|
311
|
+
* 'no-console': [0],
|
|
312
|
+
* },
|
|
313
|
+
* },
|
|
314
|
+
* {
|
|
315
|
+
* // ...Other additional overrides
|
|
316
|
+
* },
|
|
317
|
+
* ]))()
|
|
318
|
+
* ```
|
|
319
|
+
*
|
|
320
|
+
* @example
|
|
321
|
+
* <caption>#### __CommonJS (CJS) usage inside a file like `eslint.config.cts` (using import and export assignment)__</caption>
|
|
322
|
+
*
|
|
323
|
+
* ```ts
|
|
324
|
+
* import eslintConfigModule = require('@aryaemami59/eslint-config')
|
|
325
|
+
* import createESLintConfig = eslintConfigModule.createESLintConfig
|
|
326
|
+
*
|
|
327
|
+
* export = createESLintConfig([
|
|
328
|
+
* {
|
|
329
|
+
* rules: {
|
|
330
|
+
* 'no-console': [0],
|
|
331
|
+
* },
|
|
332
|
+
* },
|
|
333
|
+
* {
|
|
334
|
+
* // ...Other additional overrides
|
|
335
|
+
* },
|
|
336
|
+
* ])
|
|
337
|
+
* ```
|
|
338
|
+
*
|
|
339
|
+
* @since 0.0.3
|
|
340
|
+
* @public
|
|
341
|
+
*/
|
|
342
|
+
const createESLintConfig = (additionalOverrides = []) => /* @__PURE__ */ (0, eslint_config.defineConfig)(...flatESLintConfig, ...additionalOverrides);
|
|
327
343
|
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
+
//#endregion
|
|
345
|
+
Object.defineProperty(exports, 'config', {
|
|
346
|
+
enumerable: true,
|
|
347
|
+
get: function () {
|
|
348
|
+
return typescript_eslint.config;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
Object.defineProperty(exports, 'configs', {
|
|
352
|
+
enumerable: true,
|
|
353
|
+
get: function () {
|
|
354
|
+
return typescript_eslint.configs;
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
exports.createESLintConfig = createESLintConfig;
|
|
358
|
+
Object.defineProperty(exports, 'defineConfig', {
|
|
359
|
+
enumerable: true,
|
|
360
|
+
get: function () {
|
|
361
|
+
return eslint_config.defineConfig;
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
exports.disabledRules = disabledRules;
|
|
365
|
+
exports.flatESLintConfig = flatESLintConfig;
|
|
366
|
+
exports.globalIgnores = globalIgnores;
|
|
367
|
+
exports.globals = globals$1;
|
|
368
|
+
exports.js = _eslint_js.default;
|
|
369
|
+
Object.defineProperty(exports, 'parser', {
|
|
370
|
+
enumerable: true,
|
|
371
|
+
get: function () {
|
|
372
|
+
return typescript_eslint.parser;
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
Object.defineProperty(exports, 'plugin', {
|
|
376
|
+
enumerable: true,
|
|
377
|
+
get: function () {
|
|
378
|
+
return typescript_eslint.plugin;
|
|
379
|
+
}
|
|
344
380
|
});
|
|
381
|
+
exports.prettierConfig = eslint_config_prettier_flat.default;
|
|
382
|
+
exports.vitestGlobals = vitestGlobals;
|
|
345
383
|
//# sourceMappingURL=index.cjs.map
|