@eslint/json 0.14.0 → 1.0.1

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.
@@ -1,280 +0,0 @@
1
- export type JSONOkParseResult = OkParseResult<DocumentNode>;
2
- export type JSONParseResult = ParseResult<DocumentNode>;
3
- export type JSONLanguageOptions = {
4
- /**
5
- * Whether to allow trailing commas in JSONC mode.
6
- */
7
- allowTrailingCommas?: boolean;
8
- };
9
- export type NoDuplicateKeysMessageIds = "duplicateKey";
10
- export type NoDuplicateKeysRuleDefinition = JSONRuleDefinition<{
11
- MessageIds: NoDuplicateKeysMessageIds;
12
- }>;
13
- export type NoEmptyKeysMessageIds = "emptyKey";
14
- export type NoEmptyKeysRuleDefinition = JSONRuleDefinition<{
15
- MessageIds: NoEmptyKeysMessageIds;
16
- }>;
17
- export type NoUnnormalizedKeysMessageIds = "unnormalizedKey";
18
- export type NoUnnormalizedKeysOptions = {
19
- form: string;
20
- };
21
- export type NoUnnormalizedKeysRuleDefinition = JSONRuleDefinition<{
22
- RuleOptions: [NoUnnormalizedKeysOptions];
23
- MessageIds: NoUnnormalizedKeysMessageIds;
24
- }>;
25
- export type NoUnsafeValuesMessageIds = "unsafeNumber" | "unsafeInteger" | "unsafeZero" | "subnormal" | "loneSurrogate";
26
- export type NoUnsafeValuesRuleDefinition = JSONRuleDefinition<{
27
- MessageIds: NoUnsafeValuesMessageIds;
28
- }>;
29
- export type SortOptions = {
30
- caseSensitive: boolean;
31
- natural: boolean;
32
- minKeys: number;
33
- allowLineSeparatedGroups: boolean;
34
- };
35
- export type SortKeysMessageIds = "sortKeys";
36
- export type SortDirection = "asc" | "desc";
37
- export type SortKeysRuleOptions = [SortDirection, SortOptions];
38
- export type SortKeysRuleDefinition = JSONRuleDefinition<{
39
- RuleOptions: SortKeysRuleOptions;
40
- MessageIds: SortKeysMessageIds;
41
- }>;
42
- export type Comparator = (a: string, b: string) => boolean;
43
- export type TopLevelInteropMessageIds = "topLevel";
44
- export type TopLevelInteropRuleDefinition = JSONRuleDefinition<{
45
- MessageIds: TopLevelInteropMessageIds;
46
- }>;
47
- /**
48
- * @fileoverview The JSONLanguage class.
49
- * @author Nicholas C. Zakas
50
- */
51
- /**
52
- *
53
- * @typedef {OkParseResult<DocumentNode>} JSONOkParseResult
54
- * @typedef {ParseResult<DocumentNode>} JSONParseResult
55
- *
56
- * @typedef {Object} JSONLanguageOptions
57
- * @property {boolean} [allowTrailingCommas] Whether to allow trailing commas in JSONC mode.
58
- */
59
- /**
60
- * JSON Language Object
61
- * @implements {Language<{ LangOptions: JSONLanguageOptions; Code: JSONSourceCode; RootNode: DocumentNode; Node: AnyNode }>}
62
- */
63
- export class JSONLanguage implements Language {
64
- /**
65
- * Creates a new instance.
66
- * @param {Object} options The options to use for this instance.
67
- * @param {"json"|"jsonc"|"json5"} options.mode The parser mode to use.
68
- */
69
- constructor({ mode }: {
70
- mode: "json" | "jsonc" | "json5";
71
- });
72
- /**
73
- * The type of file to read.
74
- * @type {"text"}
75
- */
76
- fileType: "text";
77
- /**
78
- * The line number at which the parser starts counting.
79
- * @type {0|1}
80
- */
81
- lineStart: 0 | 1;
82
- /**
83
- * The column number at which the parser starts counting.
84
- * @type {0|1}
85
- */
86
- columnStart: 0 | 1;
87
- /**
88
- * The name of the key that holds the type of the node.
89
- * @type {string}
90
- */
91
- nodeTypeKey: string;
92
- /**
93
- * The visitor keys.
94
- * @type {Record<string, string[]>}
95
- */
96
- visitorKeys: Record<string, string[]>;
97
- /**
98
- * Validates the language options.
99
- * @param {JSONLanguageOptions} languageOptions The language options to validate.
100
- * @returns {void}
101
- * @throws {Error} When the language options are invalid.
102
- */
103
- validateLanguageOptions(languageOptions: JSONLanguageOptions): void;
104
- /**
105
- * Parses the given file into an AST.
106
- * @param {File} file The virtual file to parse.
107
- * @param {{languageOptions: JSONLanguageOptions}} context The options to use for parsing.
108
- * @returns {JSONParseResult} The result of parsing.
109
- */
110
- parse(file: File, context: {
111
- languageOptions: JSONLanguageOptions;
112
- }): JSONParseResult;
113
- /**
114
- * Creates a new `JSONSourceCode` object from the given information.
115
- * @param {File} file The virtual file to create a `JSONSourceCode` object from.
116
- * @param {JSONOkParseResult} parseResult The result returned from `parse()`.
117
- * @returns {JSONSourceCode} The new `JSONSourceCode` object.
118
- */
119
- createSourceCode(file: File, parseResult: JSONOkParseResult): JSONSourceCode;
120
- #private;
121
- }
122
- /**
123
- * JSON Source Code Object
124
- * @extends {TextSourceCodeBase<{LangOptions: JSONLanguageOptions, RootNode: DocumentNode, SyntaxElementWithLoc: JSONSyntaxElement, ConfigNode: Token}>}
125
- */
126
- export class JSONSourceCode extends TextSourceCodeBase<{
127
- LangOptions: JSONLanguageOptions;
128
- RootNode: DocumentNode;
129
- SyntaxElementWithLoc: JSONSyntaxElement;
130
- ConfigNode: Token;
131
- }> {
132
- /**
133
- * Creates a new instance.
134
- * @param {Object} options The options for the instance.
135
- * @param {string} options.text The source code text.
136
- * @param {DocumentNode} options.ast The root AST node.
137
- */
138
- constructor({ text, ast }: {
139
- text: string;
140
- ast: DocumentNode;
141
- });
142
- /**
143
- * The comment tokens in the source code.
144
- * @type {Array<Token>|undefined}
145
- */
146
- comments: Array<Token> | undefined;
147
- /**
148
- * Returns an array of all inline configuration nodes found in the
149
- * source code.
150
- * @returns {Array<Token>} An array of all inline configuration nodes.
151
- */
152
- getInlineConfigNodes(): Array<Token>;
153
- /**
154
- * Returns directives that enable or disable rules along with any problems
155
- * encountered while parsing the directives.
156
- * @returns {{problems:Array<FileProblem>,directives:Array<Directive>}} Information
157
- * that ESLint needs to further process the directives.
158
- */
159
- getDisableDirectives(): {
160
- problems: Array<FileProblem>;
161
- directives: Array<Directive>;
162
- };
163
- /**
164
- * Returns inline rule configurations along with any problems
165
- * encountered while parsing the configurations.
166
- * @returns {{problems:Array<FileProblem>,configs:Array<{config:{rules:RulesConfig},loc:LocationRange}>}} Information
167
- * that ESLint needs to further process the rule configurations.
168
- */
169
- applyInlineConfig(): {
170
- problems: Array<FileProblem>;
171
- configs: Array<{
172
- config: {
173
- rules: RulesConfig;
174
- };
175
- loc: LocationRange;
176
- }>;
177
- };
178
- /**
179
- * Returns the parent of the given node.
180
- * @param {AnyNode} node The node to get the parent of.
181
- * @returns {AnyNode|undefined} The parent of the node.
182
- */
183
- getParent(node: AnyNode): AnyNode | undefined;
184
- /**
185
- * Traverse the source code and return the steps that were taken.
186
- * @returns {Iterable<JSONTraversalStep>} The steps that were taken while traversing the source code.
187
- */
188
- traverse(): Iterable<JSONTraversalStep>;
189
- /**
190
- * Gets the token before the given node or token, optionally including comments.
191
- * @param {AnyNode|Token} nodeOrToken The node or token to get the previous token for.
192
- * @param {Object} [options] Options object.
193
- * @param {boolean} [options.includeComments] If true, return comments when they are present.
194
- * @returns {Token|null} The previous token or comment, or null if there is none.
195
- */
196
- getTokenBefore(nodeOrToken: AnyNode | Token, { includeComments }?: {
197
- includeComments?: boolean;
198
- }): Token | null;
199
- /**
200
- * Gets the token after the given node or token, skipping any comments unless includeComments is true.
201
- * @param {AnyNode|Token} nodeOrToken The node or token to get the next token for.
202
- * @param {Object} [options] Options object.
203
- * @param {boolean} [options.includeComments=false] If true, return comments when they are present.
204
- * @returns {Token|null} The next token or comment, or null if there is none.
205
- */
206
- getTokenAfter(nodeOrToken: AnyNode | Token, { includeComments }?: {
207
- includeComments?: boolean;
208
- }): Token | null;
209
- #private;
210
- }
211
- declare namespace plugin {
212
- export namespace meta {
213
- let name: string;
214
- let version: string;
215
- }
216
- export namespace languages {
217
- let json: JSONLanguage;
218
- let jsonc: JSONLanguage;
219
- let json5: JSONLanguage;
220
- }
221
- export { rules };
222
- export namespace configs {
223
- namespace recommended {
224
- export let plugins: {};
225
- export { rules$1 as rules };
226
- }
227
- }
228
- }
229
- import type { DocumentNode } from "@humanwhocodes/momoa";
230
- import type { OkParseResult } from "@eslint/core";
231
- import type { ParseResult } from "@eslint/core";
232
- import type { JSONRuleDefinition } from "./types.cts";
233
- import type { Language } from "@eslint/core";
234
- import type { File } from "@eslint/core";
235
- import type { JSONSyntaxElement } from "./types.cts";
236
- import type { Token } from "@humanwhocodes/momoa";
237
- import { TextSourceCodeBase } from '@eslint/plugin-kit';
238
- import type { FileProblem } from "@eslint/core";
239
- import { Directive } from '@eslint/plugin-kit';
240
- import type { RulesConfig } from "@eslint/core";
241
- import type { LocationRange } from "@humanwhocodes/momoa";
242
- import type { AnyNode } from "@humanwhocodes/momoa";
243
- /**
244
- * A class to represent a step in the traversal process.
245
- */
246
- declare class JSONTraversalStep extends VisitNodeStep {
247
- /**
248
- * Creates a new instance.
249
- * @param {Object} options The options for the step.
250
- * @param {AnyNode} options.target The target of the step.
251
- * @param {1|2} options.phase The phase of the step.
252
- * @param {Array<any>} options.args The arguments of the step.
253
- */
254
- constructor({ target, phase, args }: {
255
- target: AnyNode;
256
- phase: 1 | 2;
257
- args: Array<any>;
258
- });
259
- /**
260
- * The target of the step.
261
- * @type {AnyNode}
262
- */
263
- target: AnyNode;
264
- }
265
- declare var rules: {
266
- "no-duplicate-keys": NoDuplicateKeysRuleDefinition;
267
- "no-empty-keys": NoEmptyKeysRuleDefinition;
268
- "no-unnormalized-keys": NoUnnormalizedKeysRuleDefinition;
269
- "no-unsafe-values": NoUnsafeValuesRuleDefinition;
270
- "sort-keys": SortKeysRuleDefinition;
271
- "top-level-interop": TopLevelInteropRuleDefinition;
272
- };
273
- declare const rules$1: {
274
- readonly "json/no-duplicate-keys": "error";
275
- readonly "json/no-empty-keys": "error";
276
- readonly "json/no-unnormalized-keys": "error";
277
- readonly "json/no-unsafe-values": "error";
278
- };
279
- import { VisitNodeStep } from '@eslint/plugin-kit';
280
- export { plugin as default };
@@ -1,87 +0,0 @@
1
- /**
2
- * @fileoverview Additional types for this package.
3
- * @author Nicholas C. Zakas
4
- */
5
-
6
- //------------------------------------------------------------------------------
7
- // Imports
8
- //------------------------------------------------------------------------------
9
-
10
- import type {
11
- CustomRuleDefinitionType,
12
- CustomRuleTypeDefinitions,
13
- RuleVisitor,
14
- } from "@eslint/core";
15
- import type {
16
- DocumentNode,
17
- MemberNode,
18
- ElementNode,
19
- ObjectNode,
20
- ArrayNode,
21
- StringNode,
22
- NullNode,
23
- NumberNode,
24
- BooleanNode,
25
- NaNNode,
26
- InfinityNode,
27
- IdentifierNode,
28
- AnyNode,
29
- Token,
30
- } from "@humanwhocodes/momoa";
31
- import type { JSONLanguageOptions, JSONSourceCode } from "./index.cjs";
32
-
33
- //------------------------------------------------------------------------------
34
- // Types
35
- //------------------------------------------------------------------------------
36
-
37
- type ValueNodeParent = DocumentNode | MemberNode | ElementNode;
38
-
39
- /**
40
- * A JSON syntax element, including nodes and tokens.
41
- */
42
- export type JSONSyntaxElement = Token | AnyNode;
43
-
44
- /**
45
- * The visitor format returned from rules in this package.
46
- */
47
- export interface JSONRuleVisitor extends RuleVisitor {
48
- Document?(node: DocumentNode): void;
49
- Member?(node: MemberNode, parent?: ObjectNode): void;
50
- Element?(node: ElementNode, parent?: ArrayNode): void;
51
- Object?(node: ObjectNode, parent?: ValueNodeParent): void;
52
- Array?(node: ArrayNode, parent?: ValueNodeParent): void;
53
- String?(node: StringNode, parent?: ValueNodeParent): void;
54
- Null?(node: NullNode, parent?: ValueNodeParent): void;
55
- Number?(node: NumberNode, parent?: ValueNodeParent): void;
56
- Boolean?(node: BooleanNode, parent?: ValueNodeParent): void;
57
- NaN?(node: NaNNode, parent?: ValueNodeParent): void;
58
- Infinity?(node: InfinityNode, parent?: ValueNodeParent): void;
59
- Identifier?(node: IdentifierNode, parent?: ValueNodeParent): void;
60
-
61
- "Document:exit"?(node: DocumentNode): void;
62
- "Member:exit"?(node: MemberNode, parent?: ObjectNode): void;
63
- "Element:exit"?(node: ElementNode, parent?: ArrayNode): void;
64
- "Object:exit"?(node: ObjectNode, parent?: ValueNodeParent): void;
65
- "Array:exit"?(node: ArrayNode, parent?: ValueNodeParent): void;
66
- "String:exit"?(node: StringNode, parent?: ValueNodeParent): void;
67
- "Null:exit"?(node: NullNode, parent?: ValueNodeParent): void;
68
- "Number:exit"?(node: NumberNode, parent?: ValueNodeParent): void;
69
- "Boolean:exit"?(node: BooleanNode, parent?: ValueNodeParent): void;
70
- "NaN:exit"?(node: NaNNode, parent?: ValueNodeParent): void;
71
- "Infinity:exit"?(node: InfinityNode, parent?: ValueNodeParent): void;
72
- "Identifier:exit"?(node: IdentifierNode, parent?: ValueNodeParent): void;
73
- }
74
-
75
- export type JSONRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;
76
-
77
- export type JSONRuleDefinition<
78
- Options extends Partial<JSONRuleDefinitionTypeOptions> = {},
79
- > = CustomRuleDefinitionType<
80
- {
81
- LangOptions: JSONLanguageOptions;
82
- Code: JSONSourceCode;
83
- Visitor: JSONRuleVisitor;
84
- Node: AnyNode;
85
- },
86
- Options
87
- >;
@@ -1,280 +0,0 @@
1
- export type JSONOkParseResult = OkParseResult<DocumentNode>;
2
- export type JSONParseResult = ParseResult<DocumentNode>;
3
- export type JSONLanguageOptions = {
4
- /**
5
- * Whether to allow trailing commas in JSONC mode.
6
- */
7
- allowTrailingCommas?: boolean;
8
- };
9
- export type NoDuplicateKeysMessageIds = "duplicateKey";
10
- export type NoDuplicateKeysRuleDefinition = JSONRuleDefinition<{
11
- MessageIds: NoDuplicateKeysMessageIds;
12
- }>;
13
- export type NoEmptyKeysMessageIds = "emptyKey";
14
- export type NoEmptyKeysRuleDefinition = JSONRuleDefinition<{
15
- MessageIds: NoEmptyKeysMessageIds;
16
- }>;
17
- export type NoUnnormalizedKeysMessageIds = "unnormalizedKey";
18
- export type NoUnnormalizedKeysOptions = {
19
- form: string;
20
- };
21
- export type NoUnnormalizedKeysRuleDefinition = JSONRuleDefinition<{
22
- RuleOptions: [NoUnnormalizedKeysOptions];
23
- MessageIds: NoUnnormalizedKeysMessageIds;
24
- }>;
25
- export type NoUnsafeValuesMessageIds = "unsafeNumber" | "unsafeInteger" | "unsafeZero" | "subnormal" | "loneSurrogate";
26
- export type NoUnsafeValuesRuleDefinition = JSONRuleDefinition<{
27
- MessageIds: NoUnsafeValuesMessageIds;
28
- }>;
29
- export type SortOptions = {
30
- caseSensitive: boolean;
31
- natural: boolean;
32
- minKeys: number;
33
- allowLineSeparatedGroups: boolean;
34
- };
35
- export type SortKeysMessageIds = "sortKeys";
36
- export type SortDirection = "asc" | "desc";
37
- export type SortKeysRuleOptions = [SortDirection, SortOptions];
38
- export type SortKeysRuleDefinition = JSONRuleDefinition<{
39
- RuleOptions: SortKeysRuleOptions;
40
- MessageIds: SortKeysMessageIds;
41
- }>;
42
- export type Comparator = (a: string, b: string) => boolean;
43
- export type TopLevelInteropMessageIds = "topLevel";
44
- export type TopLevelInteropRuleDefinition = JSONRuleDefinition<{
45
- MessageIds: TopLevelInteropMessageIds;
46
- }>;
47
- /**
48
- * @fileoverview The JSONLanguage class.
49
- * @author Nicholas C. Zakas
50
- */
51
- /**
52
- *
53
- * @typedef {OkParseResult<DocumentNode>} JSONOkParseResult
54
- * @typedef {ParseResult<DocumentNode>} JSONParseResult
55
- *
56
- * @typedef {Object} JSONLanguageOptions
57
- * @property {boolean} [allowTrailingCommas] Whether to allow trailing commas in JSONC mode.
58
- */
59
- /**
60
- * JSON Language Object
61
- * @implements {Language<{ LangOptions: JSONLanguageOptions; Code: JSONSourceCode; RootNode: DocumentNode; Node: AnyNode }>}
62
- */
63
- export class JSONLanguage implements Language {
64
- /**
65
- * Creates a new instance.
66
- * @param {Object} options The options to use for this instance.
67
- * @param {"json"|"jsonc"|"json5"} options.mode The parser mode to use.
68
- */
69
- constructor({ mode }: {
70
- mode: "json" | "jsonc" | "json5";
71
- });
72
- /**
73
- * The type of file to read.
74
- * @type {"text"}
75
- */
76
- fileType: "text";
77
- /**
78
- * The line number at which the parser starts counting.
79
- * @type {0|1}
80
- */
81
- lineStart: 0 | 1;
82
- /**
83
- * The column number at which the parser starts counting.
84
- * @type {0|1}
85
- */
86
- columnStart: 0 | 1;
87
- /**
88
- * The name of the key that holds the type of the node.
89
- * @type {string}
90
- */
91
- nodeTypeKey: string;
92
- /**
93
- * The visitor keys.
94
- * @type {Record<string, string[]>}
95
- */
96
- visitorKeys: Record<string, string[]>;
97
- /**
98
- * Validates the language options.
99
- * @param {JSONLanguageOptions} languageOptions The language options to validate.
100
- * @returns {void}
101
- * @throws {Error} When the language options are invalid.
102
- */
103
- validateLanguageOptions(languageOptions: JSONLanguageOptions): void;
104
- /**
105
- * Parses the given file into an AST.
106
- * @param {File} file The virtual file to parse.
107
- * @param {{languageOptions: JSONLanguageOptions}} context The options to use for parsing.
108
- * @returns {JSONParseResult} The result of parsing.
109
- */
110
- parse(file: File, context: {
111
- languageOptions: JSONLanguageOptions;
112
- }): JSONParseResult;
113
- /**
114
- * Creates a new `JSONSourceCode` object from the given information.
115
- * @param {File} file The virtual file to create a `JSONSourceCode` object from.
116
- * @param {JSONOkParseResult} parseResult The result returned from `parse()`.
117
- * @returns {JSONSourceCode} The new `JSONSourceCode` object.
118
- */
119
- createSourceCode(file: File, parseResult: JSONOkParseResult): JSONSourceCode;
120
- #private;
121
- }
122
- /**
123
- * JSON Source Code Object
124
- * @extends {TextSourceCodeBase<{LangOptions: JSONLanguageOptions, RootNode: DocumentNode, SyntaxElementWithLoc: JSONSyntaxElement, ConfigNode: Token}>}
125
- */
126
- export class JSONSourceCode extends TextSourceCodeBase<{
127
- LangOptions: JSONLanguageOptions;
128
- RootNode: DocumentNode;
129
- SyntaxElementWithLoc: JSONSyntaxElement;
130
- ConfigNode: Token;
131
- }> {
132
- /**
133
- * Creates a new instance.
134
- * @param {Object} options The options for the instance.
135
- * @param {string} options.text The source code text.
136
- * @param {DocumentNode} options.ast The root AST node.
137
- */
138
- constructor({ text, ast }: {
139
- text: string;
140
- ast: DocumentNode;
141
- });
142
- /**
143
- * The comment tokens in the source code.
144
- * @type {Array<Token>|undefined}
145
- */
146
- comments: Array<Token> | undefined;
147
- /**
148
- * Returns an array of all inline configuration nodes found in the
149
- * source code.
150
- * @returns {Array<Token>} An array of all inline configuration nodes.
151
- */
152
- getInlineConfigNodes(): Array<Token>;
153
- /**
154
- * Returns directives that enable or disable rules along with any problems
155
- * encountered while parsing the directives.
156
- * @returns {{problems:Array<FileProblem>,directives:Array<Directive>}} Information
157
- * that ESLint needs to further process the directives.
158
- */
159
- getDisableDirectives(): {
160
- problems: Array<FileProblem>;
161
- directives: Array<Directive>;
162
- };
163
- /**
164
- * Returns inline rule configurations along with any problems
165
- * encountered while parsing the configurations.
166
- * @returns {{problems:Array<FileProblem>,configs:Array<{config:{rules:RulesConfig},loc:LocationRange}>}} Information
167
- * that ESLint needs to further process the rule configurations.
168
- */
169
- applyInlineConfig(): {
170
- problems: Array<FileProblem>;
171
- configs: Array<{
172
- config: {
173
- rules: RulesConfig;
174
- };
175
- loc: LocationRange;
176
- }>;
177
- };
178
- /**
179
- * Returns the parent of the given node.
180
- * @param {AnyNode} node The node to get the parent of.
181
- * @returns {AnyNode|undefined} The parent of the node.
182
- */
183
- getParent(node: AnyNode): AnyNode | undefined;
184
- /**
185
- * Traverse the source code and return the steps that were taken.
186
- * @returns {Iterable<JSONTraversalStep>} The steps that were taken while traversing the source code.
187
- */
188
- traverse(): Iterable<JSONTraversalStep>;
189
- /**
190
- * Gets the token before the given node or token, optionally including comments.
191
- * @param {AnyNode|Token} nodeOrToken The node or token to get the previous token for.
192
- * @param {Object} [options] Options object.
193
- * @param {boolean} [options.includeComments] If true, return comments when they are present.
194
- * @returns {Token|null} The previous token or comment, or null if there is none.
195
- */
196
- getTokenBefore(nodeOrToken: AnyNode | Token, { includeComments }?: {
197
- includeComments?: boolean;
198
- }): Token | null;
199
- /**
200
- * Gets the token after the given node or token, skipping any comments unless includeComments is true.
201
- * @param {AnyNode|Token} nodeOrToken The node or token to get the next token for.
202
- * @param {Object} [options] Options object.
203
- * @param {boolean} [options.includeComments=false] If true, return comments when they are present.
204
- * @returns {Token|null} The next token or comment, or null if there is none.
205
- */
206
- getTokenAfter(nodeOrToken: AnyNode | Token, { includeComments }?: {
207
- includeComments?: boolean;
208
- }): Token | null;
209
- #private;
210
- }
211
- declare namespace plugin {
212
- export namespace meta {
213
- let name: string;
214
- let version: string;
215
- }
216
- export namespace languages {
217
- let json: JSONLanguage;
218
- let jsonc: JSONLanguage;
219
- let json5: JSONLanguage;
220
- }
221
- export { rules };
222
- export namespace configs {
223
- namespace recommended {
224
- export let plugins: {};
225
- export { rules$1 as rules };
226
- }
227
- }
228
- }
229
- import type { DocumentNode } from "@humanwhocodes/momoa";
230
- import type { OkParseResult } from "@eslint/core";
231
- import type { ParseResult } from "@eslint/core";
232
- import type { JSONRuleDefinition } from "./types.ts";
233
- import type { Language } from "@eslint/core";
234
- import type { File } from "@eslint/core";
235
- import type { JSONSyntaxElement } from "./types.ts";
236
- import type { Token } from "@humanwhocodes/momoa";
237
- import { TextSourceCodeBase } from '@eslint/plugin-kit';
238
- import type { FileProblem } from "@eslint/core";
239
- import { Directive } from '@eslint/plugin-kit';
240
- import type { RulesConfig } from "@eslint/core";
241
- import type { LocationRange } from "@humanwhocodes/momoa";
242
- import type { AnyNode } from "@humanwhocodes/momoa";
243
- /**
244
- * A class to represent a step in the traversal process.
245
- */
246
- declare class JSONTraversalStep extends VisitNodeStep {
247
- /**
248
- * Creates a new instance.
249
- * @param {Object} options The options for the step.
250
- * @param {AnyNode} options.target The target of the step.
251
- * @param {1|2} options.phase The phase of the step.
252
- * @param {Array<any>} options.args The arguments of the step.
253
- */
254
- constructor({ target, phase, args }: {
255
- target: AnyNode;
256
- phase: 1 | 2;
257
- args: Array<any>;
258
- });
259
- /**
260
- * The target of the step.
261
- * @type {AnyNode}
262
- */
263
- target: AnyNode;
264
- }
265
- declare var rules: {
266
- "no-duplicate-keys": NoDuplicateKeysRuleDefinition;
267
- "no-empty-keys": NoEmptyKeysRuleDefinition;
268
- "no-unnormalized-keys": NoUnnormalizedKeysRuleDefinition;
269
- "no-unsafe-values": NoUnsafeValuesRuleDefinition;
270
- "sort-keys": SortKeysRuleDefinition;
271
- "top-level-interop": TopLevelInteropRuleDefinition;
272
- };
273
- declare const rules$1: {
274
- readonly "json/no-duplicate-keys": "error";
275
- readonly "json/no-empty-keys": "error";
276
- readonly "json/no-unnormalized-keys": "error";
277
- readonly "json/no-unsafe-values": "error";
278
- };
279
- import { VisitNodeStep } from '@eslint/plugin-kit';
280
- export { plugin as default };