@interlace/eslint-devkit 2.1.2 → 2.3.0
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/package.json +1 -6
- package/src/ast/ast-utils.d.ts +1 -1
- package/src/ast/module-binding.d.ts +1 -1
- package/src/ast/spellings.d.ts +1 -1
- package/src/ast/static-expression.d.ts +1 -1
- package/src/ast/type-syntax.d.ts +1 -1
- package/src/ast-node-types.d.ts +1 -1
- package/src/index.d.ts +6 -3
- package/src/resolver/dependency-analysis.d.ts +29 -0
- package/src/resolver/dependency-analysis.js +1 -1
- package/src/resolver/resolver-fallback.d.ts +17 -0
- package/src/resolver/resolver-fallback.js +1 -0
- package/src/resolver/resolver.d.ts +3 -6
- package/src/resolver/resolver.js +1 -1
- package/src/rule-creation/browser-escape-hatch-rule.d.ts +1 -1
- package/src/rule-creation/connection-config.d.ts +1 -1
- package/src/rule-creation/driver-origin.d.ts +1 -1
- package/src/rule-creation/generated-file.d.ts +1 -1
- package/src/rule-creation/hardcoded-credentials-rule.d.ts +9 -2
- package/src/rule-creation/mass-assignment-rule.d.ts +9 -2
- package/src/rule-creation/message-source.d.ts +1 -1
- package/src/rule-creation/minified-file.d.ts +1 -1
- package/src/rule-creation/mock-context.d.ts +1 -1
- package/src/rule-creation/module-evidence.d.ts +1 -1
- package/src/rule-creation/raw-identifier-rule.d.ts +9 -2
- package/src/rule-creation/request-source.d.ts +1 -1
- package/src/rule-creation/require-tls-rule.d.ts +8 -2
- package/src/rule-creation/rule-creator.d.ts +1 -1
- package/src/rule-creation/rule-creator.js +1 -1
- package/src/rule-creation/sdk-api-key-rule.d.ts +1 -1
- package/src/rule-creation/sdk-flow.d.ts +1 -1
- package/src/rule-creation/sql-injection-rule.d.ts +8 -2
- package/src/rule-creation/sql-position.d.ts +1 -1
- package/src/rule-creation/sql-safety.d.ts +1 -1
- package/src/rule-creation/system-prompt-injection-rule.d.ts +1 -1
- package/src/rule-creation/unscoped-mutation-rule.d.ts +9 -2
- package/src/rule-creation/value-follow.d.ts +1 -1
- package/src/security/security-utils.d.ts +1 -1
- package/src/types/estree/project-service/createProjectService.d.ts +67 -0
- package/src/types/estree/project-service/index.d.ts +3 -0
- package/src/types/estree/scope-manager/ScopeManager.d.ts +77 -0
- package/src/types/estree/scope-manager/analyze.d.ts +55 -0
- package/src/types/estree/scope-manager/definition/CatchClauseDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/ClassNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/Definition.d.ts +14 -0
- package/src/types/estree/scope-manager/definition/DefinitionBase.d.ts +35 -0
- package/src/types/estree/scope-manager/definition/DefinitionType.d.ts +15 -0
- package/src/types/estree/scope-manager/definition/FunctionNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/ImplicitGlobalVariableDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/ImportBindingDefinition.d.ts +11 -0
- package/src/types/estree/scope-manager/definition/ParameterDefinition.d.ts +14 -0
- package/src/types/estree/scope-manager/definition/TSEnumMemberDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/TSEnumNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/TSModuleNameDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/TypeDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/VariableDefinition.d.ts +10 -0
- package/src/types/estree/scope-manager/definition/index.d.ts +15 -0
- package/src/types/estree/scope-manager/index.d.ts +10 -0
- package/src/types/estree/scope-manager/referencer/PatternVisitor.d.ts +16 -0
- package/src/types/estree/scope-manager/referencer/Reference.d.ts +88 -0
- package/src/types/estree/scope-manager/referencer/Referencer.d.ts +28 -0
- package/src/types/estree/scope-manager/referencer/Visitor.d.ts +13 -0
- package/src/types/estree/scope-manager/referencer/VisitorBase.d.ts +22 -0
- package/src/types/estree/scope-manager/referencer/index.d.ts +3 -0
- package/src/types/estree/scope-manager/scope/BlockScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/CatchScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ClassFieldInitializerScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ClassScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ClassStaticBlockScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ConditionalTypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ForScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/FunctionExpressionNameScope.d.ts +11 -0
- package/src/types/estree/scope-manager/scope/FunctionScope.d.ts +12 -0
- package/src/types/estree/scope-manager/scope/FunctionTypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/GlobalScope.d.ts +18 -0
- package/src/types/estree/scope-manager/scope/MappedTypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/ModuleScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/Scope.d.ts +21 -0
- package/src/types/estree/scope-manager/scope/ScopeBase.d.ts +91 -0
- package/src/types/estree/scope-manager/scope/ScopeType.d.ts +22 -0
- package/src/types/estree/scope-manager/scope/SwitchScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/TSEnumScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/TSModuleScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/TypeScope.d.ts +10 -0
- package/src/types/estree/scope-manager/scope/WithScope.d.ts +11 -0
- package/src/types/estree/scope-manager/scope/index.d.ts +22 -0
- package/src/types/estree/scope-manager/variable/ESLintScopeVariable.d.ts +34 -0
- package/src/types/estree/scope-manager/variable/ImplicitLibVariable.d.ts +29 -0
- package/src/types/estree/scope-manager/variable/Variable.d.ts +18 -0
- package/src/types/estree/scope-manager/variable/VariableBase.d.ts +44 -0
- package/src/types/estree/scope-manager/variable/index.d.ts +8 -0
- package/src/types/estree/types/generated/ast-spec.d.ts +2215 -0
- package/src/types/estree/types/index.d.ts +6 -0
- package/src/types/estree/types/lib.d.ts +3 -0
- package/src/types/estree/types/parser-options.d.ts +83 -0
- package/src/types/estree/types/ts-estree.d.ts +190 -0
- package/src/types/estree/typescript-estree/clear-caches.d.ts +11 -0
- package/src/types/estree/typescript-estree/create-program/getScriptKind.d.ts +5 -0
- package/src/types/estree/typescript-estree/create-program/shared.d.ts +29 -0
- package/src/types/estree/typescript-estree/create-program/useProvidedPrograms.d.ts +13 -0
- package/src/types/estree/typescript-estree/getModifiers.d.ts +5 -0
- package/src/types/estree/typescript-estree/index.d.ts +16 -0
- package/src/types/estree/typescript-estree/node-utils.d.ts +191 -0
- package/src/types/estree/typescript-estree/parseSettings/ExpiringCache.d.ts +17 -0
- package/src/types/estree/typescript-estree/parseSettings/candidateTSConfigRootDirs.d.ts +5 -0
- package/src/types/estree/typescript-estree/parseSettings/index.d.ts +128 -0
- package/src/types/estree/typescript-estree/parser-options.d.ts +220 -0
- package/src/types/estree/typescript-estree/parser.d.ts +19 -0
- package/src/types/estree/typescript-estree/simple-traverse.d.ts +13 -0
- package/src/types/estree/typescript-estree/ts-estree/estree-to-ts-node-types.d.ts +180 -0
- package/src/types/estree/typescript-estree/ts-estree/index.d.ts +5 -0
- package/src/types/estree/typescript-estree/ts-estree/ts-nodes.d.ts +19 -0
- package/src/types/estree/typescript-estree/version-check.d.ts +6 -0
- package/src/types/estree/typescript-estree/version.d.ts +3 -0
- package/src/types/estree/typescript-estree/withoutProjectParserOptions.d.ts +11 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/PatternMatcher.d.ts +49 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/ReferenceTracker.d.ts +73 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/astUtilities.d.ts +85 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/index.d.ts +7 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/predicates.d.ts +33 -0
- package/src/types/estree/utils/ast-utils/eslint-utils/scopeAnalysis.d.ts +18 -0
- package/src/types/estree/utils/ast-utils/helpers.d.ts +20 -0
- package/src/types/estree/utils/ast-utils/index.d.ts +6 -0
- package/src/types/estree/utils/ast-utils/misc.d.ts +12 -0
- package/src/types/estree/utils/ast-utils/predicates.d.ts +70 -0
- package/src/types/estree/utils/eslint-utils/InferTypesFromRule.d.ts +11 -0
- package/src/types/estree/utils/eslint-utils/RuleCreator.d.ts +34 -0
- package/src/types/estree/utils/eslint-utils/applyDefault.d.ts +10 -0
- package/src/types/estree/utils/eslint-utils/deepMerge.d.ts +16 -0
- package/src/types/estree/utils/eslint-utils/getParserServices.d.ts +24 -0
- package/src/types/estree/utils/eslint-utils/index.d.ts +8 -0
- package/src/types/estree/utils/eslint-utils/nullThrows.d.ts +14 -0
- package/src/types/estree/utils/index.d.ts +8 -0
- package/src/types/estree/utils/json-schema.d.ts +389 -0
- package/src/types/estree/utils/ts-eslint/AST.d.ts +10 -0
- package/src/types/estree/utils/ts-eslint/Config.d.ts +293 -0
- package/src/types/estree/utils/ts-eslint/ESLint.d.ts +9 -0
- package/src/types/estree/utils/ts-eslint/Linter.d.ts +257 -0
- package/src/types/estree/utils/ts-eslint/Parser.d.ts +96 -0
- package/src/types/estree/utils/ts-eslint/ParserOptions.d.ts +3 -0
- package/src/types/estree/utils/ts-eslint/Processor.d.ts +65 -0
- package/src/types/estree/utils/ts-eslint/Rule.d.ts +633 -0
- package/src/types/estree/utils/ts-eslint/RuleTester.d.ts +185 -0
- package/src/types/estree/utils/ts-eslint/Scope.d.ts +44 -0
- package/src/types/estree/utils/ts-eslint/SourceCode.d.ts +356 -0
- package/src/types/estree/utils/ts-eslint/eslint/ESLintShared.d.ts +383 -0
- package/src/types/estree/utils/ts-eslint/eslint/FlatESLint.d.ts +89 -0
- package/src/types/estree/utils/ts-eslint/eslint/LegacyESLint.d.ts +74 -0
- package/src/types/estree/utils/ts-eslint/index.d.ts +13 -0
- package/src/types/estree/utils/ts-estree.d.ts +5 -0
- package/src/types/estree/utils/ts-utils/NoInfer.d.ts +11 -0
- package/src/types/estree/utils/ts-utils/index.d.ts +4 -0
- package/src/types/estree/utils/ts-utils/isArray.d.ts +3 -0
- package/src/types/estree/visitor-keys/get-keys.d.ts +4 -0
- package/src/types/estree/visitor-keys/index.d.ts +4 -0
- package/src/types/estree/visitor-keys/visitor-keys.d.ts +4 -0
- package/src/types/meta-augmentation.d.ts +1 -1
- package/src/types/type-utils.d.ts +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export { FlatESLint } from './eslint/FlatESLint';
|
|
4
|
+
export { FlatESLint as ESLint } from './eslint/FlatESLint';
|
|
5
|
+
export {
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated - use ESLint instead
|
|
8
|
+
*/
|
|
9
|
+
LegacyESLint, } from './eslint/LegacyESLint';
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type { ClassicConfig, FlatConfig, SharedConfig } from './Config';
|
|
4
|
+
import type { Parser } from './Parser';
|
|
5
|
+
import type { Processor as ProcessorType } from './Processor';
|
|
6
|
+
import type { AnyRuleCreateFunction, AnyRuleModule, RuleCreateFunction, RuleFix, RuleModule } from './Rule';
|
|
7
|
+
import type { SourceCode } from './SourceCode';
|
|
8
|
+
export type MinimalRuleModule<MessageIds extends string = string, Options extends readonly unknown[] = []> = Partial<Omit<RuleModule<MessageIds, Options>, 'create'>> & Pick<RuleModule<MessageIds, Options>, 'create'>;
|
|
9
|
+
declare class LinterBase {
|
|
10
|
+
/**
|
|
11
|
+
* The version from package.json.
|
|
12
|
+
*/
|
|
13
|
+
readonly version: string;
|
|
14
|
+
/**
|
|
15
|
+
* Initialize the Linter.
|
|
16
|
+
* @param config the config object
|
|
17
|
+
*/
|
|
18
|
+
constructor(config?: Linter.LinterOptions);
|
|
19
|
+
/**
|
|
20
|
+
* Define a new parser module
|
|
21
|
+
* @param parserId Name of the parser
|
|
22
|
+
* @param parserModule The parser object
|
|
23
|
+
*/
|
|
24
|
+
defineParser(parserId: string, parserModule: Parser.LooseParserModule): void;
|
|
25
|
+
/**
|
|
26
|
+
* Defines a new linting rule.
|
|
27
|
+
* @param ruleId A unique rule identifier
|
|
28
|
+
* @param ruleModule Function from context to object mapping AST node types to event handlers
|
|
29
|
+
*/
|
|
30
|
+
defineRule<MessageIds extends string, Options extends readonly unknown[]>(ruleId: string, ruleModule: MinimalRuleModule<MessageIds, Options> | RuleCreateFunction): void;
|
|
31
|
+
/**
|
|
32
|
+
* Defines many new linting rules.
|
|
33
|
+
* @param rulesToDefine map from unique rule identifier to rule
|
|
34
|
+
*/
|
|
35
|
+
defineRules<MessageIds extends string, Options extends readonly unknown[]>(rulesToDefine: Record<string, MinimalRuleModule<MessageIds, Options> | RuleCreateFunction<MessageIds, Options>>): void;
|
|
36
|
+
/**
|
|
37
|
+
* Gets an object with all loaded rules.
|
|
38
|
+
* @returns All loaded rules
|
|
39
|
+
*/
|
|
40
|
+
getRules(): Map<string, MinimalRuleModule<string, unknown[]>>;
|
|
41
|
+
/**
|
|
42
|
+
* Gets the `SourceCode` object representing the parsed source.
|
|
43
|
+
* @returns The `SourceCode` object.
|
|
44
|
+
*/
|
|
45
|
+
getSourceCode(): SourceCode;
|
|
46
|
+
/**
|
|
47
|
+
* Verifies the text against the rules specified by the second argument.
|
|
48
|
+
* @param textOrSourceCode The text to parse or a SourceCode object.
|
|
49
|
+
* @param config An ESLintConfig instance to configure everything.
|
|
50
|
+
* @param filenameOrOptions The optional filename of the file being checked.
|
|
51
|
+
* If this is not set, the filename will default to '<input>' in the rule context.
|
|
52
|
+
* If this is an object, then it has "filename", "allowInlineConfig", and some properties.
|
|
53
|
+
* @returns The results as an array of messages or an empty array if no messages.
|
|
54
|
+
*/
|
|
55
|
+
verify(textOrSourceCode: string | SourceCode, config: Linter.ConfigType, filenameOrOptions?: string | Linter.VerifyOptions): Linter.LintMessage[];
|
|
56
|
+
/**
|
|
57
|
+
* The version from package.json.
|
|
58
|
+
*/
|
|
59
|
+
static readonly version: string;
|
|
60
|
+
/**
|
|
61
|
+
* Performs multiple autofix passes over the text until as many fixes as possible have been applied.
|
|
62
|
+
* @param code The source text to apply fixes to.
|
|
63
|
+
* @param config The ESLint config object to use.
|
|
64
|
+
* @param options The ESLint options object to use.
|
|
65
|
+
* @returns The result of the fix operation as returned from the SourceCodeFixer.
|
|
66
|
+
*/
|
|
67
|
+
verifyAndFix(code: string, config: Linter.ConfigType, options: Linter.FixOptions): Linter.FixReport;
|
|
68
|
+
}
|
|
69
|
+
declare namespace Linter {
|
|
70
|
+
interface LinterOptions {
|
|
71
|
+
/**
|
|
72
|
+
* Which config format to use.
|
|
73
|
+
* @default 'flat'
|
|
74
|
+
*/
|
|
75
|
+
configType?: ConfigTypeSpecifier;
|
|
76
|
+
/**
|
|
77
|
+
* path to a directory that should be considered as the current working directory.
|
|
78
|
+
*/
|
|
79
|
+
cwd?: string;
|
|
80
|
+
}
|
|
81
|
+
type ConfigTypeSpecifier = 'eslintrc' | 'flat';
|
|
82
|
+
type EnvironmentConfig = SharedConfig.EnvironmentConfig;
|
|
83
|
+
type GlobalsConfig = SharedConfig.GlobalsConfig;
|
|
84
|
+
type GlobalVariableOption = SharedConfig.GlobalVariableOption;
|
|
85
|
+
type GlobalVariableOptionBase = SharedConfig.GlobalVariableOptionBase;
|
|
86
|
+
type ParserOptions = SharedConfig.ParserOptions;
|
|
87
|
+
type PluginMeta = SharedConfig.PluginMeta;
|
|
88
|
+
type RuleEntry = SharedConfig.RuleEntry;
|
|
89
|
+
type RuleLevel = SharedConfig.RuleLevel;
|
|
90
|
+
type RuleLevelAndOptions = SharedConfig.RuleLevelAndOptions;
|
|
91
|
+
type RulesRecord = SharedConfig.RulesRecord;
|
|
92
|
+
type Severity = SharedConfig.Severity;
|
|
93
|
+
type SeverityString = SharedConfig.SeverityString;
|
|
94
|
+
/** @deprecated use {@link Linter.ConfigType} instead */
|
|
95
|
+
type Config = ClassicConfig.Config;
|
|
96
|
+
type ConfigType = ClassicConfig.Config | FlatConfig.Config | FlatConfig.ConfigArray;
|
|
97
|
+
/** @deprecated use {@link ClassicConfig.ConfigOverride} instead */
|
|
98
|
+
type ConfigOverride = ClassicConfig.ConfigOverride;
|
|
99
|
+
interface VerifyOptions {
|
|
100
|
+
/**
|
|
101
|
+
* Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied.
|
|
102
|
+
* Useful if you want to validate JS without comments overriding rules.
|
|
103
|
+
*/
|
|
104
|
+
allowInlineConfig?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* if `true` then the linter doesn't make `fix` properties into the lint result.
|
|
107
|
+
*/
|
|
108
|
+
disableFixes?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* the filename of the source code.
|
|
111
|
+
*/
|
|
112
|
+
filename?: string;
|
|
113
|
+
/**
|
|
114
|
+
* the predicate function that selects adopt code blocks.
|
|
115
|
+
*/
|
|
116
|
+
filterCodeBlock?: (filename: string, text: string) => boolean;
|
|
117
|
+
/**
|
|
118
|
+
* postprocessor for report messages.
|
|
119
|
+
* If provided, this should accept an array of the message lists
|
|
120
|
+
* for each code block returned from the preprocessor, apply a mapping to
|
|
121
|
+
* the messages as appropriate, and return a one-dimensional array of
|
|
122
|
+
* messages.
|
|
123
|
+
*/
|
|
124
|
+
postprocess?: ProcessorType.PostProcess;
|
|
125
|
+
/**
|
|
126
|
+
* preprocessor for source text.
|
|
127
|
+
* If provided, this should accept a string of source text, and return an array of code blocks to lint.
|
|
128
|
+
*/
|
|
129
|
+
preprocess?: ProcessorType.PreProcess;
|
|
130
|
+
/**
|
|
131
|
+
* Adds reported errors for unused `eslint-disable` directives.
|
|
132
|
+
*/
|
|
133
|
+
reportUnusedDisableDirectives?: boolean | SeverityString;
|
|
134
|
+
}
|
|
135
|
+
interface FixOptions extends VerifyOptions {
|
|
136
|
+
/**
|
|
137
|
+
* Determines whether fixes should be applied.
|
|
138
|
+
*/
|
|
139
|
+
fix?: boolean;
|
|
140
|
+
}
|
|
141
|
+
interface LintSuggestion {
|
|
142
|
+
desc: string;
|
|
143
|
+
fix: RuleFix;
|
|
144
|
+
messageId?: string;
|
|
145
|
+
}
|
|
146
|
+
interface LintMessage {
|
|
147
|
+
/**
|
|
148
|
+
* The 1-based column number.
|
|
149
|
+
*/
|
|
150
|
+
column: number;
|
|
151
|
+
/**
|
|
152
|
+
* The 1-based column number of the end location.
|
|
153
|
+
*/
|
|
154
|
+
endColumn?: number;
|
|
155
|
+
/**
|
|
156
|
+
* The 1-based line number of the end location.
|
|
157
|
+
*/
|
|
158
|
+
endLine?: number;
|
|
159
|
+
/**
|
|
160
|
+
* If `true` then this is a fatal error.
|
|
161
|
+
*/
|
|
162
|
+
fatal?: true;
|
|
163
|
+
/**
|
|
164
|
+
* Information for autofix.
|
|
165
|
+
*/
|
|
166
|
+
fix?: RuleFix;
|
|
167
|
+
/**
|
|
168
|
+
* The 1-based line number.
|
|
169
|
+
*/
|
|
170
|
+
line: number;
|
|
171
|
+
/**
|
|
172
|
+
* The error message.
|
|
173
|
+
*/
|
|
174
|
+
message: string;
|
|
175
|
+
messageId?: string;
|
|
176
|
+
/**
|
|
177
|
+
* @deprecated `nodeType` is deprecated and will be removed in the next major version.
|
|
178
|
+
*/
|
|
179
|
+
nodeType?: string;
|
|
180
|
+
/**
|
|
181
|
+
* The ID of the rule which makes this message.
|
|
182
|
+
*/
|
|
183
|
+
ruleId: string | null;
|
|
184
|
+
/**
|
|
185
|
+
* The severity of this message.
|
|
186
|
+
*/
|
|
187
|
+
severity: Severity;
|
|
188
|
+
source: string | null;
|
|
189
|
+
/**
|
|
190
|
+
* Information for suggestions
|
|
191
|
+
*/
|
|
192
|
+
suggestions?: LintSuggestion[];
|
|
193
|
+
}
|
|
194
|
+
interface FixReport {
|
|
195
|
+
/**
|
|
196
|
+
* True, if the code was fixed
|
|
197
|
+
*/
|
|
198
|
+
fixed: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Collection of all messages for the given code
|
|
201
|
+
*/
|
|
202
|
+
messages: LintMessage[];
|
|
203
|
+
/**
|
|
204
|
+
* Fixed code text (might be the same as input if no fixes were applied).
|
|
205
|
+
*/
|
|
206
|
+
output: string;
|
|
207
|
+
}
|
|
208
|
+
/** @deprecated use {@link Parser.ParserModule} */
|
|
209
|
+
type ParserModule = Parser.LooseParserModule;
|
|
210
|
+
/** @deprecated use {@link Parser.ParseResult} */
|
|
211
|
+
type ESLintParseResult = Parser.ParseResult;
|
|
212
|
+
/** @deprecated use {@link ProcessorType.ProcessorModule} */
|
|
213
|
+
type Processor = ProcessorType.ProcessorModule;
|
|
214
|
+
interface Environment {
|
|
215
|
+
/**
|
|
216
|
+
* The definition of global variables.
|
|
217
|
+
*/
|
|
218
|
+
globals?: GlobalsConfig;
|
|
219
|
+
/**
|
|
220
|
+
* The parser options that will be enabled under this environment.
|
|
221
|
+
*/
|
|
222
|
+
parserOptions?: ParserOptions;
|
|
223
|
+
}
|
|
224
|
+
type LegacyPluginRules = Record<string, AnyRuleCreateFunction | AnyRuleModule>;
|
|
225
|
+
type PluginRules = Record<string, AnyRuleModule>;
|
|
226
|
+
interface Plugin {
|
|
227
|
+
/**
|
|
228
|
+
* The definition of plugin configs.
|
|
229
|
+
*/
|
|
230
|
+
configs?: Record<string, ClassicConfig.Config>;
|
|
231
|
+
/**
|
|
232
|
+
* The definition of plugin environments.
|
|
233
|
+
*/
|
|
234
|
+
environments?: Record<string, Environment>;
|
|
235
|
+
/**
|
|
236
|
+
* Metadata about your plugin for easier debugging and more effective caching of plugins.
|
|
237
|
+
*/
|
|
238
|
+
meta?: PluginMeta;
|
|
239
|
+
/**
|
|
240
|
+
* The definition of plugin processors.
|
|
241
|
+
*/
|
|
242
|
+
processors?: Record<string, ProcessorType.ProcessorModule>;
|
|
243
|
+
/**
|
|
244
|
+
* The definition of plugin rules.
|
|
245
|
+
*/
|
|
246
|
+
rules?: LegacyPluginRules;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
declare const Linter_base: typeof LinterBase;
|
|
250
|
+
/**
|
|
251
|
+
* The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it
|
|
252
|
+
* simply parses and reports on the code. In particular, the Linter object does not process configuration objects
|
|
253
|
+
* or files.
|
|
254
|
+
*/
|
|
255
|
+
declare class Linter extends Linter_base {
|
|
256
|
+
}
|
|
257
|
+
export { Linter };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type { ParserServices, TSESTree } from '../ts-estree';
|
|
4
|
+
import type { ParserOptions } from './ParserOptions';
|
|
5
|
+
import type { Scope } from './Scope';
|
|
6
|
+
export declare namespace Parser {
|
|
7
|
+
interface ParserMeta {
|
|
8
|
+
/**
|
|
9
|
+
* The unique name of the parser.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* The a string identifying the version of the parser.
|
|
14
|
+
*/
|
|
15
|
+
version?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A loose definition of the ParserModule type for use with configs
|
|
19
|
+
* This type intended to relax validation of configs so that parsers that have
|
|
20
|
+
* different AST types or scope managers can still be passed to configs
|
|
21
|
+
*
|
|
22
|
+
* @see {@link LooseRuleDefinition}, {@link LooseProcessorModule}
|
|
23
|
+
*/
|
|
24
|
+
type LooseParserModule = {
|
|
25
|
+
/**
|
|
26
|
+
* Information about the parser to uniquely identify it when serializing.
|
|
27
|
+
*/
|
|
28
|
+
meta?: {
|
|
29
|
+
[K in keyof ParserMeta]?: ParserMeta[K] | undefined;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Parses the given text into an AST
|
|
33
|
+
*/
|
|
34
|
+
parseForESLint(text: string, options?: unknown): {
|
|
35
|
+
[k in keyof ParseResult]: unknown;
|
|
36
|
+
};
|
|
37
|
+
} | {
|
|
38
|
+
/**
|
|
39
|
+
* Information about the parser to uniquely identify it when serializing.
|
|
40
|
+
*/
|
|
41
|
+
meta?: {
|
|
42
|
+
[K in keyof ParserMeta]?: ParserMeta[K] | undefined;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Parses the given text into an ESTree AST
|
|
46
|
+
*/
|
|
47
|
+
parse(text: string, options?: unknown): unknown;
|
|
48
|
+
};
|
|
49
|
+
type ParserModule = {
|
|
50
|
+
/**
|
|
51
|
+
* Information about the parser to uniquely identify it when serializing.
|
|
52
|
+
*/
|
|
53
|
+
meta?: ParserMeta;
|
|
54
|
+
/**
|
|
55
|
+
* Parses the given text into an AST
|
|
56
|
+
*/
|
|
57
|
+
parseForESLint(text: string, options?: ParserOptions): ParseResult;
|
|
58
|
+
} | {
|
|
59
|
+
/**
|
|
60
|
+
* Information about the parser to uniquely identify it when serializing.
|
|
61
|
+
*/
|
|
62
|
+
meta?: ParserMeta;
|
|
63
|
+
/**
|
|
64
|
+
* Parses the given text into an ESTree AST
|
|
65
|
+
*/
|
|
66
|
+
parse(text: string, options?: ParserOptions): TSESTree.Program;
|
|
67
|
+
};
|
|
68
|
+
interface ParseResult {
|
|
69
|
+
/**
|
|
70
|
+
* The ESTree AST
|
|
71
|
+
*/
|
|
72
|
+
ast: TSESTree.Program;
|
|
73
|
+
/**
|
|
74
|
+
* A `ScopeManager` object.
|
|
75
|
+
* Custom parsers can use customized scope analysis for experimental/enhancement syntaxes.
|
|
76
|
+
* The default is the `ScopeManager` object which is created by `eslint-scope`.
|
|
77
|
+
*/
|
|
78
|
+
scopeManager?: Scope.ScopeManager;
|
|
79
|
+
/**
|
|
80
|
+
* Any parser-dependent services (such as type checkers for nodes).
|
|
81
|
+
* The value of the services property is available to rules as `context.sourceCode.parserServices`.
|
|
82
|
+
* The default is an empty object.
|
|
83
|
+
*/
|
|
84
|
+
services?: ParserServices;
|
|
85
|
+
/**
|
|
86
|
+
* An object to customize AST traversal.
|
|
87
|
+
* The keys of the object are the type of AST nodes.
|
|
88
|
+
* Each value is an array of the property names which should be traversed.
|
|
89
|
+
* The default is `KEYS` of `eslint-visitor-keys`.
|
|
90
|
+
*/
|
|
91
|
+
visitorKeys?: VisitorKeys;
|
|
92
|
+
}
|
|
93
|
+
interface VisitorKeys {
|
|
94
|
+
[nodeType: string]: readonly string[];
|
|
95
|
+
}
|
|
96
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/utils@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
import type { Linter } from './Linter';
|
|
4
|
+
export declare namespace Processor {
|
|
5
|
+
interface ProcessorMeta {
|
|
6
|
+
/**
|
|
7
|
+
* The unique name of the processor.
|
|
8
|
+
*/
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The a string identifying the version of the processor.
|
|
12
|
+
*/
|
|
13
|
+
version?: string;
|
|
14
|
+
}
|
|
15
|
+
type PreProcess = (text: string, filename: string) => (string | {
|
|
16
|
+
filename: string;
|
|
17
|
+
text: string;
|
|
18
|
+
})[];
|
|
19
|
+
type PostProcess = (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[];
|
|
20
|
+
interface ProcessorModule {
|
|
21
|
+
/**
|
|
22
|
+
* Information about the processor to uniquely identify it when serializing.
|
|
23
|
+
*/
|
|
24
|
+
meta?: ProcessorMeta;
|
|
25
|
+
/**
|
|
26
|
+
* The function to merge messages.
|
|
27
|
+
*/
|
|
28
|
+
postprocess?: PostProcess;
|
|
29
|
+
/**
|
|
30
|
+
* The function to extract code blocks.
|
|
31
|
+
*/
|
|
32
|
+
preprocess?: PreProcess;
|
|
33
|
+
/**
|
|
34
|
+
* If `true` then it means the processor supports autofix.
|
|
35
|
+
*/
|
|
36
|
+
supportsAutofix?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A loose definition of the ParserModule type for use with configs
|
|
40
|
+
* This type intended to relax validation of configs so that parsers that have
|
|
41
|
+
* different AST types or scope managers can still be passed to configs
|
|
42
|
+
*
|
|
43
|
+
* @see {@link LooseRuleDefinition}, {@link LooseParserModule}
|
|
44
|
+
*/
|
|
45
|
+
interface LooseProcessorModule {
|
|
46
|
+
/**
|
|
47
|
+
* Information about the processor to uniquely identify it when serializing.
|
|
48
|
+
*/
|
|
49
|
+
meta?: {
|
|
50
|
+
[K in keyof ProcessorMeta]?: ProcessorMeta[K] | undefined;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* The function to merge messages.
|
|
54
|
+
*/
|
|
55
|
+
postprocess?: (messagesList: any, filename: string) => any;
|
|
56
|
+
/**
|
|
57
|
+
* The function to extract code blocks.
|
|
58
|
+
*/
|
|
59
|
+
preprocess?: (text: string, filename: string) => any;
|
|
60
|
+
/**
|
|
61
|
+
* If `true` then it means the processor supports autofix.
|
|
62
|
+
*/
|
|
63
|
+
supportsAutofix?: boolean | undefined;
|
|
64
|
+
}
|
|
65
|
+
}
|