eslint-plugin-intlayer 9.3.1 → 9.3.2

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.
Files changed (55) hide show
  1. package/README.md +103 -49
  2. package/dist/cjs/@intlayer/config/dist/esm/extract/constants.cjs +18 -0
  3. package/dist/cjs/@intlayer/config/dist/esm/extract/constants.cjs.map +1 -0
  4. package/dist/cjs/@intlayer/config/dist/esm/extract/shouldExtract.cjs +37 -0
  5. package/dist/cjs/@intlayer/config/dist/esm/extract/shouldExtract.cjs.map +1 -0
  6. package/dist/cjs/_virtual/_rolldown/runtime.cjs +28 -0
  7. package/dist/cjs/index.cjs +41 -29
  8. package/dist/cjs/index.cjs.map +1 -1
  9. package/dist/cjs/preset.cjs +53 -0
  10. package/dist/cjs/preset.cjs.map +1 -0
  11. package/dist/cjs/rules/noRawText.cjs +4 -3
  12. package/dist/cjs/rules/noRawText.cjs.map +1 -1
  13. package/dist/cjs/rules/noUnusedContent.cjs +143 -0
  14. package/dist/cjs/rules/noUnusedContent.cjs.map +1 -0
  15. package/dist/cjs/utils/contentDeclaration.cjs +100 -0
  16. package/dist/cjs/utils/contentDeclaration.cjs.map +1 -0
  17. package/dist/cjs/utils/projectUsage.cjs +437 -0
  18. package/dist/cjs/utils/projectUsage.cjs.map +1 -0
  19. package/dist/cjs/utils/reactVersion.cjs +50 -0
  20. package/dist/cjs/utils/reactVersion.cjs.map +1 -0
  21. package/dist/esm/@intlayer/config/dist/esm/extract/constants.mjs +18 -0
  22. package/dist/esm/@intlayer/config/dist/esm/extract/constants.mjs.map +1 -0
  23. package/dist/esm/@intlayer/config/dist/esm/extract/shouldExtract.mjs +37 -0
  24. package/dist/esm/@intlayer/config/dist/esm/extract/shouldExtract.mjs.map +1 -0
  25. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  26. package/dist/esm/index.mjs +36 -30
  27. package/dist/esm/index.mjs.map +1 -1
  28. package/dist/esm/preset.mjs +48 -0
  29. package/dist/esm/preset.mjs.map +1 -0
  30. package/dist/esm/rules/noRawText.mjs +2 -1
  31. package/dist/esm/rules/noRawText.mjs.map +1 -1
  32. package/dist/esm/rules/noUnusedContent.mjs +142 -0
  33. package/dist/esm/rules/noUnusedContent.mjs.map +1 -0
  34. package/dist/esm/utils/contentDeclaration.mjs +99 -0
  35. package/dist/esm/utils/contentDeclaration.mjs.map +1 -0
  36. package/dist/esm/utils/projectUsage.mjs +433 -0
  37. package/dist/esm/utils/projectUsage.mjs.map +1 -0
  38. package/dist/esm/utils/reactVersion.mjs +46 -0
  39. package/dist/esm/utils/reactVersion.mjs.map +1 -0
  40. package/dist/types/index.d.ts +19 -6
  41. package/dist/types/index.d.ts.map +1 -1
  42. package/dist/types/node_modules/.bun/@types_estree@1.0.9/node_modules/@types/estree/index.d.ts +528 -0
  43. package/dist/types/node_modules/.bun/@types_estree@1.0.9/node_modules/@types/estree/index.d.ts.map +1 -0
  44. package/dist/types/preset.d.ts +45 -0
  45. package/dist/types/preset.d.ts.map +1 -0
  46. package/dist/types/rules/noUnusedContent.d.ts +33 -0
  47. package/dist/types/rules/noUnusedContent.d.ts.map +1 -0
  48. package/dist/types/utils/ast.d.ts +1 -1
  49. package/dist/types/utils/contentDeclaration.d.ts +42 -0
  50. package/dist/types/utils/contentDeclaration.d.ts.map +1 -0
  51. package/dist/types/utils/projectUsage.d.ts +102 -0
  52. package/dist/types/utils/projectUsage.d.ts.map +1 -0
  53. package/dist/types/utils/reactVersion.d.ts +18 -0
  54. package/dist/types/utils/reactVersion.d.ts.map +1 -0
  55. package/package.json +4 -2
@@ -0,0 +1,528 @@
1
+ //#region ../../node_modules/.bun/@types+estree@1.0.9/node_modules/@types/estree/index.d.ts
2
+ // This definition file follows a somewhat unusual format. ESTree allows
3
+ // runtime type checks based on the `type` parameter. In order to explain this
4
+ // to typescript we want to use discriminated union types:
5
+ // https://github.com/Microsoft/TypeScript/pull/9163
6
+ //
7
+ // For ESTree this is a bit tricky because the high level interfaces like
8
+ // Node or Function are pulling double duty. We want to pass common fields down
9
+ // to the interfaces that extend them (like Identifier or
10
+ // ArrowFunctionExpression), but you can't extend a type union or enforce
11
+ // common fields on them. So we've split the high level interfaces into two
12
+ // types, a base type which passes down inherited fields, and a type union of
13
+ // all types which extend the base type. Only the type union is exported, and
14
+ // the union is how other types refer to the collection of inheriting types.
15
+ //
16
+ // This makes the definitions file here somewhat more difficult to maintain,
17
+ // but it has the notable advantage of making ESTree much easier to use as
18
+ // an end user.
19
+ interface BaseNodeWithoutComments {
20
+ // Every leaf interface that extends BaseNode must specify a type property.
21
+ // The type property should be a string literal. For example, Identifier
22
+ // has: `type: "Identifier"`
23
+ type: string;
24
+ loc?: SourceLocation | null | undefined;
25
+ range?: [number, number] | undefined;
26
+ }
27
+ interface BaseNode extends BaseNodeWithoutComments {
28
+ leadingComments?: Comment[] | undefined;
29
+ trailingComments?: Comment[] | undefined;
30
+ }
31
+ interface NodeMap {
32
+ AssignmentProperty: AssignmentProperty;
33
+ CatchClause: CatchClause;
34
+ Class: Class;
35
+ ClassBody: ClassBody;
36
+ Expression: Expression;
37
+ Function: Function;
38
+ Identifier: Identifier;
39
+ Literal: Literal;
40
+ MethodDefinition: MethodDefinition;
41
+ ModuleDeclaration: ModuleDeclaration;
42
+ ModuleSpecifier: ModuleSpecifier;
43
+ Pattern: Pattern;
44
+ PrivateIdentifier: PrivateIdentifier;
45
+ Program: Program;
46
+ Property: Property;
47
+ PropertyDefinition: PropertyDefinition;
48
+ SpreadElement: SpreadElement;
49
+ Statement: Statement;
50
+ Super: Super;
51
+ SwitchCase: SwitchCase;
52
+ TemplateElement: TemplateElement;
53
+ VariableDeclarator: VariableDeclarator;
54
+ }
55
+ type Node = NodeMap[keyof NodeMap];
56
+ interface Comment extends BaseNodeWithoutComments {
57
+ type: "Line" | "Block";
58
+ value: string;
59
+ }
60
+ interface SourceLocation {
61
+ source?: string | null | undefined;
62
+ start: Position;
63
+ end: Position;
64
+ }
65
+ interface Position {
66
+ /** >= 1 */
67
+ line: number;
68
+ /** >= 0 */
69
+ column: number;
70
+ }
71
+ interface Program extends BaseNode {
72
+ type: "Program";
73
+ sourceType: "script" | "module";
74
+ body: Array<Directive | Statement | ModuleDeclaration>;
75
+ comments?: Comment[] | undefined;
76
+ }
77
+ interface Directive extends BaseNode {
78
+ type: "ExpressionStatement";
79
+ expression: Literal;
80
+ directive: string;
81
+ }
82
+ interface BaseFunction extends BaseNode {
83
+ params: Pattern[];
84
+ generator?: boolean | undefined;
85
+ async?: boolean | undefined;
86
+ // The body is either BlockStatement or Expression because arrow functions
87
+ // can have a body that's either. FunctionDeclarations and
88
+ // FunctionExpressions have only BlockStatement bodies.
89
+ body: BlockStatement | Expression;
90
+ }
91
+ type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
92
+ type Statement = ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
93
+ interface BaseStatement extends BaseNode {}
94
+ interface EmptyStatement extends BaseStatement {
95
+ type: "EmptyStatement";
96
+ }
97
+ interface BlockStatement extends BaseStatement {
98
+ type: "BlockStatement";
99
+ body: Statement[];
100
+ innerComments?: Comment[] | undefined;
101
+ }
102
+ interface StaticBlock extends Omit<BlockStatement, "type"> {
103
+ type: "StaticBlock";
104
+ }
105
+ interface ExpressionStatement extends BaseStatement {
106
+ type: "ExpressionStatement";
107
+ expression: Expression;
108
+ }
109
+ interface IfStatement extends BaseStatement {
110
+ type: "IfStatement";
111
+ test: Expression;
112
+ consequent: Statement;
113
+ alternate?: Statement | null | undefined;
114
+ }
115
+ interface LabeledStatement extends BaseStatement {
116
+ type: "LabeledStatement";
117
+ label: Identifier;
118
+ body: Statement;
119
+ }
120
+ interface BreakStatement extends BaseStatement {
121
+ type: "BreakStatement";
122
+ label?: Identifier | null | undefined;
123
+ }
124
+ interface ContinueStatement extends BaseStatement {
125
+ type: "ContinueStatement";
126
+ label?: Identifier | null | undefined;
127
+ }
128
+ interface WithStatement extends BaseStatement {
129
+ type: "WithStatement";
130
+ object: Expression;
131
+ body: Statement;
132
+ }
133
+ interface SwitchStatement extends BaseStatement {
134
+ type: "SwitchStatement";
135
+ discriminant: Expression;
136
+ cases: SwitchCase[];
137
+ }
138
+ interface ReturnStatement extends BaseStatement {
139
+ type: "ReturnStatement";
140
+ argument?: Expression | null | undefined;
141
+ }
142
+ interface ThrowStatement extends BaseStatement {
143
+ type: "ThrowStatement";
144
+ argument: Expression;
145
+ }
146
+ interface TryStatement extends BaseStatement {
147
+ type: "TryStatement";
148
+ block: BlockStatement;
149
+ handler?: CatchClause | null | undefined;
150
+ finalizer?: BlockStatement | null | undefined;
151
+ }
152
+ interface WhileStatement extends BaseStatement {
153
+ type: "WhileStatement";
154
+ test: Expression;
155
+ body: Statement;
156
+ }
157
+ interface DoWhileStatement extends BaseStatement {
158
+ type: "DoWhileStatement";
159
+ body: Statement;
160
+ test: Expression;
161
+ }
162
+ interface ForStatement extends BaseStatement {
163
+ type: "ForStatement";
164
+ init?: VariableDeclaration | Expression | null | undefined;
165
+ test?: Expression | null | undefined;
166
+ update?: Expression | null | undefined;
167
+ body: Statement;
168
+ }
169
+ interface BaseForXStatement extends BaseStatement {
170
+ left: VariableDeclaration | Pattern;
171
+ right: Expression;
172
+ body: Statement;
173
+ }
174
+ interface ForInStatement extends BaseForXStatement {
175
+ type: "ForInStatement";
176
+ }
177
+ interface DebuggerStatement extends BaseStatement {
178
+ type: "DebuggerStatement";
179
+ }
180
+ type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
181
+ interface BaseDeclaration extends BaseStatement {}
182
+ interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
183
+ type: "FunctionDeclaration";
184
+ /** It is null when a function declaration is a part of the `export default function` statement */
185
+ id: Identifier | null;
186
+ body: BlockStatement;
187
+ }
188
+ interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
189
+ id: Identifier;
190
+ }
191
+ interface VariableDeclaration extends BaseDeclaration {
192
+ type: "VariableDeclaration";
193
+ declarations: VariableDeclarator[];
194
+ kind: "var" | "let" | "const" | "using" | "await using";
195
+ }
196
+ interface VariableDeclarator extends BaseNode {
197
+ type: "VariableDeclarator";
198
+ id: Pattern;
199
+ init?: Expression | null | undefined;
200
+ }
201
+ interface ExpressionMap {
202
+ ArrayExpression: ArrayExpression;
203
+ ArrowFunctionExpression: ArrowFunctionExpression;
204
+ AssignmentExpression: AssignmentExpression;
205
+ AwaitExpression: AwaitExpression;
206
+ BinaryExpression: BinaryExpression;
207
+ CallExpression: CallExpression;
208
+ ChainExpression: ChainExpression;
209
+ ClassExpression: ClassExpression;
210
+ ConditionalExpression: ConditionalExpression;
211
+ FunctionExpression: FunctionExpression;
212
+ Identifier: Identifier;
213
+ ImportExpression: ImportExpression;
214
+ Literal: Literal;
215
+ LogicalExpression: LogicalExpression;
216
+ MemberExpression: MemberExpression;
217
+ MetaProperty: MetaProperty;
218
+ NewExpression: NewExpression;
219
+ ObjectExpression: ObjectExpression;
220
+ SequenceExpression: SequenceExpression;
221
+ TaggedTemplateExpression: TaggedTemplateExpression;
222
+ TemplateLiteral: TemplateLiteral;
223
+ ThisExpression: ThisExpression;
224
+ UnaryExpression: UnaryExpression;
225
+ UpdateExpression: UpdateExpression;
226
+ YieldExpression: YieldExpression;
227
+ }
228
+ type Expression = ExpressionMap[keyof ExpressionMap];
229
+ interface BaseExpression extends BaseNode {}
230
+ type ChainElement = SimpleCallExpression | MemberExpression;
231
+ interface ChainExpression extends BaseExpression {
232
+ type: "ChainExpression";
233
+ expression: ChainElement;
234
+ }
235
+ interface ThisExpression extends BaseExpression {
236
+ type: "ThisExpression";
237
+ }
238
+ interface ArrayExpression extends BaseExpression {
239
+ type: "ArrayExpression";
240
+ elements: Array<Expression | SpreadElement | null>;
241
+ }
242
+ interface ObjectExpression extends BaseExpression {
243
+ type: "ObjectExpression";
244
+ properties: Array<Property | SpreadElement>;
245
+ }
246
+ interface PrivateIdentifier extends BaseNode {
247
+ type: "PrivateIdentifier";
248
+ name: string;
249
+ }
250
+ interface Property extends BaseNode {
251
+ type: "Property";
252
+ key: Expression;
253
+ value: Expression | Pattern; // Could be an AssignmentProperty
254
+ kind: "init" | "get" | "set";
255
+ method: boolean;
256
+ shorthand: boolean;
257
+ computed: boolean;
258
+ }
259
+ interface PropertyDefinition extends BaseNode {
260
+ type: "PropertyDefinition";
261
+ key: Expression | PrivateIdentifier;
262
+ value?: Expression | null | undefined;
263
+ computed: boolean;
264
+ static: boolean;
265
+ }
266
+ interface FunctionExpression extends BaseFunction, BaseExpression {
267
+ id?: Identifier | null | undefined;
268
+ type: "FunctionExpression";
269
+ body: BlockStatement;
270
+ }
271
+ interface SequenceExpression extends BaseExpression {
272
+ type: "SequenceExpression";
273
+ expressions: Expression[];
274
+ }
275
+ interface UnaryExpression extends BaseExpression {
276
+ type: "UnaryExpression";
277
+ operator: UnaryOperator;
278
+ prefix: true;
279
+ argument: Expression;
280
+ }
281
+ interface BinaryExpression extends BaseExpression {
282
+ type: "BinaryExpression";
283
+ operator: BinaryOperator;
284
+ left: Expression | PrivateIdentifier;
285
+ right: Expression;
286
+ }
287
+ interface AssignmentExpression extends BaseExpression {
288
+ type: "AssignmentExpression";
289
+ operator: AssignmentOperator;
290
+ left: Pattern | MemberExpression;
291
+ right: Expression;
292
+ }
293
+ interface UpdateExpression extends BaseExpression {
294
+ type: "UpdateExpression";
295
+ operator: UpdateOperator;
296
+ argument: Expression;
297
+ prefix: boolean;
298
+ }
299
+ interface LogicalExpression extends BaseExpression {
300
+ type: "LogicalExpression";
301
+ operator: LogicalOperator;
302
+ left: Expression;
303
+ right: Expression;
304
+ }
305
+ interface ConditionalExpression extends BaseExpression {
306
+ type: "ConditionalExpression";
307
+ test: Expression;
308
+ alternate: Expression;
309
+ consequent: Expression;
310
+ }
311
+ interface BaseCallExpression extends BaseExpression {
312
+ callee: Expression | Super;
313
+ arguments: Array<Expression | SpreadElement>;
314
+ }
315
+ type CallExpression = SimpleCallExpression | NewExpression;
316
+ interface SimpleCallExpression extends BaseCallExpression {
317
+ type: "CallExpression";
318
+ optional: boolean;
319
+ }
320
+ interface NewExpression extends BaseCallExpression {
321
+ type: "NewExpression";
322
+ }
323
+ interface MemberExpression extends BaseExpression, BasePattern {
324
+ type: "MemberExpression";
325
+ object: Expression | Super;
326
+ property: Expression | PrivateIdentifier;
327
+ computed: boolean;
328
+ optional: boolean;
329
+ }
330
+ type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
331
+ interface BasePattern extends BaseNode {}
332
+ interface SwitchCase extends BaseNode {
333
+ type: "SwitchCase";
334
+ test?: Expression | null | undefined;
335
+ consequent: Statement[];
336
+ }
337
+ interface CatchClause extends BaseNode {
338
+ type: "CatchClause";
339
+ param: Pattern | null;
340
+ body: BlockStatement;
341
+ }
342
+ interface Identifier extends BaseNode, BaseExpression, BasePattern {
343
+ type: "Identifier";
344
+ name: string;
345
+ }
346
+ type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
347
+ interface SimpleLiteral extends BaseNode, BaseExpression {
348
+ type: "Literal";
349
+ value: string | boolean | number | null;
350
+ raw?: string | undefined;
351
+ }
352
+ interface RegExpLiteral extends BaseNode, BaseExpression {
353
+ type: "Literal";
354
+ value?: RegExp | null | undefined;
355
+ regex: {
356
+ pattern: string;
357
+ flags: string;
358
+ };
359
+ raw?: string | undefined;
360
+ }
361
+ interface BigIntLiteral extends BaseNode, BaseExpression {
362
+ type: "Literal";
363
+ value?: bigint | null | undefined;
364
+ bigint: string;
365
+ raw?: string | undefined;
366
+ }
367
+ type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
368
+ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
369
+ type LogicalOperator = "||" | "&&" | "??";
370
+ type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
371
+ type UpdateOperator = "++" | "--";
372
+ interface ForOfStatement extends BaseForXStatement {
373
+ type: "ForOfStatement";
374
+ await: boolean;
375
+ }
376
+ interface Super extends BaseNode {
377
+ type: "Super";
378
+ }
379
+ interface SpreadElement extends BaseNode {
380
+ type: "SpreadElement";
381
+ argument: Expression;
382
+ }
383
+ interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
384
+ type: "ArrowFunctionExpression";
385
+ expression: boolean;
386
+ body: BlockStatement | Expression;
387
+ }
388
+ interface YieldExpression extends BaseExpression {
389
+ type: "YieldExpression";
390
+ argument?: Expression | null | undefined;
391
+ delegate: boolean;
392
+ }
393
+ interface TemplateLiteral extends BaseExpression {
394
+ type: "TemplateLiteral";
395
+ quasis: TemplateElement[];
396
+ expressions: Expression[];
397
+ }
398
+ interface TaggedTemplateExpression extends BaseExpression {
399
+ type: "TaggedTemplateExpression";
400
+ tag: Expression;
401
+ quasi: TemplateLiteral;
402
+ }
403
+ interface TemplateElement extends BaseNode {
404
+ type: "TemplateElement";
405
+ tail: boolean;
406
+ value: {
407
+ /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */
408
+ cooked?: string | null | undefined;
409
+ raw: string;
410
+ };
411
+ }
412
+ interface AssignmentProperty extends Property {
413
+ value: Pattern;
414
+ kind: "init";
415
+ method: boolean; // false
416
+ }
417
+ interface ObjectPattern extends BasePattern {
418
+ type: "ObjectPattern";
419
+ properties: Array<AssignmentProperty | RestElement>;
420
+ }
421
+ interface ArrayPattern extends BasePattern {
422
+ type: "ArrayPattern";
423
+ elements: Array<Pattern | null>;
424
+ }
425
+ interface RestElement extends BasePattern {
426
+ type: "RestElement";
427
+ argument: Pattern;
428
+ }
429
+ interface AssignmentPattern extends BasePattern {
430
+ type: "AssignmentPattern";
431
+ left: Pattern;
432
+ right: Expression;
433
+ }
434
+ type Class = ClassDeclaration | ClassExpression;
435
+ interface BaseClass extends BaseNode {
436
+ superClass?: Expression | null | undefined;
437
+ body: ClassBody;
438
+ }
439
+ interface ClassBody extends BaseNode {
440
+ type: "ClassBody";
441
+ body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
442
+ }
443
+ interface MethodDefinition extends BaseNode {
444
+ type: "MethodDefinition";
445
+ key: Expression | PrivateIdentifier;
446
+ value: FunctionExpression;
447
+ kind: "constructor" | "method" | "get" | "set";
448
+ computed: boolean;
449
+ static: boolean;
450
+ }
451
+ interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
452
+ type: "ClassDeclaration";
453
+ /** It is null when a class declaration is a part of the `export default class` statement */
454
+ id: Identifier | null;
455
+ }
456
+ interface ClassDeclaration extends MaybeNamedClassDeclaration {
457
+ id: Identifier;
458
+ }
459
+ interface ClassExpression extends BaseClass, BaseExpression {
460
+ type: "ClassExpression";
461
+ id?: Identifier | null | undefined;
462
+ }
463
+ interface MetaProperty extends BaseExpression {
464
+ type: "MetaProperty";
465
+ meta: Identifier;
466
+ property: Identifier;
467
+ }
468
+ type ModuleDeclaration = ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration;
469
+ interface BaseModuleDeclaration extends BaseNode {}
470
+ type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
471
+ interface BaseModuleSpecifier extends BaseNode {
472
+ local: Identifier;
473
+ }
474
+ interface ImportDeclaration extends BaseModuleDeclaration {
475
+ type: "ImportDeclaration";
476
+ specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
477
+ attributes: ImportAttribute[];
478
+ source: Literal;
479
+ }
480
+ interface ImportSpecifier extends BaseModuleSpecifier {
481
+ type: "ImportSpecifier";
482
+ imported: Identifier | Literal;
483
+ }
484
+ interface ImportAttribute extends BaseNode {
485
+ type: "ImportAttribute";
486
+ key: Identifier | Literal;
487
+ value: Literal;
488
+ }
489
+ interface ImportExpression extends BaseExpression {
490
+ type: "ImportExpression";
491
+ source: Expression;
492
+ options?: Expression | null | undefined;
493
+ }
494
+ interface ImportDefaultSpecifier extends BaseModuleSpecifier {
495
+ type: "ImportDefaultSpecifier";
496
+ }
497
+ interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
498
+ type: "ImportNamespaceSpecifier";
499
+ }
500
+ interface ExportNamedDeclaration extends BaseModuleDeclaration {
501
+ type: "ExportNamedDeclaration";
502
+ declaration?: Declaration | null | undefined;
503
+ specifiers: ExportSpecifier[];
504
+ attributes: ImportAttribute[];
505
+ source?: Literal | null | undefined;
506
+ }
507
+ interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
508
+ type: "ExportSpecifier";
509
+ local: Identifier | Literal;
510
+ exported: Identifier | Literal;
511
+ }
512
+ interface ExportDefaultDeclaration extends BaseModuleDeclaration {
513
+ type: "ExportDefaultDeclaration";
514
+ declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
515
+ }
516
+ interface ExportAllDeclaration extends BaseModuleDeclaration {
517
+ type: "ExportAllDeclaration";
518
+ exported: Identifier | Literal | null;
519
+ attributes: ImportAttribute[];
520
+ source: Literal;
521
+ }
522
+ interface AwaitExpression extends BaseExpression {
523
+ type: "AwaitExpression";
524
+ argument: Expression;
525
+ }
526
+ //#endregion
527
+ export { ArrayExpression, ArrayPattern, ArrowFunctionExpression, AssignmentExpression, AssignmentOperator, AssignmentPattern, AssignmentProperty, AwaitExpression, BaseCallExpression, BaseClass, BaseDeclaration, BaseExpression, BaseForXStatement, BaseFunction, BaseModuleDeclaration, BaseModuleSpecifier, BaseNode, BaseNodeWithoutComments, BasePattern, BaseStatement, BigIntLiteral, BinaryExpression, BinaryOperator, BlockStatement, BreakStatement, CallExpression, CatchClause, ChainElement, ChainExpression, Class, ClassBody, ClassDeclaration, ClassExpression, Comment, ConditionalExpression, ContinueStatement, DebuggerStatement, Declaration, Directive, DoWhileStatement, EmptyStatement, ExportAllDeclaration, ExportDefaultDeclaration, ExportNamedDeclaration, ExportSpecifier, Expression, ExpressionMap, ExpressionStatement, ForInStatement, ForOfStatement, ForStatement, Function, FunctionDeclaration, FunctionExpression, Identifier, IfStatement, ImportAttribute, ImportDeclaration, ImportDefaultSpecifier, ImportExpression, ImportNamespaceSpecifier, ImportSpecifier, LabeledStatement, Literal, LogicalExpression, LogicalOperator, MaybeNamedClassDeclaration, MaybeNamedFunctionDeclaration, MemberExpression, MetaProperty, MethodDefinition, ModuleDeclaration, ModuleSpecifier, NewExpression, Node, NodeMap, ObjectExpression, ObjectPattern, Pattern, Position, PrivateIdentifier, Program, Property, PropertyDefinition, RegExpLiteral, RestElement, ReturnStatement, SequenceExpression, SimpleCallExpression, SimpleLiteral, SourceLocation, SpreadElement, Statement, StaticBlock, Super, SwitchCase, SwitchStatement, TaggedTemplateExpression, TemplateElement, TemplateLiteral, ThisExpression, ThrowStatement, TryStatement, UnaryExpression, UnaryOperator, UpdateExpression, UpdateOperator, VariableDeclaration, VariableDeclarator, WhileStatement, WithStatement, YieldExpression };
528
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../../../../../../node_modules/.bun/@types+estree@1.0.9/node_modules/@types/estree/index.d.ts"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;UAkBiB;;;;EAIb;EACA,MAAM;EACN;;UAGa,iBAAiB;EAC9B,kBAAkB;EAClB,mBAAmB;;UAGN;EACb,oBAAoB;EACpB,aAAa;EACb,OAAO;EACP,WAAW;EACX,YAAY;EACZ,UAAU;EACV,YAAY;EACZ,SAAS;EACT,kBAAkB;EAClB,mBAAmB;EACnB,iBAAiB;EACjB,S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C;EACA,UAAU,MAAM;;UAGH,oBAAoB;EACjC;EACA,UAAU;;UAGG,0BAA0B;EACvC;EACA,MAAM;EACN,OAAO;;KAGC,QAAQ,mBAAmB;UACtB,kBAAkB;EAC/B,aAAa;EACb,MAAM;;UAGO,kBAAkB;EAC/B;EACA,MAAM,MAAM,mBAAmB,qBAAqB;;UAGvC,yBAAyB;EACtC;EACA,KAAK,aAAa;EAClB,OAAO;EACP;EACA;EACA;;UAGa,mCAAmC,WAAW;EAC3D;;EAEA,IAAI;;UAGS,yBAAyB;EACtC,IAAI;;UAGS,wBAAwB,WAAW;EAChD;EACA,KAAK;;UAGQ,qBAAqB;EAClC;EACA,MAAM;EACN,UAAU;;KAGF,oBACN,oBACA,yBACA,2BACA;UACW,8BAA8B;KAEnC,kBAAkB,kBAAkB,yBAAyB,2BAA2B;UACnF,4BAA4B;EACzC,OAAO;;UAGM,0BAA0B;EACvC;EACA,YAAY,MAAM,kBAAkB,yBAAyB;EAC7D,YAAY;EACZ,QAAQ;;UAGK,wBAAwB;EACrC;EACA,UAAU,aAAa;;UAGV,wBAAwB;EACrC;EACA,KAAK,aAAa;EAClB,OAAO;;UAGM,yBAAyB;EACtC;EACA,QAAQ;EACR,UAAU;;UAGG,+BAA+B;EAC5C;;UAGa,iCAAiC;EAC9C;;UAGa,+BAA+B;EAC5C;EACA,cAAc;EACd,YAAY;EACZ,YAAY;EACZ,SAAS;;UAGI,wBAAwB,KAAK;EAC1C;EACA,OAAO,aAAa;EACpB,UAAU,aAAa;;UAGV,iCAAiC;EAC9C;EACA,aAAa,gCAAgC,6BAA6B;;UAG7D,6BAA6B;EAC1C;EACA,UAAU,aAAa;EACvB,YAAY;EACZ,QAAQ;;UAGK,wBAAwB;EACrC;EACA,UAAU"}
@@ -0,0 +1,45 @@
1
+ import { IntlayerRuleName } from "./index.js";
2
+ import { Linter } from "eslint";
3
+ //#region src/preset.d.ts
4
+ /** npm package name of this plugin. */
5
+ declare const PLUGIN_PACKAGE_NAME = "eslint-plugin-intlayer";
6
+ /** Prefix the rules are registered under, e.g. `intlayer/no-raw-text`. */
7
+ declare const PLUGIN_NAMESPACE = "intlayer";
8
+ /**
9
+ * Intlayer's generated output, which every preset ignores.
10
+ *
11
+ * `.intlayer/` holds compiled dictionaries and generated types — machine-written
12
+ * files that are never source. Linting them is at best wasted work and at worst
13
+ * a hard failure, since third-party rules can crash on generated shapes they
14
+ * were never meant to see. The rest of the toolchain already excludes this
15
+ * directory (`content.watchExclude`, the build globs), so the lint preset
16
+ * matches.
17
+ */
18
+ declare const GENERATED_OUTPUT_GLOBS: string[];
19
+ /**
20
+ * Rules enabled by the `recommended` preset, keyed by unprefixed rule name.
21
+ *
22
+ * Exported because oxlint resolves a plugin's *rules* but not its shipped
23
+ * *configs*: `intlayer init` reads this to spell the preset out explicitly in
24
+ * `.oxlintrc.json`. Keeping the definition next to the rules it names means
25
+ * enabling one by default is a single-line change.
26
+ *
27
+ * `no-raw-text` stays a warning on purpose — pointed at an existing codebase it
28
+ * surfaces every untranslated string at once, which should not break a build on
29
+ * day one. `enforce-adapter-import` is deliberately absent: importing from the
30
+ * original package is valid once the bundler alias is configured, so it is
31
+ * opt-in through the `strict` preset. `no-unused-content` is absent from every
32
+ * preset — it scans the project from disk, which no preset should impose.
33
+ */
34
+ declare const RECOMMENDED_RULES: Partial<Record<IntlayerRuleName, Linter.RuleEntry>>;
35
+ /**
36
+ * The `recommended` preset with every rule name prefixed by the plugin
37
+ * namespace — the shape both ESLint flat config and `.oxlintrc.json` expect.
38
+ *
39
+ * `intlayer init` uses this to write the preset into `.oxlintrc.json`, since
40
+ * oxlint resolves a plugin's rules but not its configs.
41
+ */
42
+ declare const getRecommendedRules: () => Record<string, Linter.RuleEntry>;
43
+ //#endregion
44
+ export { GENERATED_OUTPUT_GLOBS, PLUGIN_NAMESPACE, PLUGIN_PACKAGE_NAME, RECOMMENDED_RULES, getRecommendedRules };
45
+ //# sourceMappingURL=preset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preset.d.ts","names":[],"sources":["../../src/preset.ts"],"mappings":";;;;cAIa;;cAGA;;;;;;;;;;;cAYA;;;;;;;;;;;;;;;;cAiBA,mBAAmB,QAC9B,OAAO,kBAAkB,OAAO;;;;;;;;cAcrB,2BAA0B,eAAe,OAAO"}
@@ -0,0 +1,33 @@
1
+ import { IntlayerRule } from "../utils/createRule.js";
2
+ //#region src/rules/noUnusedContent.d.ts
3
+ type NoUnusedContentOptions = {
4
+ /** Report a dictionary whose key is never referenced anywhere. Default: `true`. */
5
+ reportUnusedDictionaries?: boolean;
6
+ /** Report a content field that is never read anywhere. Default: `true`. */
7
+ reportUnusedFields?: boolean;
8
+ /**
9
+ * Report a dictionary key that is also declared elsewhere. Needs the unmerged
10
+ * dictionaries on disk, so it stays silent until the project has been built.
11
+ * Default: `true`.
12
+ */
13
+ reportDuplicateKeys?: boolean;
14
+ /** Regular-expression sources for field paths that are never reported. */
15
+ ignoreFields?: string[];
16
+ /**
17
+ * Project root the scan starts from. Defaults to ESLint's working directory,
18
+ * which is the right answer unless one lint run spans several Intlayer
19
+ * projects in a monorepo.
20
+ */
21
+ baseDir?: string;
22
+ /**
23
+ * How long one project scan is reused, in milliseconds. Lower it when linting
24
+ * from a long-lived editor server and you want edits reflected sooner; `0`
25
+ * rescans on every file. Default: `30000`.
26
+ */
27
+ cacheTtl?: number;
28
+ };
29
+ type MessageIds = 'unusedDictionary' | 'unusedField' | 'duplicateDictionary';
30
+ declare const noUnusedContent: IntlayerRule<[NoUnusedContentOptions?], MessageIds>;
31
+ //#endregion
32
+ export { NoUnusedContentOptions, noUnusedContent };
33
+ //# sourceMappingURL=noUnusedContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"noUnusedContent.d.ts","names":[],"sources":["../../../src/rules/noUnusedContent.ts"],"mappings":";;KAmBY;;EAEV;;EAEA;;;;;;EAMA;;EAEA;;;;;;EAMA;;;;;;EAMA;;KAGG;cAsDQ,iBAAe,cAAA,0BAAA"}
@@ -1,4 +1,4 @@
1
- import { Node } from "/Users/aymericpineau/Documents/intlayer_/node_modules/.bun/@types+estree@1.0.9/node_modules/@types/estree/index.js";
1
+ import { Node } from "../node_modules/.bun/@types_estree@1.0.9/node_modules/@types/estree/index.js";
2
2
  //#region src/utils/ast.d.ts
3
3
  /**
4
4
  * Minimal structural models for the nodes this plugin inspects that are not
@@ -0,0 +1,42 @@
1
+ import { AstNode } from "./ast.js";
2
+ //#region src/utils/contentDeclaration.d.ts
3
+ /**
4
+ * Reading an Intlayer content declaration out of the file being linted.
5
+ *
6
+ * A declaration is any object literal carrying both a `key` and a `content`
7
+ * property — the same shape the VS Code extension looks for, which covers
8
+ * `export default { … }`, `const dictionary = { … } satisfies Dictionary` and
9
+ * every variant in between without caring how the object reaches the export.
10
+ */
11
+ /** One field declared inside a dictionary's `content`. */
12
+ type DeclaredField = {
13
+ /** Dotted path from the content root, e.g. `hero.title`. */
14
+ path: string;
15
+ /** The property key node, so a report points at the field name. */
16
+ keyNode: AstNode;
17
+ };
18
+ /** A dictionary declaration found in the linted file. */
19
+ type ContentDeclaration = {
20
+ /** The static dictionary key. */
21
+ dictionaryKey: string;
22
+ /** The node holding the key, for reporting a fully unused dictionary. */
23
+ keyNode: AstNode;
24
+ /** Every field declared under `content`, depth-first. */
25
+ fields: DeclaredField[];
26
+ /**
27
+ * True when the content object holds a spread or a computed key, so the field
28
+ * list is not exhaustive. No field may be reported unused in that case — the
29
+ * missing entries could be exactly the ones being read.
30
+ */
31
+ isPartiallyEnumerated: boolean;
32
+ };
33
+ /**
34
+ * Read the dictionary declaration an object literal represents, or `null` when
35
+ * it is not one.
36
+ *
37
+ * @param objectExpression - Any `ObjectExpression` node from the linted file.
38
+ */
39
+ declare const readContentDeclaration: (objectExpression: AstNode) => ContentDeclaration | null;
40
+ //#endregion
41
+ export { ContentDeclaration, DeclaredField, readContentDeclaration };
42
+ //# sourceMappingURL=contentDeclaration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contentDeclaration.d.ts","names":[],"sources":["../../../src/utils/contentDeclaration.ts"],"mappings":";;;;;;;;;;;KAaY;;EAEV;;EAEA,SAAS;;;KAIC;;EAEV;;EAEA,SAAS;;EAET,QAAQ;;;;;;EAMR;;;;;;;;cA+GW,yBACX,kBAAkB,YACjB"}