eslint-plugin-intlayer 9.3.1 → 9.3.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.
Files changed (64) 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/enforceAdapterImport.cjs +9 -2
  12. package/dist/cjs/rules/enforceAdapterImport.cjs.map +1 -1
  13. package/dist/cjs/rules/noRawText.cjs +4 -3
  14. package/dist/cjs/rules/noRawText.cjs.map +1 -1
  15. package/dist/cjs/rules/noUnusedContent.cjs +143 -0
  16. package/dist/cjs/rules/noUnusedContent.cjs.map +1 -0
  17. package/dist/cjs/rules/staticDictionaryKey.cjs +2 -2
  18. package/dist/cjs/rules/staticDictionaryKey.cjs.map +1 -1
  19. package/dist/cjs/utils/contentDeclaration.cjs +100 -0
  20. package/dist/cjs/utils/contentDeclaration.cjs.map +1 -0
  21. package/dist/cjs/utils/projectUsage.cjs +437 -0
  22. package/dist/cjs/utils/projectUsage.cjs.map +1 -0
  23. package/dist/cjs/utils/reactVersion.cjs +50 -0
  24. package/dist/cjs/utils/reactVersion.cjs.map +1 -0
  25. package/dist/esm/@intlayer/config/dist/esm/extract/constants.mjs +18 -0
  26. package/dist/esm/@intlayer/config/dist/esm/extract/constants.mjs.map +1 -0
  27. package/dist/esm/@intlayer/config/dist/esm/extract/shouldExtract.mjs +37 -0
  28. package/dist/esm/@intlayer/config/dist/esm/extract/shouldExtract.mjs.map +1 -0
  29. package/dist/esm/_virtual/_rolldown/runtime.mjs +8 -0
  30. package/dist/esm/index.mjs +36 -30
  31. package/dist/esm/index.mjs.map +1 -1
  32. package/dist/esm/preset.mjs +48 -0
  33. package/dist/esm/preset.mjs.map +1 -0
  34. package/dist/esm/rules/enforceAdapterImport.mjs +10 -3
  35. package/dist/esm/rules/enforceAdapterImport.mjs.map +1 -1
  36. package/dist/esm/rules/noRawText.mjs +2 -1
  37. package/dist/esm/rules/noRawText.mjs.map +1 -1
  38. package/dist/esm/rules/noUnusedContent.mjs +142 -0
  39. package/dist/esm/rules/noUnusedContent.mjs.map +1 -0
  40. package/dist/esm/rules/staticDictionaryKey.mjs +2 -2
  41. package/dist/esm/rules/staticDictionaryKey.mjs.map +1 -1
  42. package/dist/esm/utils/contentDeclaration.mjs +99 -0
  43. package/dist/esm/utils/contentDeclaration.mjs.map +1 -0
  44. package/dist/esm/utils/projectUsage.mjs +433 -0
  45. package/dist/esm/utils/projectUsage.mjs.map +1 -0
  46. package/dist/esm/utils/reactVersion.mjs +46 -0
  47. package/dist/esm/utils/reactVersion.mjs.map +1 -0
  48. package/dist/types/index.d.ts +19 -6
  49. package/dist/types/index.d.ts.map +1 -1
  50. package/dist/types/node_modules/.bun/@types_estree@1.0.9/node_modules/@types/estree/index.d.ts +528 -0
  51. package/dist/types/node_modules/.bun/@types_estree@1.0.9/node_modules/@types/estree/index.d.ts.map +1 -0
  52. package/dist/types/preset.d.ts +45 -0
  53. package/dist/types/preset.d.ts.map +1 -0
  54. package/dist/types/rules/enforceAdapterImport.d.ts.map +1 -1
  55. package/dist/types/rules/noUnusedContent.d.ts +33 -0
  56. package/dist/types/rules/noUnusedContent.d.ts.map +1 -0
  57. package/dist/types/utils/ast.d.ts +1 -1
  58. package/dist/types/utils/contentDeclaration.d.ts +42 -0
  59. package/dist/types/utils/contentDeclaration.d.ts.map +1 -0
  60. package/dist/types/utils/projectUsage.d.ts +102 -0
  61. package/dist/types/utils/projectUsage.d.ts.map +1 -0
  62. package/dist/types/utils/reactVersion.d.ts +18 -0
  63. package/dist/types/utils/reactVersion.d.ts.map +1 -0
  64. package/package.json +5 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reactVersion.mjs","names":[],"sources":["../../../src/utils/reactVersion.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\n\n/**\n * Detect the installed React version for ESLint configuration.\n *\n * `eslint-plugin-react` versions <= 7.37.5 rely on `context.getFilename()` to detect\n * the React version when `settings.react.version` is set to `\"detect\"`.\n * Because ESLint 10 removed `context.getFilename()`, every `react/*` rule throws on load\n * when `settings.react.version` is `\"detect\"`.\n *\n * Specifying an explicit detected React version in `settings.react.version`\n * bypasses the broken `detectReactVersion` codepath in `eslint-plugin-react`, allowing\n * Next.js and React projects using `eslint-config-next` / `eslint-plugin-react` to work\n * seamlessly under both ESLint 9 and ESLint 10 without needing manual configuration hacks.\n */\nexport const getReactVersion = (dir = process.cwd()): string => {\n try {\n let currentDir = dir;\n while (currentDir) {\n const reactPkgPath = path.join(\n currentDir,\n 'node_modules',\n 'react',\n 'package.json'\n );\n if (fs.existsSync(reactPkgPath)) {\n const pkg = JSON.parse(fs.readFileSync(reactPkgPath, 'utf8'));\n if (pkg.version) {\n return pkg.version;\n }\n }\n\n const pkgJsonPath = path.join(currentDir, 'package.json');\n if (fs.existsSync(pkgJsonPath)) {\n const pkg = JSON.parse(fs.readFileSync(pkgJsonPath, 'utf8'));\n const reactDep =\n pkg.dependencies?.react ||\n pkg.devDependencies?.react ||\n pkg.peerDependencies?.react;\n if (typeof reactDep === 'string') {\n const match = reactDep.match(/\\d+(\\.\\d+)*/);\n if (match) {\n return match[0];\n }\n }\n }\n\n const parentDir = path.dirname(currentDir);\n if (parentDir === currentDir) break;\n currentDir = parentDir;\n }\n } catch {}\n\n return '19.0';\n};\n"],"mappings":";;;;;;;;;;;;;;;;;AAgBA,MAAa,mBAAmB,MAAM,QAAQ,IAAI,MAAc;CAC9D,IAAI;EACF,IAAI,aAAa;EACjB,OAAO,YAAY;GACjB,MAAM,eAAe,KAAK,KACxB,YACA,gBACA,SACA,cACF;GACA,IAAI,GAAG,WAAW,YAAY,GAAG;IAC/B,MAAM,MAAM,KAAK,MAAM,GAAG,aAAa,cAAc,MAAM,CAAC;IAC5D,IAAI,IAAI,SACN,OAAO,IAAI;GAEf;GAEA,MAAM,cAAc,KAAK,KAAK,YAAY,cAAc;GACxD,IAAI,GAAG,WAAW,WAAW,GAAG;IAC9B,MAAM,MAAM,KAAK,MAAM,GAAG,aAAa,aAAa,MAAM,CAAC;IAC3D,MAAM,WACJ,IAAI,cAAc,SAClB,IAAI,iBAAiB,SACrB,IAAI,kBAAkB;IACxB,IAAI,OAAO,aAAa,UAAU;KAChC,MAAM,QAAQ,SAAS,MAAM,aAAa;KAC1C,IAAI,OACF,OAAO,MAAM;IAEjB;GACF;GAEA,MAAM,YAAY,KAAK,QAAQ,UAAU;GACzC,IAAI,cAAc,YAAY;GAC9B,aAAa;EACf;CACF,QAAQ,CAAC;CAET,OAAO;AACT"}
@@ -1,17 +1,23 @@
1
1
  import { IntlayerRule } from "./utils/createRule.js";
2
+ import { GENERATED_OUTPUT_GLOBS, PLUGIN_NAMESPACE, PLUGIN_PACKAGE_NAME, RECOMMENDED_RULES, getRecommendedRules } from "./preset.js";
2
3
  import { NoRawTextOptions } from "./rules/noRawText.js";
4
+ import { NoUnusedContentOptions } from "./rules/noUnusedContent.js";
5
+ import { getReactVersion } from "./utils/reactVersion.js";
3
6
  import "./index.js";
4
7
  import { ESLint, Linter } from "eslint";
5
8
  //#region src/index.d.ts
6
9
  /**
7
10
  * Every rule this plugin ships, keyed by the name used in configuration.
8
11
  *
9
- * The rules split into two families:
12
+ * The rules split into three families:
10
13
  * - **Coverage** (`no-raw-text`) — user-facing copy that never reached a
11
14
  * dictionary. Nothing else in the toolchain reports it.
12
15
  * - **Compiler contract** (`static-dictionary-key`, `no-dynamic-field-access`)
13
16
  * — call shapes that type-check and run, but that the Babel/SWC passes cannot
14
17
  * analyse, so they silently lose the optimize pass or read a purged field.
18
+ * - **Dead content** (`no-unused-content`) — dictionaries and fields nothing
19
+ * reads. Off in every preset: it is the only rule that scans the whole
20
+ * project from disk, so enabling it is a cost the user should opt into.
15
21
  *
16
22
  * Deliberately absent: unknown dictionary keys, unknown field paths and missing
17
23
  * required locales. The generated `__DictionaryRegistry` module augmentation
@@ -23,6 +29,7 @@ declare const rules: {
23
29
  'static-dictionary-key': IntlayerRule<[], "dynamicKey" | "dynamicTemplateKey" | "dynamicJsxKey">;
24
30
  'no-dynamic-field-access': IntlayerRule<[], "dynamicField" | "dynamicMessageId">;
25
31
  'enforce-adapter-import': IntlayerRule<[], "useAdapterImport">;
32
+ 'no-unused-content': IntlayerRule<[NoUnusedContentOptions?], "unusedDictionary" | "unusedField" | "duplicateDictionary">;
26
33
  };
27
34
  /** Rule names this plugin exposes. */
28
35
  type IntlayerRuleName = keyof typeof rules;
@@ -38,7 +45,7 @@ type IntlayerConfigName = 'recommended' | 'strict' | 'contract-only';
38
45
  * ```js
39
46
  * import intlayer from 'eslint-plugin-intlayer';
40
47
  *
41
- * export default [intlayer.configs.recommended];
48
+ * export default [...intlayer]; // or [...intlayer.configs.recommended]
42
49
  * ```
43
50
  *
44
51
  * - `recommended` — the compiler-contract rules as errors, plus `no-raw-text`
@@ -50,18 +57,24 @@ type IntlayerConfigName = 'recommended' | 'strict' | 'contract-only';
50
57
  * `enforce-adapter-import` is opt-in: importing from the original package is
51
58
  * perfectly valid once the bundler alias is set up, so a project that has done
52
59
  * that should not be nagged. Only `strict` turns it on.
60
+ *
61
+ * `no-unused-content` is in no preset at all, `strict` included. It reads the
62
+ * Intlayer configuration and walks the project's source files from disk, which
63
+ * is a different order of cost from the AST-only rules and depends on build
64
+ * output for its duplicate report — spreading a preset should never quietly
65
+ * turn that on.
53
66
  */
54
- declare const configs: Record<IntlayerConfigName, Linter.Config>;
67
+ declare const configs: Record<IntlayerConfigName, Linter.Config[]>;
55
68
  /** The plugin object, as consumed by `eslint.config.js`. */
56
- type IntlayerPlugin = ESLint.Plugin & {
69
+ type IntlayerPlugin = ESLint.Plugin & Iterable<Linter.Config> & {
57
70
  meta: {
58
71
  name: string;
59
72
  version: string;
60
73
  };
61
74
  rules: typeof rules;
62
- configs: Record<IntlayerConfigName, Linter.Config>;
75
+ configs: Record<IntlayerConfigName, Linter.Config[]>;
63
76
  };
64
77
  declare const intlayerPlugin: IntlayerPlugin;
65
78
  //#endregion
66
- export { IntlayerConfigName, IntlayerPlugin, IntlayerRuleName, type NoRawTextOptions, configs, intlayerPlugin as default, meta, rules };
79
+ export { GENERATED_OUTPUT_GLOBS, IntlayerConfigName, IntlayerPlugin, IntlayerRuleName, type NoRawTextOptions, type NoUnusedContentOptions, PLUGIN_NAMESPACE, PLUGIN_PACKAGE_NAME, RECOMMENDED_RULES, configs, intlayerPlugin as default, getReactVersion, getRecommendedRules, meta, rules };
67
80
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;cAwBa;+BAAA;;;;;;KAQD,gCAAgC;cAEtC;EAAQ;EAAc;;;KAQhB;;;;;;;;;;;;;;;;;;;;cAyCC,SAAS,OAAO,oBAAoB,OAAO;;KAiC5C,iBAAiB,OAAO;EAClC;IAAQ;IAAc;;EACtB,cAAc;EACd,SAAS,OAAO,oBAAoB,OAAO;;cAGvC,gBAAgB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../src/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;cA+Ba;+BAAA;;;;;;;KASD,gCAAgC;cAEtC;EAAQ;EAAc;;;KAQhB;;;;;;;;;;;;;;;;;;;;;;;;;;cA4DC,SAAS,OAAO,oBAAoB,OAAO;;KA2B5C,iBAAiB,OAAO,SAClC,SAAS,OAAO;EACd;IAAQ;IAAc;;EACtB,cAAc;EACd,SAAS,OAAO,oBAAoB,OAAO;;cAGzC,gBAAgB"}
@@ -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,SAAS;EACT,mBAAmB;EACnB,SAAS;EACT,UAAU;EACV,oBAAoB;EACpB,eAAe;EACf,WAAW;EACX,OAAO;EACP,YAAY;EACZ,iBAAiB;EACjB,oBAAoB;;KAGZ,OAAO,cAAc;UAEhB,gBAAgB;EAC7B;EACA;;UAGa;EACb;EACA,OAAO;EACP,KAAK;;UAGQ;;EAEb;;EAEA;;UAGa,gBAAgB;EAC7B;EACA;EACA,MAAM,MAAM,YAAY,YAAY;EACpC,WAAW;;UAGE,kBAAkB;EAC/B;EACA,YAAY;EACZ;;UAGa,qBAAqB;EAClC,QAAQ;EACR;EACA;;;;EAIA,MAAM,iBAAiB;;KAGf,WAAW,sBAAsB,qBAAqB;KAEtD,YACN,sBACA,iBACA,cACA,iBACA,oBACA,gBACA,kBACA,mBACA,iBACA,oBACA,cACA,kBACA,iBACA,eACA,iBACA,mBACA,eACA,iBACA,iBACA;UAEW,sBAAsB;UAEtB,uBAAuB;EACpC;;UAGa,uBAAuB;EACpC;EACA,MAAM;EACN,gBAAgB;;UAGH,oBAAoB,KAAK;EACtC;;UAGa,4BAA4B;EACzC;EACA,YAAY;;UAGC,oBAAoB;EACjC;EACA,MAAM;EACN,YAAY;EACZ,YAAY;;UAGC,yBAAyB;EACtC;EACA,OAAO;EACP,MAAM;;UAGO,uBAAuB;EACpC;EACA,QAAQ;;UAGK,0BAA0B;EACvC;EACA,QAAQ;;UAGK,sBAAsB;EACnC;EACA,QAAQ;EACR,MAAM;;UAGO,wBAAw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ACpB,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"}
@@ -1 +1 @@
1
- {"version":3,"file":"enforceAdapterImport.d.ts","names":[],"sources":["../../../src/rules/enforceAdapterImport.ts"],"mappings":";;cAuDa,sBAAA"}
1
+ {"version":3,"file":"enforceAdapterImport.d.ts","names":[],"sources":["../../../src/rules/enforceAdapterImport.ts"],"mappings":";;cA8Da,sBAAA"}