@exadev/eslint-config 1.4.1 → 2.1.0

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.js CHANGED
@@ -1,2 +1,478 @@
1
- import { t as plugin } from "./plugin-DYny7gdb.js";
2
- export { plugin as default };
1
+ import tseslint from "typescript-eslint";
2
+ import { posix } from "node:path";
3
+ //#region package.json
4
+ var version = "2.1.0";
5
+ //#endregion
6
+ //#region src/rules/barrel-helpers.ts
7
+ const INDEX_BASENAME$1 = /^index\.[cm]?[tj]sx?$/;
8
+ function basenameOf(filename) {
9
+ const slash = filename.lastIndexOf("/");
10
+ return slash === -1 ? filename : filename.slice(slash + 1);
11
+ }
12
+ function isIndexFile(filename) {
13
+ return INDEX_BASENAME$1.test(basenameOf(filename));
14
+ }
15
+ function isMainBarrel(filename) {
16
+ return filename.endsWith("/src/index.ts");
17
+ }
18
+ function isPureReexport(statement) {
19
+ if (statement.type === "ExportAllDeclaration") return true;
20
+ return statement.type === "ExportNamedDeclaration" && statement.source !== null && statement.source !== void 0;
21
+ }
22
+ function isDirectSibling(specifier) {
23
+ if (!specifier.startsWith("./")) return false;
24
+ let rest = posix.normalize(specifier.slice(2));
25
+ if (rest.endsWith("/")) rest = rest.slice(0, -1);
26
+ return rest !== "." && rest !== ".." && rest !== "" && !rest.includes("/");
27
+ }
28
+ function isBarrelMode(value) {
29
+ return value === "banned" || value === "single" || value === "siblings";
30
+ }
31
+ function isPermittedBarrel(filename, mode) {
32
+ if (mode === "banned") return false;
33
+ if (mode === "single") return isMainBarrel(filename);
34
+ return isIndexFile(filename);
35
+ }
36
+ function createSplitReexportDetector() {
37
+ const importsByName = /* @__PURE__ */ new Map();
38
+ const bareExportSpecifiers = [];
39
+ const defaultExportDeclarations = [];
40
+ return {
41
+ visitImport(node) {
42
+ for (const specifier of node.specifiers) importsByName.set(specifier.local.name, {
43
+ declaration: node,
44
+ specifier
45
+ });
46
+ },
47
+ visitExportNamed(node) {
48
+ if (node.source !== null && node.source !== void 0) return;
49
+ for (const specifier of node.specifiers) bareExportSpecifiers.push({
50
+ declaration: node,
51
+ specifier
52
+ });
53
+ },
54
+ visitExportDefault(node) {
55
+ defaultExportDeclarations.push(node);
56
+ },
57
+ violations() {
58
+ const out = [];
59
+ for (const { declaration, specifier } of bareExportSpecifiers) {
60
+ const name = specifier.local.type === "Identifier" ? specifier.local.name : void 0;
61
+ if (name === void 0) continue;
62
+ const trackedImport = importsByName.get(name);
63
+ if (trackedImport === void 0) continue;
64
+ out.push({
65
+ kind: "named",
66
+ specifier,
67
+ declaration,
68
+ name,
69
+ trackedImport
70
+ });
71
+ }
72
+ for (const declarationNode of defaultExportDeclarations) {
73
+ const name = declarationNode.declaration.type === "Identifier" ? declarationNode.declaration.name : void 0;
74
+ if (name === void 0) continue;
75
+ const trackedImport = importsByName.get(name);
76
+ if (trackedImport === void 0) continue;
77
+ out.push({
78
+ kind: "default",
79
+ declaration: declarationNode,
80
+ name,
81
+ trackedImport
82
+ });
83
+ }
84
+ return out;
85
+ }
86
+ };
87
+ }
88
+ //#endregion
89
+ //#region src/rules/barrel-direct-siblings-only.ts
90
+ const barrelDirectSiblingsOnly = {
91
+ meta: {
92
+ type: "problem",
93
+ schema: [],
94
+ messages: { notADirectSibling: "A barrel may re-export only from a direct sibling file or folder ('./module' or './module.ts') -- found '{{ source }}'. Move the source closer, or import it directly at the call site rather than re-exporting it through this barrel." }
95
+ },
96
+ create(context) {
97
+ if (!isIndexFile(context.filename)) return {};
98
+ return {
99
+ ExportNamedDeclaration(node) {
100
+ if (node.source === null || node.source === void 0) return;
101
+ const source = node.source.value;
102
+ if (typeof source !== "string") return;
103
+ if (!isDirectSibling(source)) context.report({
104
+ node,
105
+ messageId: "notADirectSibling",
106
+ data: { source }
107
+ });
108
+ },
109
+ ExportAllDeclaration(node) {
110
+ const source = node.source.value;
111
+ if (typeof source !== "string") return;
112
+ if (!isDirectSibling(source)) context.report({
113
+ node,
114
+ messageId: "notADirectSibling",
115
+ data: { source }
116
+ });
117
+ }
118
+ };
119
+ }
120
+ };
121
+ //#endregion
122
+ //#region src/rules/barrel-policy.ts
123
+ function readMode(options) {
124
+ if (options === void 0 || typeof options !== "object" || options === null || !("mode" in options) || !isBarrelMode(options.mode)) throw new Error("exadev/barrel-policy requires options: { mode: 'banned' | 'single' | 'siblings' }.");
125
+ return options.mode;
126
+ }
127
+ const barrelPolicy = {
128
+ meta: {
129
+ type: "problem",
130
+ schema: [{
131
+ type: "object",
132
+ properties: { mode: {
133
+ type: "string",
134
+ enum: [
135
+ "banned",
136
+ "single",
137
+ "siblings"
138
+ ]
139
+ } },
140
+ required: ["mode"],
141
+ additionalProperties: false
142
+ }],
143
+ messages: {
144
+ indexFileBanned: "Index (barrel) files are banned in this project -- import directly from the module that owns the export instead. Rename this file to something descriptive.",
145
+ nonMainIndexFile: "Only src/index.ts may be a barrel in this project -- this index file is not it. Move its contents into the module that owns them or give the file a descriptive name.",
146
+ sideEffectInBarrel: "A barrel may contain only re-export statements ('export * from ...' / 'export { x } from ...' / 'export type { x } from ...') -- nothing else, so it can never have a side effect at import time by construction. Found: {{ description }}.",
147
+ reexportOutsideBarrel: "Re-exports belong only in a barrel (index) file -- import this value directly in the file that uses it instead of re-exporting it through this one.",
148
+ notADirectSibling: "A barrel may re-export only from a direct sibling file or folder ('./module' or './module.ts') -- found '{{ source }}'. Move the source closer, or import it directly at the call site rather than re-exporting it through this barrel."
149
+ }
150
+ },
151
+ create(context) {
152
+ const mode = readMode(context.options[0]);
153
+ const filename = context.filename;
154
+ const detector = createSplitReexportDetector();
155
+ function hasSource(node) {
156
+ return node.source !== null && node.source !== void 0;
157
+ }
158
+ return {
159
+ Program(node) {
160
+ if (mode === "banned") {
161
+ if (isIndexFile(filename)) context.report({
162
+ node,
163
+ messageId: "indexFileBanned"
164
+ });
165
+ return;
166
+ }
167
+ if (mode === "single") {
168
+ if (isIndexFile(filename) && !isMainBarrel(filename)) {
169
+ context.report({
170
+ node,
171
+ messageId: "nonMainIndexFile"
172
+ });
173
+ return;
174
+ }
175
+ if (isMainBarrel(filename)) {
176
+ for (const statement of node.body) if (!isPureReexport(statement)) context.report({
177
+ node: statement,
178
+ messageId: "sideEffectInBarrel",
179
+ data: { description: statement.type }
180
+ });
181
+ }
182
+ return;
183
+ }
184
+ if (isIndexFile(filename)) {
185
+ for (const statement of node.body) if (!isPureReexport(statement)) context.report({
186
+ node: statement,
187
+ messageId: "sideEffectInBarrel",
188
+ data: { description: statement.type }
189
+ });
190
+ }
191
+ },
192
+ ImportDeclaration: (node) => detector.visitImport(node),
193
+ ExportNamedDeclaration(node) {
194
+ detector.visitExportNamed(node);
195
+ if (hasSource(node)) {
196
+ const source = node.source === null || node.source === void 0 ? void 0 : node.source.value;
197
+ if (!isPermittedBarrel(filename, mode)) context.report({
198
+ node,
199
+ messageId: "reexportOutsideBarrel"
200
+ });
201
+ else if (mode === "siblings" && typeof source === "string" && !isDirectSibling(source)) context.report({
202
+ node,
203
+ messageId: "notADirectSibling",
204
+ data: { source }
205
+ });
206
+ }
207
+ },
208
+ ExportAllDeclaration(node) {
209
+ const source = node.source.value;
210
+ if (!isPermittedBarrel(filename, mode)) context.report({
211
+ node,
212
+ messageId: "reexportOutsideBarrel"
213
+ });
214
+ else if (mode === "siblings" && typeof source === "string" && !isDirectSibling(source)) context.report({
215
+ node,
216
+ messageId: "notADirectSibling",
217
+ data: { source }
218
+ });
219
+ },
220
+ ExportDefaultDeclaration: (node) => detector.visitExportDefault(node),
221
+ "Program:exit"() {
222
+ for (const violation of detector.violations()) if (isPermittedBarrel(filename, mode)) {
223
+ if (mode === "siblings") {
224
+ const importSource = violation.trackedImport.declaration.source.value;
225
+ if (typeof importSource === "string" && !isDirectSibling(importSource)) context.report({
226
+ node: violation.kind === "named" ? violation.specifier : violation.declaration,
227
+ messageId: "notADirectSibling",
228
+ data: { source: importSource }
229
+ });
230
+ }
231
+ } else context.report({
232
+ node: violation.kind === "named" ? violation.specifier : violation.declaration,
233
+ messageId: "reexportOutsideBarrel"
234
+ });
235
+ }
236
+ };
237
+ }
238
+ };
239
+ //#endregion
240
+ //#region src/rules/no-index-files.ts
241
+ const noIndexFiles = {
242
+ meta: {
243
+ type: "problem",
244
+ schema: [],
245
+ messages: { indexFileBanned: "Index (barrel) files are banned -- import directly from the module that owns the export instead. Rename this file to something descriptive." }
246
+ },
247
+ create(context) {
248
+ if (!isIndexFile(context.filename)) return {};
249
+ return { Program(node) {
250
+ context.report({
251
+ node,
252
+ messageId: "indexFileBanned"
253
+ });
254
+ } };
255
+ }
256
+ };
257
+ //#endregion
258
+ //#region src/rules/no-non-barrel-index.ts
259
+ const INDEX_BASENAME = /^index\.[cm]?[tj]s$/;
260
+ const noNonBarrelIndex = {
261
+ meta: {
262
+ type: "problem",
263
+ schema: [],
264
+ messages: { barrel: "Only src/index.ts may be named index.* (the public convenience barrel); give any other module a descriptive filename." }
265
+ },
266
+ create(context) {
267
+ const filename = context.filename;
268
+ const slash = filename.lastIndexOf("/");
269
+ const basename = slash === -1 ? filename : filename.slice(slash + 1);
270
+ if (!INDEX_BASENAME.test(basename)) return {};
271
+ if (filename.endsWith("/src/index.ts")) return {};
272
+ return { Program(node) {
273
+ context.report({
274
+ node,
275
+ messageId: "barrel"
276
+ });
277
+ } };
278
+ }
279
+ };
280
+ //#endregion
281
+ //#region src/rules/no-non-barrel-reexport.ts
282
+ function removeListMember(fixer, sourceCode, declaration, members, target) {
283
+ if (members.length === 1) return fixer.remove(declaration);
284
+ const targetIndex = members.indexOf(target);
285
+ const isLast = targetIndex === members.length - 1;
286
+ const neighbor = members[isLast ? targetIndex - 1 : targetIndex + 1];
287
+ if (neighbor === void 0) throw new Error("Unreachable: a list with more than one member always has a neighbor either side of any member within it.");
288
+ return isLast ? fixer.removeRange([sourceCode.getRange(neighbor)[1], sourceCode.getRange(target)[1]]) : fixer.removeRange([sourceCode.getRange(target)[0], sourceCode.getRange(neighbor)[0]]);
289
+ }
290
+ function importIsOnlyUsedByThisExport(sourceCode, trackedImport, usageIdentifier) {
291
+ const variable = sourceCode.getDeclaredVariables(trackedImport.declaration).find((candidate) => candidate.defs.some((def) => def.node === trackedImport.specifier));
292
+ if (variable === void 0) return false;
293
+ if (variable.references.length !== 1) return false;
294
+ const [onlyReference] = variable.references;
295
+ if (onlyReference === void 0) throw new Error("Unreachable: the length check above guarantees exactly one element.");
296
+ return onlyReference.identifier === usageIdentifier;
297
+ }
298
+ const noNonBarrelReexport = {
299
+ meta: {
300
+ type: "problem",
301
+ fixable: "code",
302
+ schema: [],
303
+ messages: {
304
+ splitStatementReexport: "'{{ name }}' is imported here and handed straight back out via a bare export -- the identical re-export 'export { {{ name }} } from ...' would be, just split across two statements. Re-exports belong only in the public barrel.",
305
+ splitStatementDefaultReexport: "'{{ name }}' is imported here and handed straight back out via `export default` -- the identical re-export 'export { {{ name }} as default } from ...' would be, just split across two statements. Re-exports belong only in the public barrel."
306
+ }
307
+ },
308
+ create(context) {
309
+ if (isIndexFile(context.filename)) return {};
310
+ const detector = createSplitReexportDetector();
311
+ return {
312
+ ImportDeclaration: (node) => detector.visitImport(node),
313
+ ExportNamedDeclaration: (node) => detector.visitExportNamed(node),
314
+ ExportDefaultDeclaration: (node) => detector.visitExportDefault(node),
315
+ "Program:exit"() {
316
+ const { sourceCode } = context;
317
+ for (const violation of detector.violations()) if (violation.kind === "named") {
318
+ const { specifier, declaration, name, trackedImport } = violation;
319
+ context.report({
320
+ node: specifier,
321
+ messageId: "splitStatementReexport",
322
+ data: { name },
323
+ fix(fixer) {
324
+ const fixes = [removeListMember(fixer, sourceCode, declaration, declaration.specifiers, specifier)];
325
+ if (specifier.local.type === "Identifier" && importIsOnlyUsedByThisExport(sourceCode, trackedImport, specifier.local)) fixes.push(removeListMember(fixer, sourceCode, trackedImport.declaration, trackedImport.declaration.specifiers, trackedImport.specifier));
326
+ return fixes;
327
+ }
328
+ });
329
+ } else {
330
+ const { declaration, name, trackedImport } = violation;
331
+ context.report({
332
+ node: declaration,
333
+ messageId: "splitStatementDefaultReexport",
334
+ data: { name },
335
+ fix(fixer) {
336
+ const fixes = [fixer.remove(declaration)];
337
+ if (declaration.declaration.type === "Identifier" && importIsOnlyUsedByThisExport(sourceCode, trackedImport, declaration.declaration)) fixes.push(removeListMember(fixer, sourceCode, trackedImport.declaration, trackedImport.declaration.specifiers, trackedImport.specifier));
338
+ return fixes;
339
+ }
340
+ });
341
+ }
342
+ }
343
+ };
344
+ }
345
+ };
346
+ //#endregion
347
+ //#region src/rules/no-pointless-reassignment.ts
348
+ function isIdentifierReference(reference) {
349
+ return reference.identifier.type === "Identifier";
350
+ }
351
+ //#endregion
352
+ //#region src/plugin.ts
353
+ const plugin = {
354
+ meta: {
355
+ name: "@exadev/eslint-config",
356
+ version,
357
+ namespace: "exadev"
358
+ },
359
+ rules: {
360
+ "barrel-direct-siblings-only": barrelDirectSiblingsOnly,
361
+ "barrel-policy": barrelPolicy,
362
+ "no-index-files": noIndexFiles,
363
+ "no-non-barrel-index": noNonBarrelIndex,
364
+ "no-non-barrel-reexport": noNonBarrelReexport,
365
+ "no-pointless-reassignment": {
366
+ meta: {
367
+ type: "problem",
368
+ fixable: "code",
369
+ schema: [],
370
+ messages: { pointlessReassignment: "Pointless reassignment: '{{ name }}' is just an alias for '{{ value }}'. Use the original directly." }
371
+ },
372
+ create(context) {
373
+ return { VariableDeclarator(node) {
374
+ if (node.id.type !== "Identifier" || node.init?.type !== "Identifier" || node.id.name.startsWith("_")) return;
375
+ if (node.parent.type !== "VariableDeclaration" || node.parent.kind !== "const") return;
376
+ const scope = context.sourceCode.getScope(node);
377
+ const sourceVariable = scope.references.find((reference) => reference.identifier === node.init)?.resolved;
378
+ if (!sourceVariable || sourceVariable.references.some((reference) => reference.isWrite() && !reference.init)) return;
379
+ const aliasName = node.id.name;
380
+ const originalName = node.init.name;
381
+ context.report({
382
+ node,
383
+ messageId: "pointlessReassignment",
384
+ data: {
385
+ name: aliasName,
386
+ value: originalName
387
+ },
388
+ fix(fixer) {
389
+ const variable = scope.set.get(aliasName);
390
+ if (!variable) return null;
391
+ if (variable.references.filter((reference) => reference.isWrite() && reference.identifier !== node.id).length > 0) return null;
392
+ const readRefs = variable.references.filter((reference) => reference.isRead() && isIdentifierReference(reference));
393
+ if (readRefs.some((reference) => {
394
+ const afterToken = context.sourceCode.getTokenAfter(reference.identifier);
395
+ if (afterToken?.value === ":") return false;
396
+ if (afterToken?.value !== "}" && afterToken?.value !== ",") return false;
397
+ let token = context.sourceCode.getTokenBefore(reference.identifier);
398
+ while (token) {
399
+ if (token.value === "{") return true;
400
+ if (token.value === "[" || token.value === "(") return false;
401
+ if (token.value === ":") return false;
402
+ token = context.sourceCode.getTokenBefore(token);
403
+ }
404
+ return false;
405
+ })) return null;
406
+ const fixes = readRefs.map((reference) => fixer.replaceText(reference.identifier, originalName));
407
+ const declaration = node.parent;
408
+ if (declaration.type !== "VariableDeclaration" || declaration.declarations.length !== 1) return null;
409
+ fixes.push(fixer.remove(declaration));
410
+ return fixes;
411
+ }
412
+ });
413
+ } };
414
+ }
415
+ },
416
+ "no-side-effects-in-index": {
417
+ meta: {
418
+ type: "problem",
419
+ schema: [],
420
+ messages: { notAPureReexport: "A barrel (index) file may contain only re-export statements ('export * from ...' / 'export { x } from ...' / 'export type { x } from ...') -- nothing else, so it can never have a side effect at import time by construction. Found: {{ description }}." }
421
+ },
422
+ create(context) {
423
+ if (!isIndexFile(context.filename)) return {};
424
+ return { Program(node) {
425
+ for (const statement of node.body) if (!isPureReexport(statement)) context.report({
426
+ node: statement,
427
+ messageId: "notAPureReexport",
428
+ data: { description: statement.type }
429
+ });
430
+ } };
431
+ }
432
+ }
433
+ },
434
+ configs: {
435
+ get recommended() {
436
+ return {
437
+ plugins: { exadev: plugin },
438
+ linterOptions: { noInlineConfig: true },
439
+ rules: {
440
+ "exadev/barrel-policy": ["error", { mode: "banned" }],
441
+ "exadev/no-pointless-reassignment": "error"
442
+ }
443
+ };
444
+ },
445
+ get barrel() {
446
+ return {
447
+ plugins: { exadev: plugin },
448
+ rules: { "exadev/barrel-policy": ["error", { mode: "single" }] }
449
+ };
450
+ }
451
+ }
452
+ };
453
+ //#endregion
454
+ //#region src/recommended-type-checked.ts
455
+ const TEST_FILE_PATTERNS = "**/*.{test,spec}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}";
456
+ const recommendedTypeChecked = [
457
+ ...tseslint.configs.recommendedTypeChecked,
458
+ ...tseslint.configs.stylisticTypeChecked,
459
+ {
460
+ plugins: { exadev: plugin },
461
+ linterOptions: { noInlineConfig: true },
462
+ rules: {
463
+ "exadev/barrel-policy": ["error", { mode: "banned" }],
464
+ "exadev/no-pointless-reassignment": "error",
465
+ "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }],
466
+ "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": true }]
467
+ }
468
+ },
469
+ {
470
+ files: [TEST_FILE_PATTERNS],
471
+ rules: {
472
+ "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
473
+ "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }]
474
+ }
475
+ }
476
+ ];
477
+ //#endregion
478
+ export { recommendedTypeChecked as default, plugin };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exadev/eslint-config",
3
- "version": "1.4.1",
3
+ "version": "2.1.0",
4
4
  "description": "Shared custom ESLint rules and plugin for ExaDev projects",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -23,14 +23,6 @@
23
23
  },
24
24
  "import": "./dist/index.js",
25
25
  "require": "./dist/index.cjs"
26
- },
27
- "./*": {
28
- "types": {
29
- "import": "./dist/*.d.ts",
30
- "require": "./dist/*.d.cts"
31
- },
32
- "import": "./dist/*.js",
33
- "require": "./dist/*.cjs"
34
26
  }
35
27
  },
36
28
  "files": [
@@ -49,11 +41,6 @@
49
41
  "eslint": ">=10.0.0",
50
42
  "typescript-eslint": ">=8.0.0"
51
43
  },
52
- "peerDependenciesMeta": {
53
- "typescript-eslint": {
54
- "optional": true
55
- }
56
- },
57
44
  "devDependencies": {
58
45
  "@arethetypeswrong/cli": "^0.18.5",
59
46
  "@commitlint/cli": "^21.2.1",
@@ -1,46 +0,0 @@
1
- //#endregion
2
- //#region src/plugin.ts
3
- const plugin = {
4
- meta: {
5
- name: "@exadev/eslint-config",
6
- version: "1.4.1",
7
- namespace: "exadev"
8
- },
9
- rules: {
10
- "no-non-barrel-index": require("./rules/no-non-barrel-index.cjs"),
11
- "no-non-barrel-reexport": require("./rules/no-non-barrel-reexport.cjs"),
12
- "no-pointless-reassignment": require("./rules/no-pointless-reassignment.cjs"),
13
- "no-side-effects-in-index": require("./rules/no-side-effects-in-index.cjs")
14
- },
15
- configs: {
16
- get recommended() {
17
- return {
18
- plugins: { exadev: plugin },
19
- linterOptions: { noInlineConfig: true },
20
- rules: {
21
- "exadev/no-non-barrel-index": "error",
22
- "exadev/no-non-barrel-reexport": "error",
23
- "exadev/no-pointless-reassignment": "error",
24
- "exadev/no-side-effects-in-index": "error"
25
- }
26
- };
27
- },
28
- get barrel() {
29
- return {
30
- plugins: { exadev: plugin },
31
- rules: {
32
- "exadev/no-non-barrel-index": "error",
33
- "exadev/no-non-barrel-reexport": "error",
34
- "exadev/no-side-effects-in-index": "error"
35
- }
36
- };
37
- }
38
- }
39
- };
40
- //#endregion
41
- Object.defineProperty(exports, "plugin", {
42
- enumerable: true,
43
- get: function() {
44
- return plugin;
45
- }
46
- });
@@ -1,45 +0,0 @@
1
- import noNonBarrelIndex from "./rules/no-non-barrel-index.js";
2
- import noNonBarrelReexport from "./rules/no-non-barrel-reexport.js";
3
- import noPointlessReassignment from "./rules/no-pointless-reassignment.js";
4
- import noSideEffectsInIndex from "./rules/no-side-effects-in-index.js";
5
- //#endregion
6
- //#region src/plugin.ts
7
- const plugin = {
8
- meta: {
9
- name: "@exadev/eslint-config",
10
- version: "1.4.1",
11
- namespace: "exadev"
12
- },
13
- rules: {
14
- "no-non-barrel-index": noNonBarrelIndex,
15
- "no-non-barrel-reexport": noNonBarrelReexport,
16
- "no-pointless-reassignment": noPointlessReassignment,
17
- "no-side-effects-in-index": noSideEffectsInIndex
18
- },
19
- configs: {
20
- get recommended() {
21
- return {
22
- plugins: { exadev: plugin },
23
- linterOptions: { noInlineConfig: true },
24
- rules: {
25
- "exadev/no-non-barrel-index": "error",
26
- "exadev/no-non-barrel-reexport": "error",
27
- "exadev/no-pointless-reassignment": "error",
28
- "exadev/no-side-effects-in-index": "error"
29
- }
30
- };
31
- },
32
- get barrel() {
33
- return {
34
- plugins: { exadev: plugin },
35
- rules: {
36
- "exadev/no-non-barrel-index": "error",
37
- "exadev/no-non-barrel-reexport": "error",
38
- "exadev/no-side-effects-in-index": "error"
39
- }
40
- };
41
- }
42
- }
43
- };
44
- //#endregion
45
- export { plugin as t };
package/dist/plugin.cjs DELETED
@@ -1,2 +0,0 @@
1
- const require_plugin = require("./plugin-BscQLyGY.cjs");
2
- module.exports = require_plugin.plugin;
package/dist/plugin.d.cts DELETED
@@ -1,4 +0,0 @@
1
- import { ESLint } from "eslint";
2
- //#region src/plugin.d.ts
3
- declare const plugin: ESLint.Plugin;
4
- export = plugin;
package/dist/plugin.d.ts DELETED
@@ -1,5 +0,0 @@
1
- import { ESLint } from "eslint";
2
- //#region src/plugin.d.ts
3
- declare const plugin: ESLint.Plugin;
4
- //#endregion
5
- export { plugin as default };
package/dist/plugin.js DELETED
@@ -1,2 +0,0 @@
1
- import { t as plugin } from "./plugin-DYny7gdb.js";
2
- export { plugin as default };
@@ -1,52 +0,0 @@
1
- //#region \0rolldown/runtime.js
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 __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
15
- }
16
- return to;
17
- };
18
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
- value: mod,
20
- enumerable: true
21
- }) : target, mod));
22
- //#endregion
23
- const require_plugin = require("./plugin-BscQLyGY.cjs");
24
- let typescript_eslint = require("typescript-eslint");
25
- typescript_eslint = __toESM(typescript_eslint, 1);
26
- //#region src/recommended-type-checked.ts
27
- const TEST_FILE_PATTERNS = "**/*.{test,spec}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}";
28
- const recommendedTypeChecked = [
29
- ...typescript_eslint.default.configs.recommendedTypeChecked,
30
- ...typescript_eslint.default.configs.stylisticTypeChecked,
31
- {
32
- plugins: { exadev: require_plugin.plugin },
33
- linterOptions: { noInlineConfig: true },
34
- rules: {
35
- "exadev/no-non-barrel-index": "error",
36
- "exadev/no-non-barrel-reexport": "error",
37
- "exadev/no-pointless-reassignment": "error",
38
- "exadev/no-side-effects-in-index": "error",
39
- "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "never" }],
40
- "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": true }]
41
- }
42
- },
43
- {
44
- files: [TEST_FILE_PATTERNS],
45
- rules: {
46
- "@typescript-eslint/ban-ts-comment": ["error", { "ts-expect-error": "allow-with-description" }],
47
- "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }]
48
- }
49
- }
50
- ];
51
- //#endregion
52
- module.exports = recommendedTypeChecked;
@@ -1,5 +0,0 @@
1
- import { ESLint } from "eslint";
2
- //#region src/recommended-type-checked.d.ts
3
- type ConfigValue = NonNullable<ESLint.Plugin['configs']>[string];
4
- declare const recommendedTypeChecked: ConfigValue;
5
- export = recommendedTypeChecked;