Skip to content

Commit f1c858e

Browse files
authored
chore: fix internal type references to Plugin and Rule (#19665)
1 parent 9736d5d commit f1c858e

7 files changed

Lines changed: 9 additions & 16 deletions

File tree

lib/cli-engine/cli-engine.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ const validFixTypes = new Set(["directive", "problem", "suggestion", "layout"]);
6363
/** @typedef {import("../shared/types").LintMessage} LintMessage */
6464
/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */
6565
/** @typedef {import("../shared/types").ParserOptions} ParserOptions */
66-
/** @typedef {import("../shared/types").Plugin} Plugin */
6766
/** @typedef {import("../shared/types").RuleConf} RuleConf */
6867
/** @typedef {import("../types").Rule.RuleModule} Rule */
6968
/** @typedef {import("../types").ESLint.FormatterFunction} FormatterFunction */
69+
/** @typedef {import("../types").ESLint.Plugin} Plugin */
7070
/** @typedef {ReturnType<CascadingConfigArrayFactory.getConfigArrayForFile>} ConfigArray */
7171
/** @typedef {ReturnType<ConfigArray.extractConfig>} ExtractedConfig */
7272

lib/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ const debug = require("debug")("eslint:cli");
4444
/** @typedef {import("./eslint/eslint").LintMessage} LintMessage */
4545
/** @typedef {import("./eslint/eslint").LintResult} LintResult */
4646
/** @typedef {import("./options").ParsedCLIOptions} ParsedCLIOptions */
47-
/** @typedef {import("./shared/types").Plugin} Plugin */
4847
/** @typedef {import("./shared/types").ResultsMeta} ResultsMeta */
48+
/** @typedef {import("./types").ESLint.Plugin} Plugin */
4949

5050
//------------------------------------------------------------------------------
5151
// Helpers

lib/eslint/eslint.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,11 @@ const { ConfigLoader, LegacyConfigLoader } = require("../config/config-loader");
5757
* @import { CLIEngineLintReport } from "./legacy-eslint.js";
5858
* @import { FlatConfigArray } from "../config/flat-config-array.js";
5959
* @import { RuleDefinition } from "@eslint/core";
60-
* @import { ConfigData, DeprecatedRuleInfo, LintMessage, LintResult, Plugin, ResultsMeta } from "../shared/types.js";
60+
* @import { ConfigData, DeprecatedRuleInfo, LintMessage, LintResult, ResultsMeta } from "../shared/types.js";
6161
*/
6262

6363
/** @typedef {ReturnType<ConfigArray.extractConfig>} ExtractedConfig */
64+
/** @typedef {import("../types").ESLint.Plugin} Plugin */
6465

6566
/**
6667
* The options with which to configure the ESLint instance.

lib/eslint/legacy-eslint.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ const { version } = require("../../package.json");
3434
/** @typedef {import("../shared/types").ConfigData} ConfigData */
3535
/** @typedef {import("../shared/types").LintMessage} LintMessage */
3636
/** @typedef {import("../shared/types").SuppressedLintMessage} SuppressedLintMessage */
37-
/** @typedef {import("../shared/types").Plugin} Plugin */
38-
/** @typedef {import("../types").Rule.RuleModule} Rule */
3937
/** @typedef {import("../shared/types").LintResult} LintResult */
4038
/** @typedef {import("../shared/types").ResultsMeta} ResultsMeta */
39+
/** @typedef {import("../types").ESLint.Plugin} Plugin */
40+
/** @typedef {import("../types").Rule.RuleModule} Rule */
4141

4242
/**
4343
* The main formatter object.

lib/rules/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
const { LazyLoadingRuleMap } = require("./utils/lazy-loading-rule-map");
1212

13-
/** @type {Map<string, import("../shared/types").Rule>} */
13+
/** @type {Map<string, import("../types").Rule.RuleModule>} */
1414
module.exports = new LazyLoadingRuleMap(
1515
Object.entries({
1616
"accessor-pairs": () => require("./accessor-pairs"),

lib/rules/utils/lazy-loading-rule-map.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
const debug = require("debug")("eslint:rules");
88

9-
/** @typedef {import("../../shared/types").Rule} Rule */
9+
/** @typedef {import("../../types").Rule.RuleModule} Rule */
1010

1111
/**
1212
* The `Map` object that loads each rule when it's accessed.
@@ -19,7 +19,7 @@ const debug = require("debug")("eslint:rules");
1919
*
2020
* rules.get("semi"); // call `() => require("semi")` here.
2121
*
22-
* @extends {Map<string, () => Rule>}
22+
* @extends {Map<string, Rule>}
2323
*/
2424
class LazyLoadingRuleMap extends Map {
2525
/**

lib/shared/types.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,6 @@ module.exports = {};
166166
* @property {{ name?: string, url?: string }} [rule] Name and information of the replacement rule
167167
*/
168168

169-
/**
170-
* @typedef {Object} Plugin
171-
* @property {Record<string, ConfigData>} [configs] The definition of plugin configs.
172-
* @property {Record<string, Environment>} [environments] The definition of plugin environments.
173-
* @property {Record<string, Processor>} [processors] The definition of plugin processors.
174-
* @property {Record<string, Rule>} [rules] The definition of plugin rules.
175-
*/
176-
177169
/**
178170
* Information of deprecated rules.
179171
* @typedef {Object} DeprecatedRuleInfo

0 commit comments

Comments
 (0)