@typescript-eslint/utils 7.0.0-alpha.0 → 7.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.
- package/dist/ast-utils/helpers.d.ts +39 -15
- package/dist/ast-utils/helpers.d.ts.map +1 -1
- package/dist/ast-utils/predicates.d.ts +1 -1
- package/dist/ast-utils/predicates.d.ts.map +1 -1
- package/dist/eslint-utils/InferTypesFromRule.d.ts.map +1 -1
- package/dist/eslint-utils/RuleCreator.d.ts +1 -1
- package/dist/eslint-utils/RuleCreator.d.ts.map +1 -1
- package/dist/eslint-utils/RuleCreator.js.map +1 -1
- package/dist/eslint-utils/applyDefault.js.map +1 -1
- package/dist/eslint-utils/context.d.ts +16 -0
- package/dist/eslint-utils/context.d.ts.map +1 -0
- package/dist/eslint-utils/context.js +34 -0
- package/dist/eslint-utils/context.js.map +1 -0
- package/dist/eslint-utils/deepMerge.js +1 -1
- package/dist/eslint-utils/deepMerge.js.map +1 -1
- package/dist/eslint-utils/getParserServices.d.ts.map +1 -1
- package/dist/eslint-utils/getParserServices.js +18 -7
- package/dist/eslint-utils/getParserServices.js.map +1 -1
- package/dist/eslint-utils/nullThrows.d.ts +1 -1
- package/dist/eslint-utils/nullThrows.d.ts.map +1 -1
- package/dist/eslint-utils/nullThrows.js.map +1 -1
- package/dist/eslint-utils/parserPathSeemsToBeTSESLint.d.ts +2 -0
- package/dist/eslint-utils/parserPathSeemsToBeTSESLint.d.ts.map +1 -0
- package/dist/eslint-utils/parserPathSeemsToBeTSESLint.js +8 -0
- package/dist/eslint-utils/parserPathSeemsToBeTSESLint.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/json-schema.d.ts +15 -19
- package/dist/json-schema.d.ts.map +1 -1
- package/dist/ts-eslint/Config.d.ts +258 -0
- package/dist/ts-eslint/Config.d.ts.map +1 -0
- package/dist/ts-eslint/Config.js +4 -0
- package/dist/ts-eslint/Config.js.map +1 -0
- package/dist/ts-eslint/ESLint.d.ts +9 -14
- package/dist/ts-eslint/ESLint.d.ts.map +1 -1
- package/dist/ts-eslint/ESLint.js +1 -10
- package/dist/ts-eslint/ESLint.js.map +1 -1
- package/dist/ts-eslint/Linter.d.ts +50 -130
- package/dist/ts-eslint/Linter.d.ts.map +1 -1
- package/dist/ts-eslint/Linter.js.map +1 -1
- package/dist/ts-eslint/Parser.d.ts +89 -0
- package/dist/ts-eslint/Parser.d.ts.map +1 -0
- package/dist/ts-eslint/Parser.js +4 -0
- package/dist/ts-eslint/Parser.js.map +1 -0
- package/dist/ts-eslint/Processor.d.ts +37 -0
- package/dist/ts-eslint/Processor.d.ts.map +1 -0
- package/dist/ts-eslint/Processor.js +4 -0
- package/dist/ts-eslint/Processor.js.map +1 -0
- package/dist/ts-eslint/Rule.d.ts +120 -12
- package/dist/ts-eslint/Rule.d.ts.map +1 -1
- package/dist/ts-eslint/RuleTester.d.ts +4 -5
- package/dist/ts-eslint/RuleTester.d.ts.map +1 -1
- package/dist/ts-eslint/RuleTester.js.map +1 -1
- package/dist/ts-eslint/SourceCode.d.ts +29 -18
- package/dist/ts-eslint/SourceCode.d.ts.map +1 -1
- package/dist/ts-eslint/SourceCode.js.map +1 -1
- package/dist/ts-eslint/index.d.ts +3 -1
- package/dist/ts-eslint/index.d.ts.map +1 -1
- package/dist/ts-eslint/index.js +3 -1
- package/dist/ts-eslint/index.js.map +1 -1
- package/dist/ts-utils/index.d.ts +2 -0
- package/dist/ts-utils/index.d.ts.map +1 -0
- package/dist/ts-utils/index.js +18 -0
- package/dist/ts-utils/index.js.map +1 -0
- package/dist/ts-utils/isArray.d.ts +2 -0
- package/dist/ts-utils/isArray.d.ts.map +1 -0
- package/dist/ts-utils/isArray.js +9 -0
- package/dist/ts-utils/isArray.js.map +1 -0
- package/package.json +16 -14
- package/dist/ts-eslint/CLIEngine.d.ts +0 -137
- package/dist/ts-eslint/CLIEngine.d.ts.map +0 -1
- package/dist/ts-eslint/CLIEngine.js +0 -18
- package/dist/ts-eslint/CLIEngine.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@typescript-eslint/utils",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.1",
|
|
4
4
|
"description": "Utilities for working with TypeScript + ESLint together",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -60,25 +60,28 @@
|
|
|
60
60
|
"clean": "tsc -b tsconfig.build.json --clean",
|
|
61
61
|
"postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage",
|
|
62
62
|
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
|
|
63
|
-
"lint": "nx lint",
|
|
63
|
+
"lint": "npx nx lint",
|
|
64
64
|
"test": "jest --coverage",
|
|
65
65
|
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@eslint-community/eslint-utils": "^4.
|
|
69
|
-
"@types/json-schema": "^7.0.
|
|
70
|
-
"@types/semver": "^7.
|
|
71
|
-
"@typescript-eslint/scope-manager": "7.0.
|
|
72
|
-
"@typescript-eslint/types": "7.0.
|
|
73
|
-
"@typescript-eslint/typescript-estree": "7.0.
|
|
74
|
-
"
|
|
75
|
-
"semver": "^7.5.0"
|
|
68
|
+
"@eslint-community/eslint-utils": "^4.4.0",
|
|
69
|
+
"@types/json-schema": "^7.0.12",
|
|
70
|
+
"@types/semver": "^7.5.0",
|
|
71
|
+
"@typescript-eslint/scope-manager": "7.0.1",
|
|
72
|
+
"@typescript-eslint/types": "7.0.1",
|
|
73
|
+
"@typescript-eslint/typescript-estree": "7.0.1",
|
|
74
|
+
"semver": "^7.5.4"
|
|
76
75
|
},
|
|
77
76
|
"peerDependencies": {
|
|
78
|
-
"eslint": "^
|
|
77
|
+
"eslint": "^8.56.0"
|
|
79
78
|
},
|
|
80
79
|
"devDependencies": {
|
|
81
|
-
"@typescript-eslint/parser": "7.0.
|
|
80
|
+
"@typescript-eslint/parser": "7.0.1",
|
|
81
|
+
"downlevel-dts": "*",
|
|
82
|
+
"jest": "29.7.0",
|
|
83
|
+
"prettier": "^3.0.3",
|
|
84
|
+
"rimraf": "*",
|
|
82
85
|
"typescript": "*"
|
|
83
86
|
},
|
|
84
87
|
"funding": {
|
|
@@ -91,6 +94,5 @@
|
|
|
91
94
|
"_ts4.3/*"
|
|
92
95
|
]
|
|
93
96
|
}
|
|
94
|
-
}
|
|
95
|
-
"gitHead": "6ae1fa74b18af8a2d4baa0d3d4b43997cf9a9781"
|
|
97
|
+
}
|
|
96
98
|
}
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import type { Linter } from './Linter';
|
|
2
|
-
import type { RuleMetaData, RuleModule } from './Rule';
|
|
3
|
-
declare namespace CLIEngine {
|
|
4
|
-
interface Options {
|
|
5
|
-
allowInlineConfig?: boolean;
|
|
6
|
-
baseConfig?: false | {
|
|
7
|
-
[name: string]: unknown;
|
|
8
|
-
};
|
|
9
|
-
cache?: boolean;
|
|
10
|
-
cacheFile?: string;
|
|
11
|
-
cacheLocation?: string;
|
|
12
|
-
configFile?: string;
|
|
13
|
-
cwd?: string;
|
|
14
|
-
envs?: string[];
|
|
15
|
-
errorOnUnmatchedPattern?: boolean;
|
|
16
|
-
extensions?: string[];
|
|
17
|
-
fix?: boolean;
|
|
18
|
-
globals?: string[];
|
|
19
|
-
ignore?: boolean;
|
|
20
|
-
ignorePath?: string;
|
|
21
|
-
ignorePattern?: string[] | string;
|
|
22
|
-
useEslintrc?: boolean;
|
|
23
|
-
parser?: string;
|
|
24
|
-
parserOptions?: Linter.ParserOptions;
|
|
25
|
-
plugins?: string[];
|
|
26
|
-
resolvePluginsRelativeTo?: string;
|
|
27
|
-
rules?: {
|
|
28
|
-
[name: string]: Linter.RuleLevel | Linter.RuleLevelAndOptions;
|
|
29
|
-
};
|
|
30
|
-
rulePaths?: string[];
|
|
31
|
-
reportUnusedDisableDirectives?: boolean;
|
|
32
|
-
}
|
|
33
|
-
interface LintResult {
|
|
34
|
-
filePath: string;
|
|
35
|
-
messages: Linter.LintMessage[];
|
|
36
|
-
errorCount: number;
|
|
37
|
-
warningCount: number;
|
|
38
|
-
fixableErrorCount: number;
|
|
39
|
-
fixableWarningCount: number;
|
|
40
|
-
output?: string;
|
|
41
|
-
source?: string;
|
|
42
|
-
}
|
|
43
|
-
interface LintReport {
|
|
44
|
-
results: LintResult[];
|
|
45
|
-
errorCount: number;
|
|
46
|
-
warningCount: number;
|
|
47
|
-
fixableErrorCount: number;
|
|
48
|
-
fixableWarningCount: number;
|
|
49
|
-
usedDeprecatedRules: DeprecatedRuleUse[];
|
|
50
|
-
}
|
|
51
|
-
interface DeprecatedRuleUse {
|
|
52
|
-
ruleId: string;
|
|
53
|
-
replacedBy: string[];
|
|
54
|
-
}
|
|
55
|
-
interface LintResultData<TMessageIds extends string> {
|
|
56
|
-
rulesMeta: {
|
|
57
|
-
[ruleId: string]: RuleMetaData<TMessageIds>;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
type Formatter = <TMessageIds extends string>(results: LintResult[], data?: LintResultData<TMessageIds>) => string;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* The underlying utility that runs the ESLint command line interface. This object will read the filesystem for
|
|
64
|
-
* configuration and file information but will not output any results. Instead, it allows you direct access to the
|
|
65
|
-
* important information so you can deal with the output yourself.
|
|
66
|
-
* @deprecated use the ESLint class instead
|
|
67
|
-
*/
|
|
68
|
-
declare const CLIEngine: {
|
|
69
|
-
new (options: CLIEngine.Options): {
|
|
70
|
-
/**
|
|
71
|
-
* Add a plugin by passing its configuration
|
|
72
|
-
* @param name Name of the plugin.
|
|
73
|
-
* @param pluginObject Plugin configuration object.
|
|
74
|
-
*/
|
|
75
|
-
addPlugin(name: string, pluginObject: Linter.Plugin): void;
|
|
76
|
-
/**
|
|
77
|
-
* Executes the current configuration on an array of file and directory names.
|
|
78
|
-
* @param patterns An array of file and directory names.
|
|
79
|
-
* @returns The results for all files that were linted.
|
|
80
|
-
*/
|
|
81
|
-
executeOnFiles(patterns: string[]): CLIEngine.LintReport;
|
|
82
|
-
/**
|
|
83
|
-
* Executes the current configuration on text.
|
|
84
|
-
* @param text A string of JavaScript code to lint.
|
|
85
|
-
* @param filename An optional string representing the texts filename.
|
|
86
|
-
* @param warnIgnored Always warn when a file is ignored
|
|
87
|
-
* @returns The results for the linting.
|
|
88
|
-
*/
|
|
89
|
-
executeOnText(text: string, filename?: string, warnIgnored?: boolean): CLIEngine.LintReport;
|
|
90
|
-
/**
|
|
91
|
-
* Returns a configuration object for the given file based on the CLI options.
|
|
92
|
-
* This is the same logic used by the ESLint CLI executable to determine configuration for each file it processes.
|
|
93
|
-
* @param filePath The path of the file to retrieve a config object for.
|
|
94
|
-
* @returns A configuration object for the file.
|
|
95
|
-
*/
|
|
96
|
-
getConfigForFile(filePath: string): Linter.Config;
|
|
97
|
-
/**
|
|
98
|
-
* Returns the formatter representing the given format.
|
|
99
|
-
* @param format The name of the format to load or the path to a custom formatter.
|
|
100
|
-
* @returns The formatter function.
|
|
101
|
-
*/
|
|
102
|
-
getFormatter(format?: string): CLIEngine.Formatter;
|
|
103
|
-
/**
|
|
104
|
-
* Checks if a given path is ignored by ESLint.
|
|
105
|
-
* @param filePath The path of the file to check.
|
|
106
|
-
* @returns Whether or not the given path is ignored.
|
|
107
|
-
*/
|
|
108
|
-
isPathIgnored(filePath: string): boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Resolves the patterns passed into `executeOnFiles()` into glob-based patterns for easier handling.
|
|
111
|
-
* @param patterns The file patterns passed on the command line.
|
|
112
|
-
* @returns The equivalent glob patterns.
|
|
113
|
-
*/
|
|
114
|
-
resolveFileGlobPatterns(patterns: string[]): string[];
|
|
115
|
-
getRules<TMessageIds extends string = string, TOptions extends readonly unknown[] = unknown[]>(): Map<string, RuleModule<TMessageIds, TOptions, import("./Rule").RuleListener>>;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Returns results that only contains errors.
|
|
119
|
-
* @param results The results to filter.
|
|
120
|
-
* @returns The filtered results.
|
|
121
|
-
*/
|
|
122
|
-
getErrorResults(results: CLIEngine.LintResult[]): CLIEngine.LintResult[];
|
|
123
|
-
/**
|
|
124
|
-
* Returns the formatter representing the given format or null if the `format` is not a string.
|
|
125
|
-
* @param format The name of the format to load or the path to a custom formatter.
|
|
126
|
-
* @returns The formatter function.
|
|
127
|
-
*/
|
|
128
|
-
getFormatter(format?: string): CLIEngine.Formatter;
|
|
129
|
-
/**
|
|
130
|
-
* Outputs fixes from the given results to files.
|
|
131
|
-
* @param report The report object created by CLIEngine.
|
|
132
|
-
*/
|
|
133
|
-
outputFixes(report: CLIEngine.LintReport): void;
|
|
134
|
-
version: string;
|
|
135
|
-
} | undefined;
|
|
136
|
-
export { CLIEngine };
|
|
137
|
-
//# sourceMappingURL=CLIEngine.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CLIEngine.d.ts","sourceRoot":"","sources":["../../src/ts-eslint/CLIEngine.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAmGvD,kBAAU,SAAS,CAAC;IAClB,UAAiB,OAAO;QACtB,iBAAiB,CAAC,EAAE,OAAO,CAAC;QAC5B,UAAU,CAAC,EAAE,KAAK,GAAG;YAAE,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;SAAE,CAAC;QACjD,KAAK,CAAC,EAAE,OAAO,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,aAAa,CAAC,EAAE,MAAM,CAAC;QACvB,UA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int/no-namespace */
|
|
3
|
-
/* eslint-disable deprecation/deprecation -- "uses" deprecated API to define the deprecated API */
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.CLIEngine = void 0;
|
|
6
|
-
const eslint_1 = require("eslint");
|
|
7
|
-
/**
|
|
8
|
-
* The underlying utility that runs the ESLint command line interface. This object will read the filesystem for
|
|
9
|
-
* configuration and file information but will not output any results. Instead, it allows you direct access to the
|
|
10
|
-
* important information so you can deal with the output yourself.
|
|
11
|
-
* @deprecated use the ESLint class instead
|
|
12
|
-
*/
|
|
13
|
-
const CLIEngine = eslint_1.CLIEngine
|
|
14
|
-
? class CLIEngine extends eslint_1.CLIEngine {
|
|
15
|
-
}
|
|
16
|
-
: undefined;
|
|
17
|
-
exports.CLIEngine = CLIEngine;
|
|
18
|
-
//# sourceMappingURL=CLIEngine.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CLIEngine.js","sourceRoot":"","sources":["../../src/ts-eslint/CLIEngine.ts"],"names":[],"mappings":";AAAA,oDAAoD;AACpD,kGAAkG;;;AAElG,mCAAsD;AAwKtD;;;;;GAKG;AACH,MAAM,SAAS,GAAG,kBAAe;IAC/B,CAAC,CAAC,MAAM,SAAU,SAAS,kBAAwC;KAAG;IACtE,CAAC,CAAC,SAAS,CAAC;AAEL,8BAAS"}
|