@eslint/json 0.13.0 → 0.13.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.
package/README.md CHANGED
@@ -292,8 +292,7 @@ Apache 2.0
292
292
  The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
293
293
  to get your logo on our READMEs and [website](https://eslint.org/sponsors).
294
294
 
295
- <h3>Diamond Sponsors</h3>
296
- <p><a href="https://www.ag-grid.com/"><img src="https://images.opencollective.com/ag-grid/bec0580/logo.png" alt="AG Grid" height="128"></a></p><h3>Platinum Sponsors</h3>
295
+ <h3>Platinum Sponsors</h3>
297
296
  <p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a> <a href="https://www.airbnb.com/"><img src="https://images.opencollective.com/airbnb/d327d66/logo.png" alt="Airbnb" height="128"></a></p><h3>Gold Sponsors</h3>
298
297
  <p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://trunk.io/"><img src="https://images.opencollective.com/trunkio/fb92d60/avatar.png" alt="trunk.io" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
299
298
  <p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/e6d15e1/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/5c4fa84/logo.png" alt="Liftoff" height="64"></a> <a href="https://americanexpress.io"><img src="https://avatars.githubusercontent.com/u/3853301" alt="American Express" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
@@ -196,7 +196,9 @@ class JSONSourceCode extends pluginKit.TextSourceCodeBase {
196
196
  * that ESLint needs to further process the directives.
197
197
  */
198
198
  getDisableDirectives() {
199
+ /** @type {Array<FileProblem>} */
199
200
  const problems = [];
201
+ /** @type {Array<Directive>} */
200
202
  const directives = [];
201
203
 
202
204
  this.getInlineConfigNodes().forEach(comment => {
@@ -249,7 +251,9 @@ class JSONSourceCode extends pluginKit.TextSourceCodeBase {
249
251
  * that ESLint needs to further process the rule configurations.
250
252
  */
251
253
  applyInlineConfig() {
254
+ /** @type {Array<FileProblem>} */
252
255
  const problems = [];
256
+ /** @type {Array<{config:{rules:RulesConfig},loc:SourceLocation}>} */
253
257
  const configs = [];
254
258
 
255
259
  this.getInlineConfigNodes().forEach(comment => {
@@ -1238,7 +1242,7 @@ var rules = {
1238
1242
  const plugin = {
1239
1243
  meta: {
1240
1244
  name: "@eslint/json",
1241
- version: "0.13.0", // x-release-please-version
1245
+ version: "0.13.1", // x-release-please-version
1242
1246
  },
1243
1247
  languages: {
1244
1248
  json: new JSONLanguage({ mode: "json" }),
@@ -7,7 +7,11 @@
7
7
  // Imports
8
8
  //------------------------------------------------------------------------------
9
9
 
10
- import type { RuleVisitor, RuleDefinition } from "@eslint/core";
10
+ import type {
11
+ CustomRuleDefinitionType,
12
+ CustomRuleTypeDefinitions,
13
+ RuleVisitor,
14
+ } from "@eslint/core";
11
15
  import type {
12
16
  DocumentNode,
13
17
  MemberNode,
@@ -68,25 +72,16 @@ export interface JSONRuleVisitor extends RuleVisitor {
68
72
  "Identifier:exit"?(node: IdentifierNode, parent?: ValueNodeParent): void;
69
73
  }
70
74
 
71
- export type JSONRuleDefinitionTypeOptions = {
72
- RuleOptions: unknown[];
73
- MessageIds: string;
74
- ExtRuleDocs: Record<string, unknown>;
75
- };
75
+ export type JSONRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;
76
76
 
77
77
  export type JSONRuleDefinition<
78
78
  Options extends Partial<JSONRuleDefinitionTypeOptions> = {},
79
- > = RuleDefinition<
80
- // Language specific type options (non-configurable)
79
+ > = CustomRuleDefinitionType<
81
80
  {
82
81
  LangOptions: JSONLanguageOptions;
83
82
  Code: JSONSourceCode;
84
83
  Visitor: JSONRuleVisitor;
85
84
  Node: AnyNode;
86
- } & Required<
87
- // Rule specific type options (custom)
88
- Options &
89
- // Rule specific type options (defaults)
90
- Omit<JSONRuleDefinitionTypeOptions, keyof Options>
91
- >
85
+ },
86
+ Options
92
87
  >;
package/dist/esm/index.js CHANGED
@@ -193,7 +193,9 @@ class JSONSourceCode extends TextSourceCodeBase {
193
193
  * that ESLint needs to further process the directives.
194
194
  */
195
195
  getDisableDirectives() {
196
+ /** @type {Array<FileProblem>} */
196
197
  const problems = [];
198
+ /** @type {Array<Directive>} */
197
199
  const directives = [];
198
200
 
199
201
  this.getInlineConfigNodes().forEach(comment => {
@@ -246,7 +248,9 @@ class JSONSourceCode extends TextSourceCodeBase {
246
248
  * that ESLint needs to further process the rule configurations.
247
249
  */
248
250
  applyInlineConfig() {
251
+ /** @type {Array<FileProblem>} */
249
252
  const problems = [];
253
+ /** @type {Array<{config:{rules:RulesConfig},loc:SourceLocation}>} */
250
254
  const configs = [];
251
255
 
252
256
  this.getInlineConfigNodes().forEach(comment => {
@@ -1235,7 +1239,7 @@ var rules = {
1235
1239
  const plugin = {
1236
1240
  meta: {
1237
1241
  name: "@eslint/json",
1238
- version: "0.13.0", // x-release-please-version
1242
+ version: "0.13.1", // x-release-please-version
1239
1243
  },
1240
1244
  languages: {
1241
1245
  json: new JSONLanguage({ mode: "json" }),
@@ -2,7 +2,7 @@
2
2
  * @fileoverview Additional types for this package.
3
3
  * @author Nicholas C. Zakas
4
4
  */
5
- import type { RuleVisitor, RuleDefinition } from "@eslint/core";
5
+ import type { CustomRuleDefinitionType, CustomRuleTypeDefinitions, RuleVisitor } from "@eslint/core";
6
6
  import type { DocumentNode, MemberNode, ElementNode, ObjectNode, ArrayNode, StringNode, NullNode, NumberNode, BooleanNode, NaNNode, InfinityNode, IdentifierNode, AnyNode, Token } from "@humanwhocodes/momoa";
7
7
  import type { JSONLanguageOptions, JSONSourceCode } from "./index.js";
8
8
  type ValueNodeParent = DocumentNode | MemberNode | ElementNode;
@@ -39,15 +39,11 @@ export interface JSONRuleVisitor extends RuleVisitor {
39
39
  "Infinity:exit"?(node: InfinityNode, parent?: ValueNodeParent): void;
40
40
  "Identifier:exit"?(node: IdentifierNode, parent?: ValueNodeParent): void;
41
41
  }
42
- export type JSONRuleDefinitionTypeOptions = {
43
- RuleOptions: unknown[];
44
- MessageIds: string;
45
- ExtRuleDocs: Record<string, unknown>;
46
- };
47
- export type JSONRuleDefinition<Options extends Partial<JSONRuleDefinitionTypeOptions> = {}> = RuleDefinition<{
42
+ export type JSONRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;
43
+ export type JSONRuleDefinition<Options extends Partial<JSONRuleDefinitionTypeOptions> = {}> = CustomRuleDefinitionType<{
48
44
  LangOptions: JSONLanguageOptions;
49
45
  Code: JSONSourceCode;
50
46
  Visitor: JSONRuleVisitor;
51
47
  Node: AnyNode;
52
- } & Required<Options & Omit<JSONRuleDefinitionTypeOptions, keyof Options>>>;
48
+ }, Options>;
53
49
  export {};
package/dist/esm/types.ts CHANGED
@@ -7,7 +7,11 @@
7
7
  // Imports
8
8
  //------------------------------------------------------------------------------
9
9
 
10
- import type { RuleVisitor, RuleDefinition } from "@eslint/core";
10
+ import type {
11
+ CustomRuleDefinitionType,
12
+ CustomRuleTypeDefinitions,
13
+ RuleVisitor,
14
+ } from "@eslint/core";
11
15
  import type {
12
16
  DocumentNode,
13
17
  MemberNode,
@@ -68,25 +72,16 @@ export interface JSONRuleVisitor extends RuleVisitor {
68
72
  "Identifier:exit"?(node: IdentifierNode, parent?: ValueNodeParent): void;
69
73
  }
70
74
 
71
- export type JSONRuleDefinitionTypeOptions = {
72
- RuleOptions: unknown[];
73
- MessageIds: string;
74
- ExtRuleDocs: Record<string, unknown>;
75
- };
75
+ export type JSONRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;
76
76
 
77
77
  export type JSONRuleDefinition<
78
78
  Options extends Partial<JSONRuleDefinitionTypeOptions> = {},
79
- > = RuleDefinition<
80
- // Language specific type options (non-configurable)
79
+ > = CustomRuleDefinitionType<
81
80
  {
82
81
  LangOptions: JSONLanguageOptions;
83
82
  Code: JSONSourceCode;
84
83
  Visitor: JSONRuleVisitor;
85
84
  Node: AnyNode;
86
- } & Required<
87
- // Rule specific type options (custom)
88
- Options &
89
- // Rule specific type options (defaults)
90
- Omit<JSONRuleDefinitionTypeOptions, keyof Options>
91
- >
85
+ },
86
+ Options
92
87
  >;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eslint/json",
3
- "version": "0.13.0",
3
+ "version": "0.13.1",
4
4
  "description": "JSON linting plugin for ESLint",
5
5
  "author": "Nicholas C. Zakas",
6
6
  "type": "module",
@@ -83,15 +83,15 @@
83
83
  ],
84
84
  "license": "Apache-2.0",
85
85
  "dependencies": {
86
- "@eslint/core": "^0.14.0",
87
- "@eslint/plugin-kit": "^0.3.1",
88
- "@humanwhocodes/momoa": "^3.3.4",
86
+ "@eslint/core": "^0.15.1",
87
+ "@eslint/plugin-kit": "^0.3.4",
88
+ "@humanwhocodes/momoa": "^3.3.8",
89
89
  "natural-compare": "^1.4.0"
90
90
  },
91
91
  "devDependencies": {
92
92
  "c8": "^10.1.3",
93
93
  "dedent": "^1.5.3",
94
- "eslint": "^9.25.1",
94
+ "eslint": "^9.31.0",
95
95
  "eslint-config-eslint": "^11.0.0",
96
96
  "eslint-plugin-eslint-plugin": "^6.3.2",
97
97
  "got": "^14.4.2",