@interlace/eslint-devkit 2.1.1 → 2.2.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/aria-definitions.js +1 -1
- 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.docsUrlFor=exports.ESLintUtils=exports.createRule=void 0;exports.applyDefault=applyDefault;exports.isTestFilePath=isTestFilePath;exports.RuleCreator=RuleCreator;exports.createRuleCreator=createRuleCreator;exports.withCanonicalDocsUrls=withCanonicalDocsUrls;const generated_file_1=require("./generated-file");const minified_file_1=require("./minified-file");function isObjectNotArray(obj){return typeof obj==="object"&&obj!=null&&!Array.isArray(obj)}function deepMerge(first,second){const keys=new Set([...Object.keys(first),...Object.keys(second)]);return Object.fromEntries([...keys].map(key=>{const firstHasKey=key in first;const secondHasKey=key in second;const firstValue=first[key];const secondValue=second[key];if(firstHasKey&&secondHasKey){return[key,isObjectNotArray(firstValue)&&isObjectNotArray(secondValue)?deepMerge(firstValue,secondValue):secondValue]}return[key,firstHasKey?firstValue:secondValue]}))}function applyDefault(defaultOptions,userOptions){const options=structuredClone(defaultOptions);if(userOptions==null){return options}options.forEach((opt,i)=>{if(userOptions[i]!==void 0){const userOpt=userOptions[i];options[i]=isObjectNotArray(userOpt)&&isObjectNotArray(opt)?deepMerge(opt,userOpt):userOpt}});return options}const TEST_DIR_SEGMENTS=new Set(["__tests__","__test__","test","tests","spec","specs","e2e","__mocks__","mocks","fixtures","__fixtures__"]);const TEST_BASENAME=/\.(test|spec|fixture|mock|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.docsUrlFor=exports.ESLintUtils=exports.createRule=void 0;exports.applyDefault=applyDefault;exports.isTestFilePath=isTestFilePath;exports.RuleCreator=RuleCreator;exports.createRuleCreator=createRuleCreator;exports.withCanonicalDocsUrls=withCanonicalDocsUrls;const generated_file_1=require("./generated-file");const minified_file_1=require("./minified-file");function isObjectNotArray(obj){return typeof obj==="object"&&obj!=null&&!Array.isArray(obj)}function deepMerge(first,second){const keys=new Set([...Object.keys(first),...Object.keys(second)]);return Object.fromEntries([...keys].map(key=>{const firstHasKey=key in first;const secondHasKey=key in second;const firstValue=first[key];const secondValue=second[key];if(firstHasKey&&secondHasKey){return[key,isObjectNotArray(firstValue)&&isObjectNotArray(secondValue)?deepMerge(firstValue,secondValue):secondValue]}return[key,firstHasKey?firstValue:secondValue]}))}function applyDefault(defaultOptions,userOptions){const options=structuredClone(defaultOptions);if(userOptions==null){return options}options.forEach((opt,i)=>{if(userOptions[i]!==void 0){const userOpt=userOptions[i];options[i]=isObjectNotArray(userOpt)&&isObjectNotArray(opt)?deepMerge(opt,userOpt):userOpt}});return options}const TEST_DIR_SEGMENTS=new Set(["__tests__","__test__","test","tests","spec","specs","e2e","__mocks__","mocks","fixtures","__fixtures__"]);const TEST_BASENAME=/\.(?:(?:[a-z0-9]+[-_])?(?:test|spec)|fixture|mock|stories|story)\.[cm]?[jt]sx?$/;const TEST_DIR_SUFFIX=/[-_](tests?|specs?)$/;const TEST_SUPPORT_DIR=/^test(?:[-_]?(?:utils?|helpers?|support|data|doubles?|factories|fixtures?|setup))$|^testing$/i;function isTestFilePath(filename){if(!filename||filename==="<input>"||filename==="<text>")return false;const slash=Math.max(filename.lastIndexOf("/"),filename.lastIndexOf("\\"));if(TEST_BASENAME.test(filename.slice(slash+1)))return true;if(slash<0)return false;return filename.slice(0,slash).split(/[\\/]/).some(segment=>TEST_DIR_SEGMENTS.has(segment)||TEST_DIR_SUFFIX.test(segment)||TEST_SUPPORT_DIR.test(segment))}function createRuleInternal(rule){const{defaultOptions,meta,name}=rule;const{skipTestFiles,skipGeneratedFiles,skipMinifiedFiles}=rule;const resolvedDefaultOptions=defaultOptions??[];const skipsFile=context=>skipTestFiles&&isTestFilePath(context.filename)||skipGeneratedFiles&&(0,generated_file_1.isGeneratedFile)(context.sourceCode)||skipMinifiedFiles&&(0,minified_file_1.isMinifiedFile)(context.sourceCode);const module={defaultOptions:resolvedDefaultOptions,meta,name};const{createOnce}=rule;if(!createOnce){const{create}=rule;module.create=context=>skipsFile(context)?{}:create(context,applyDefault(resolvedDefaultOptions,context.options));return module}module.createOnce=raw=>{const context=raw;let options=resolvedDefaultOptions;const{before,...visitor}=createOnce(context,()=>options);return{...visitor,before(){if(skipsFile(context))return false;options=applyDefault(resolvedDefaultOptions,context.options);return before?.()}}};module.create=context=>{if(skipsFile(context))return{};const options=applyDefault(resolvedDefaultOptions,context.options);const{before,after,...visitor}=createOnce(context,()=>options);if(before?.()===false)return{};if(!after)return visitor;const exit=visitor["Program:exit"];return{...visitor,"Program:exit"(node){exit?.(node);after()}}};return module}function RuleCreator(urlCreator){return({meta,name,...rule})=>createRuleInternal({meta:{...meta,docs:{...meta.docs,url:urlCreator(name)}},name,...rule})}RuleCreator.withoutDocs=args=>createRuleInternal(args);function createRuleCreator(urlCreator){return RuleCreator(urlCreator)}exports.createRule=RuleCreator(()=>void 0);exports.ESLintUtils={RuleCreator,applyDefault};const PLUGIN_DOCS_CATEGORY={"plugin-anthropic-security":"security","plugin-gemini-security":"security","plugin-mcp-sdk-security":"security","plugin-supabase-security":"security","plugin-openai-security":"security","plugin-browser-security":"security","plugin-drizzle-security":"security","plugin-express-security":"security","plugin-jwt-security":"security","plugin-knex-security":"security","plugin-lambda-security":"security","plugin-mongodb-security":"security","plugin-mysql-security":"security","plugin-nestjs-security":"security","plugin-node-security":"security","plugin-postgresql-security":"security","plugin-prisma-security":"security","plugin-secure-coding":"security","plugin-sequelize-security":"security","plugin-sqlite-security":"security","plugin-typeorm-security":"security","plugin-vercel-ai-security":"security","plugin-cli-floor":"quality","plugin-conventions":"quality","plugin-import-next":"quality","plugin-maintainability":"quality","plugin-modernization":"quality","plugin-modularity":"quality","plugin-operability":"quality","plugin-react-a11y":"quality","plugin-react-features":"quality","plugin-reliability":"quality"};const docsUrlFor=(pluginSlug,ruleName)=>{const category=PLUGIN_DOCS_CATEGORY[pluginSlug];return category?`https://eslint.interlace.tools/docs/${category}/${pluginSlug}/rules/${ruleName}`:null};exports.docsUrlFor=docsUrlFor;function withCanonicalDocsUrls(pluginSlug,rules){if(!PLUGIN_DOCS_CATEGORY[pluginSlug]){console.warn(`[eslint-devkit] withCanonicalDocsUrls('${pluginSlug}'): slug is not registered in PLUGIN_DOCS_CATEGORY, so no rule in this plugin gets a meta.docs.url. Register it in packages/eslint-devkit/src/rule-creation/rule-creator.ts.`)}for(const name of Object.keys(rules)){const descriptor=Object.getOwnPropertyDescriptor(rules,name);const{get}=descriptor;if(get){Object.defineProperty(rules,name,{...descriptor,get(){const rule=get.call(this);stampDocsUrl(pluginSlug,name,rule);return rule}});continue}stampDocsUrl(pluginSlug,name,descriptor.value)}return rules}function stampDocsUrl(pluginSlug,name,rule){const docs=rule?.meta?.docs;if(!docs)return;const url=(0,exports.docsUrlFor)(pluginSlug,name);if(url)docs.url=url}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* The logic is shared because the three SDKs differ only in the module name,
|
|
22
22
|
* the option names, and the remediation copy.
|
|
23
23
|
*/
|
|
24
|
-
import type { TSESTree } from '
|
|
24
|
+
import type { TSESTree } from '../types/estree/utils/index';
|
|
25
25
|
export interface SdkApiKeyRuleConfig {
|
|
26
26
|
/** Rule id, e.g. `no-hardcoded-api-key`. */
|
|
27
27
|
ruleName: string;
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* given, or `undefined` — whenever a binding is reassigned, imported from a
|
|
32
32
|
* file it cannot see, or a parameter.
|
|
33
33
|
*/
|
|
34
|
-
import type { TSESLint, TSESTree } from '
|
|
34
|
+
import type { TSESLint, TSESTree } from '../types/estree/utils/index';
|
|
35
35
|
type SourceCode = Readonly<TSESLint.SourceCode>;
|
|
36
36
|
type Variable = TSESLint.Scope.Variable;
|
|
37
37
|
/** How many bindings a single question may follow before it gives up. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TSESLint } from '
|
|
1
|
+
import type { TSESLint } from '../types/estree/utils/index';
|
|
2
2
|
/** Message ids every rule built by this factory reports. */
|
|
3
3
|
export type SqlInjectionMessageIds = 'noUnsafeQuery' | 'unsafeTemplateLiteral';
|
|
4
4
|
/** A raw-SQL fragment sink: a method whose argument at `arg` is SQL text. */
|
|
@@ -132,6 +132,12 @@ export interface SqlInjectionRuleConfig {
|
|
|
132
132
|
}
|
|
133
133
|
/** Whether a string's static half reads as a SQL statement. */
|
|
134
134
|
export declare function looksLikeSqlStatement(text: string): boolean;
|
|
135
|
+
/**
|
|
136
|
+
* The rule createSqlInjectionRule returns, by a name plugins can reach through
|
|
137
|
+
* `@interlace/eslint-devkit`: a plugin's declarations then refer to this
|
|
138
|
+
* alias instead of to devkit's vendored typescript-eslint types.
|
|
139
|
+
*/
|
|
140
|
+
export type SqlInjectionRule = TSESLint.RuleModule<SqlInjectionMessageIds, []>;
|
|
135
141
|
/**
|
|
136
142
|
* Build a CWE-89 rule for the given sinks and remediation copy.
|
|
137
143
|
*
|
|
@@ -141,4 +147,4 @@ export declare function looksLikeSqlStatement(text: string): boolean;
|
|
|
141
147
|
* itself; and either of those passed to a same-file helper that forwards the
|
|
142
148
|
* argument into a sink.
|
|
143
149
|
*/
|
|
144
|
-
export declare function createSqlInjectionRule(config: SqlInjectionRuleConfig):
|
|
150
|
+
export declare function createSqlInjectionRule(config: SqlInjectionRuleConfig): SqlInjectionRule;
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* the inbound request — `ORDER BY ${req.query.sort}` — not merely because it
|
|
19
19
|
* is unproven.
|
|
20
20
|
*/
|
|
21
|
-
import type { TSESTree } from '
|
|
21
|
+
import type { TSESTree } from '../types/estree/utils/index';
|
|
22
22
|
import { type Env } from './value-follow';
|
|
23
23
|
/** One interpolated value, with the SQL text written before it. */
|
|
24
24
|
export interface SqlHole {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
* Anything else — a parameter, request data, an unknown call — is unproven,
|
|
34
34
|
* and an unproven value in a raw SQL string is the finding.
|
|
35
35
|
*/
|
|
36
|
-
import type { TSESTree } from '
|
|
36
|
+
import type { TSESTree } from '../types/estree/utils/index';
|
|
37
37
|
import { type OriginClassifier } from './driver-origin';
|
|
38
38
|
import { type Value } from './value-follow';
|
|
39
39
|
export interface SqlSafetyOptions {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
4
|
* MIT license that can be found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
|
-
import type { TSESLint, TSESTree } from '
|
|
6
|
+
import type { TSESLint, TSESTree } from '../types/estree/utils/index';
|
|
7
7
|
type SourceCode = Readonly<TSESLint.SourceCode>;
|
|
8
8
|
/**
|
|
9
9
|
* Configuration for one vendor's instantiation of the CWE-1427 detector.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TSESLint, TSESTree } from '
|
|
1
|
+
import type { TSESLint, TSESTree } from '../types/estree/utils/index';
|
|
2
2
|
import { type Env } from './value-follow';
|
|
3
3
|
/** Message ids every rule built by this factory reports. */
|
|
4
4
|
export type UnscopedMutationMessageIds = 'unscopedMutation' | 'explicitTruncate';
|
|
@@ -171,7 +171,14 @@ export declare function driverBindings(program: TSESTree.Program, modules: reado
|
|
|
171
171
|
* `this.db.delete(t)` → `db`, since `this` carries no name of its own.
|
|
172
172
|
*/
|
|
173
173
|
export declare function receiverBaseName(node: TSESTree.MemberExpression): string | undefined;
|
|
174
|
-
|
|
174
|
+
/**
|
|
175
|
+
* The rule createUnscopedMutationRule returns, by a name plugins can reach through
|
|
176
|
+
* `@interlace/eslint-devkit`: a plugin's declarations then refer to this
|
|
177
|
+
* alias instead of to devkit's vendored typescript-eslint types.
|
|
178
|
+
*/
|
|
179
|
+
export type UnscopedMutationRule = TSESLint.RuleModule<UnscopedMutationMessageIds, [
|
|
180
|
+
]>;
|
|
181
|
+
export declare function createUnscopedMutationRule(config: UnscopedMutationRuleConfig): UnscopedMutationRule;
|
|
175
182
|
/** Does this receiver chain begin by naming a table (`x('t')`, `x.from('t')`)? */
|
|
176
183
|
export declare function startsWithTable(receiver: TSESTree.Node): boolean;
|
|
177
184
|
/** Is `node` inside any of `functions`? */
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License. Use of this source code is governed by the
|
|
4
4
|
* MIT license that can be found in the LICENSE file.
|
|
5
5
|
*/
|
|
6
|
-
import type { TSESLint, TSESTree } from '
|
|
6
|
+
import type { TSESLint, TSESTree } from '../types/estree/utils/index';
|
|
7
7
|
/** A parsed module on disk, with the scope analysis its own parser produced. */
|
|
8
8
|
export interface ModuleInfo {
|
|
9
9
|
readonly file: string;
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
* }
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
import type { TSESTree, TSESLint } from '
|
|
28
|
+
import type { TSESTree, TSESLint } from '../types/estree/utils/index';
|
|
29
29
|
/**
|
|
30
30
|
* Common sanitization function names
|
|
31
31
|
* These functions are typically used to sanitize/escape user input
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/project-service@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 { ProjectServiceOptions } from '../types/index';
|
|
4
|
+
import type * as ts from 'typescript/lib/tsserverlibrary';
|
|
5
|
+
/**
|
|
6
|
+
* Shortcut type to refer to TypeScript's server ProjectService.
|
|
7
|
+
*/
|
|
8
|
+
export type TypeScriptProjectService = ts.server.ProjectService;
|
|
9
|
+
/**
|
|
10
|
+
* A created Project Service instance, as well as metadata on its creation.
|
|
11
|
+
*/
|
|
12
|
+
export interface ProjectServiceAndMetadata {
|
|
13
|
+
/**
|
|
14
|
+
* Files allowed to be loaded from the default project, if any were specified.
|
|
15
|
+
*/
|
|
16
|
+
allowDefaultProject: string[] | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The performance.now() timestamp of the last reload of the project service.
|
|
19
|
+
*/
|
|
20
|
+
lastReloadTimestamp: number;
|
|
21
|
+
/**
|
|
22
|
+
* The maximum number of files that can be matched by the default project.
|
|
23
|
+
*/
|
|
24
|
+
maximumDefaultProjectFileMatchCount: number;
|
|
25
|
+
/**
|
|
26
|
+
* The created TypeScript Project Service instance.
|
|
27
|
+
*/
|
|
28
|
+
service: TypeScriptProjectService;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Settings to create a new Project Service instance with {@link createProjectService}.
|
|
32
|
+
*/
|
|
33
|
+
export interface CreateProjectServiceSettings {
|
|
34
|
+
/**
|
|
35
|
+
* Granular options to configure the project service.
|
|
36
|
+
*/
|
|
37
|
+
options?: ProjectServiceOptions;
|
|
38
|
+
/**
|
|
39
|
+
* How aggressively (and slowly) to parse JSDoc comments.
|
|
40
|
+
*/
|
|
41
|
+
jsDocParsingMode?: ts.JSDocParsingMode;
|
|
42
|
+
/**
|
|
43
|
+
* Root directory for the tsconfig.json file, if not the current directory.
|
|
44
|
+
*/
|
|
45
|
+
tsconfigRootDir?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Custom project service host.
|
|
48
|
+
*
|
|
49
|
+
* @default `ts.sys` with stub watchers
|
|
50
|
+
*/
|
|
51
|
+
host?: Partial<ts.server.ServerHost>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Creates a new Project Service instance, as well as metadata on its creation.
|
|
55
|
+
* @param settings Settings to create a new Project Service instance.
|
|
56
|
+
* @returns A new Project Service instance, as well as metadata on its creation.
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { createProjectService } from './index';
|
|
60
|
+
*
|
|
61
|
+
* const { service } = createProjectService();
|
|
62
|
+
*
|
|
63
|
+
* service.openClientFile('index.ts');
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
export declare function createProjectService({ host, jsDocParsingMode, options: optionsRaw, tsconfigRootDir, }?: CreateProjectServiceSettings): ProjectServiceAndMetadata;
|
|
67
|
+
export { type ProjectServiceOptions } from '../types/index';
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { SourceType, TSESTree } from '../types/index';
|
|
4
|
+
import type { Scope } from './scope';
|
|
5
|
+
import type { Variable } from './variable';
|
|
6
|
+
import { BlockScope, CatchScope, ClassScope, ConditionalTypeScope, ForScope, FunctionExpressionNameScope, FunctionScope, FunctionTypeScope, GlobalScope, MappedTypeScope, ModuleScope, SwitchScope, TSEnumScope, TSModuleScope, TypeScope, WithScope } from './scope';
|
|
7
|
+
import { ClassFieldInitializerScope } from './scope/ClassFieldInitializerScope';
|
|
8
|
+
import { ClassStaticBlockScope } from './scope/ClassStaticBlockScope';
|
|
9
|
+
interface ScopeManagerOptions {
|
|
10
|
+
globalReturn?: boolean;
|
|
11
|
+
impliedStrict?: boolean;
|
|
12
|
+
sourceType?: SourceType;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* @see https://eslint.org/docs/latest/developer-guide/scope-manager-interface#scopemanager-interface
|
|
16
|
+
*/
|
|
17
|
+
export declare class ScopeManager {
|
|
18
|
+
currentScope: Scope | null;
|
|
19
|
+
readonly declaredVariables: WeakMap<TSESTree.Node, Variable[]>;
|
|
20
|
+
/**
|
|
21
|
+
* The root scope
|
|
22
|
+
*/
|
|
23
|
+
globalScope: GlobalScope | null;
|
|
24
|
+
readonly nodeToScope: WeakMap<TSESTree.Node, Scope[]>;
|
|
25
|
+
/**
|
|
26
|
+
* All scopes
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
readonly scopes: Scope[];
|
|
30
|
+
constructor(options: ScopeManagerOptions);
|
|
31
|
+
isES6(): boolean;
|
|
32
|
+
isGlobalReturn(): boolean;
|
|
33
|
+
isImpliedStrict(): boolean;
|
|
34
|
+
isModule(): boolean;
|
|
35
|
+
isStrictModeSupported(): boolean;
|
|
36
|
+
get variables(): Variable[];
|
|
37
|
+
/**
|
|
38
|
+
* Get the variables that a given AST node defines. The gotten variables' `def[].node`/`def[].parent` property is the node.
|
|
39
|
+
* If the node does not define any variable, this returns an empty array.
|
|
40
|
+
* @param node An AST node to get their variables.
|
|
41
|
+
*/
|
|
42
|
+
getDeclaredVariables(node: TSESTree.Node): Variable[];
|
|
43
|
+
/**
|
|
44
|
+
* Get the scope of a given AST node. The gotten scope's `block` property is the node.
|
|
45
|
+
* This method never returns `function-expression-name` scope. If the node does not have their scope, this returns `null`.
|
|
46
|
+
*
|
|
47
|
+
* @param node An AST node to get their scope.
|
|
48
|
+
* @param inner If the node has multiple scopes, this returns the outermost scope normally.
|
|
49
|
+
* If `inner` is `true` then this returns the innermost scope.
|
|
50
|
+
*/
|
|
51
|
+
acquire(node: TSESTree.Node, inner?: boolean): Scope | null;
|
|
52
|
+
/**
|
|
53
|
+
* Adds dynamically created globals to the global scope and resolve their references.
|
|
54
|
+
* This method is called by ESLint.
|
|
55
|
+
* @param names Names of the globals to create
|
|
56
|
+
*/
|
|
57
|
+
addGlobals(names: string[]): void;
|
|
58
|
+
nestBlockScope(node: BlockScope['block']): BlockScope;
|
|
59
|
+
nestCatchScope(node: CatchScope['block']): CatchScope;
|
|
60
|
+
nestClassFieldInitializerScope(node: ClassFieldInitializerScope['block']): ClassFieldInitializerScope;
|
|
61
|
+
nestClassScope(node: ClassScope['block']): ClassScope;
|
|
62
|
+
nestClassStaticBlockScope(node: ClassStaticBlockScope['block']): ClassStaticBlockScope;
|
|
63
|
+
nestConditionalTypeScope(node: ConditionalTypeScope['block']): ConditionalTypeScope;
|
|
64
|
+
nestForScope(node: ForScope['block']): ForScope;
|
|
65
|
+
nestFunctionExpressionNameScope(node: FunctionExpressionNameScope['block']): FunctionExpressionNameScope;
|
|
66
|
+
nestFunctionScope(node: FunctionScope['block'], isMethodDefinition: boolean): FunctionScope;
|
|
67
|
+
nestFunctionTypeScope(node: FunctionTypeScope['block']): FunctionTypeScope;
|
|
68
|
+
nestGlobalScope(node: GlobalScope['block']): GlobalScope;
|
|
69
|
+
nestMappedTypeScope(node: MappedTypeScope['block']): MappedTypeScope;
|
|
70
|
+
nestModuleScope(node: ModuleScope['block']): ModuleScope;
|
|
71
|
+
nestSwitchScope(node: SwitchScope['block']): SwitchScope;
|
|
72
|
+
nestTSEnumScope(node: TSEnumScope['block']): TSEnumScope;
|
|
73
|
+
nestTSModuleScope(node: TSModuleScope['block']): TSModuleScope;
|
|
74
|
+
nestTypeScope(node: TypeScope['block']): TypeScope;
|
|
75
|
+
nestWithScope(node: WithScope['block']): WithScope;
|
|
76
|
+
}
|
|
77
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { Lib, SourceType, TSESTree } from '../types/index';
|
|
4
|
+
import type { ReferencerOptions } from './referencer';
|
|
5
|
+
import { ScopeManager } from './ScopeManager';
|
|
6
|
+
export interface AnalyzeOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Known visitor keys.
|
|
9
|
+
*/
|
|
10
|
+
childVisitorKeys?: ReferencerOptions['childVisitorKeys'];
|
|
11
|
+
/**
|
|
12
|
+
* Whether the whole script is executed under node.js environment.
|
|
13
|
+
* When enabled, the scope manager adds a function scope immediately following the global scope.
|
|
14
|
+
* Defaults to `false`.
|
|
15
|
+
*/
|
|
16
|
+
globalReturn?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Implied strict mode.
|
|
19
|
+
* Defaults to `false`.
|
|
20
|
+
*/
|
|
21
|
+
impliedStrict?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* The identifier that's used for JSX Element creation (after transpilation).
|
|
24
|
+
* This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement").
|
|
25
|
+
* Defaults to `"React"`.
|
|
26
|
+
*/
|
|
27
|
+
jsxPragma?: string | null;
|
|
28
|
+
/**
|
|
29
|
+
* The identifier that's used for JSX fragment elements (after transpilation).
|
|
30
|
+
* If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment).
|
|
31
|
+
* This should not be a member expression - just the root identifier (i.e. use "h" instead of "h.Fragment").
|
|
32
|
+
* Defaults to `null`.
|
|
33
|
+
*/
|
|
34
|
+
jsxFragmentName?: string | null;
|
|
35
|
+
/**
|
|
36
|
+
* The lib used by the project.
|
|
37
|
+
* This automatically defines a type variable for any types provided by the configured TS libs.
|
|
38
|
+
* Defaults to ['esnext'].
|
|
39
|
+
*
|
|
40
|
+
* https://www.typescriptlang.org/tsconfig#lib
|
|
41
|
+
*/
|
|
42
|
+
lib?: Lib[];
|
|
43
|
+
/**
|
|
44
|
+
* The source type of the script.
|
|
45
|
+
*/
|
|
46
|
+
sourceType?: SourceType;
|
|
47
|
+
/**
|
|
48
|
+
* @deprecated This option never did what it was intended for and will be removed in a future major release.
|
|
49
|
+
*/
|
|
50
|
+
emitDecoratorMetadata?: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Takes an AST and returns the analyzed scopes.
|
|
54
|
+
*/
|
|
55
|
+
export declare function analyze(tree: TSESTree.Program, providedOptions?: AnalyzeOptions): ScopeManager;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class CatchClauseDefinition extends DefinitionBase<DefinitionType.CatchClause, TSESTree.CatchClause, null, TSESTree.Identifier> {
|
|
7
|
+
readonly isTypeDefinition = false;
|
|
8
|
+
readonly isVariableDefinition = true;
|
|
9
|
+
constructor(name: TSESTree.Identifier, node: CatchClauseDefinition['node']);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class ClassNameDefinition extends DefinitionBase<DefinitionType.ClassName, TSESTree.ClassDeclaration | TSESTree.ClassExpression, null, TSESTree.Identifier> {
|
|
7
|
+
readonly isTypeDefinition = true;
|
|
8
|
+
readonly isVariableDefinition = true;
|
|
9
|
+
constructor(name: TSESTree.Identifier, node: ClassNameDefinition['node']);
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { CatchClauseDefinition } from './CatchClauseDefinition';
|
|
4
|
+
import type { ClassNameDefinition } from './ClassNameDefinition';
|
|
5
|
+
import type { FunctionNameDefinition } from './FunctionNameDefinition';
|
|
6
|
+
import type { ImplicitGlobalVariableDefinition } from './ImplicitGlobalVariableDefinition';
|
|
7
|
+
import type { ImportBindingDefinition } from './ImportBindingDefinition';
|
|
8
|
+
import type { ParameterDefinition } from './ParameterDefinition';
|
|
9
|
+
import type { TSEnumMemberDefinition } from './TSEnumMemberDefinition';
|
|
10
|
+
import type { TSEnumNameDefinition } from './TSEnumNameDefinition';
|
|
11
|
+
import type { TSModuleNameDefinition } from './TSModuleNameDefinition';
|
|
12
|
+
import type { TypeDefinition } from './TypeDefinition';
|
|
13
|
+
import type { VariableDefinition } from './VariableDefinition';
|
|
14
|
+
export type Definition = CatchClauseDefinition | ClassNameDefinition | FunctionNameDefinition | ImplicitGlobalVariableDefinition | ImportBindingDefinition | ParameterDefinition | TSEnumMemberDefinition | TSEnumNameDefinition | TSModuleNameDefinition | TypeDefinition | VariableDefinition;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { NodeWithParent, TSESTree } from '../../types/index';
|
|
4
|
+
import type { DefinitionType } from './DefinitionType';
|
|
5
|
+
export declare abstract class DefinitionBase<Type extends DefinitionType, Node extends NodeWithParent, Parent extends TSESTree.Node | null, Name extends TSESTree.Node> {
|
|
6
|
+
/**
|
|
7
|
+
* A unique ID for this instance - primarily used to help debugging and testing
|
|
8
|
+
*/
|
|
9
|
+
readonly $id: number;
|
|
10
|
+
readonly type: Type;
|
|
11
|
+
/**
|
|
12
|
+
* The `Identifier` node of this definition
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
readonly name: Name;
|
|
16
|
+
/**
|
|
17
|
+
* The enclosing node of the name.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
readonly node: Node;
|
|
21
|
+
/**
|
|
22
|
+
* the enclosing statement node of the identifier.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
readonly parent: Parent;
|
|
26
|
+
constructor(type: Type, name: Name, node: Node, parent: Parent);
|
|
27
|
+
/**
|
|
28
|
+
* `true` if the variable is valid in a type context, false otherwise
|
|
29
|
+
*/
|
|
30
|
+
abstract readonly isTypeDefinition: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* `true` if the variable is valid in a value context, false otherwise
|
|
33
|
+
*/
|
|
34
|
+
abstract readonly isVariableDefinition: boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export declare enum DefinitionType {
|
|
4
|
+
CatchClause = "CatchClause",
|
|
5
|
+
ClassName = "ClassName",
|
|
6
|
+
FunctionName = "FunctionName",
|
|
7
|
+
ImplicitGlobalVariable = "ImplicitGlobalVariable",
|
|
8
|
+
ImportBinding = "ImportBinding",
|
|
9
|
+
Parameter = "Parameter",
|
|
10
|
+
TSEnumName = "TSEnumName",
|
|
11
|
+
TSEnumMember = "TSEnumMemberName",
|
|
12
|
+
TSModuleName = "TSModuleName",
|
|
13
|
+
Type = "Type",
|
|
14
|
+
Variable = "Variable"
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class FunctionNameDefinition extends DefinitionBase<DefinitionType.FunctionName, TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSDeclareFunction | TSESTree.TSEmptyBodyFunctionExpression, null, TSESTree.Identifier> {
|
|
7
|
+
readonly isTypeDefinition = false;
|
|
8
|
+
readonly isVariableDefinition = true;
|
|
9
|
+
constructor(name: TSESTree.Identifier, node: FunctionNameDefinition['node']);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { NodeWithParent, TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class ImplicitGlobalVariableDefinition extends DefinitionBase<DefinitionType.ImplicitGlobalVariable, NodeWithParent, null, TSESTree.BindingName> {
|
|
7
|
+
readonly isTypeDefinition = false;
|
|
8
|
+
readonly isVariableDefinition = true;
|
|
9
|
+
constructor(name: TSESTree.BindingName, node: ImplicitGlobalVariableDefinition['node']);
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class ImportBindingDefinition extends DefinitionBase<DefinitionType.ImportBinding, TSESTree.ImportDefaultSpecifier | TSESTree.ImportNamespaceSpecifier | TSESTree.ImportSpecifier | TSESTree.TSImportEqualsDeclaration, TSESTree.ImportDeclaration | TSESTree.TSImportEqualsDeclaration, TSESTree.Identifier> {
|
|
7
|
+
readonly isTypeDefinition = true;
|
|
8
|
+
readonly isVariableDefinition = true;
|
|
9
|
+
constructor(name: TSESTree.Identifier, node: TSESTree.TSImportEqualsDeclaration, decl: TSESTree.TSImportEqualsDeclaration);
|
|
10
|
+
constructor(name: TSESTree.Identifier, node: Exclude<ImportBindingDefinition['node'], TSESTree.TSImportEqualsDeclaration>, decl: TSESTree.ImportDeclaration);
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class ParameterDefinition extends DefinitionBase<DefinitionType.Parameter, TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSDeclareFunction | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature, null, TSESTree.BindingName> {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the parameter definition is a part of a rest parameter.
|
|
9
|
+
*/
|
|
10
|
+
readonly isTypeDefinition = false;
|
|
11
|
+
readonly isVariableDefinition = true;
|
|
12
|
+
readonly rest: boolean;
|
|
13
|
+
constructor(name: TSESTree.BindingName, node: ParameterDefinition['node'], rest: boolean);
|
|
14
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class TSEnumMemberDefinition extends DefinitionBase<DefinitionType.TSEnumMember, TSESTree.TSEnumMember, null, TSESTree.Identifier | TSESTree.StringLiteral> {
|
|
7
|
+
readonly isTypeDefinition = true;
|
|
8
|
+
readonly isVariableDefinition = true;
|
|
9
|
+
constructor(name: TSESTree.Identifier | TSESTree.StringLiteral, node: TSEnumMemberDefinition['node']);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class TSEnumNameDefinition extends DefinitionBase<DefinitionType.TSEnumName, TSESTree.TSEnumDeclaration, null, TSESTree.Identifier> {
|
|
7
|
+
readonly isTypeDefinition = true;
|
|
8
|
+
readonly isVariableDefinition = true;
|
|
9
|
+
constructor(name: TSESTree.Identifier, node: TSEnumNameDefinition['node']);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class TSModuleNameDefinition extends DefinitionBase<DefinitionType.TSModuleName, TSESTree.TSModuleDeclaration, null, TSESTree.Identifier> {
|
|
7
|
+
readonly isTypeDefinition = true;
|
|
8
|
+
readonly isVariableDefinition = true;
|
|
9
|
+
constructor(name: TSESTree.Identifier, node: TSModuleNameDefinition['node']);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class TypeDefinition extends DefinitionBase<DefinitionType.Type, TSESTree.TSInterfaceDeclaration | TSESTree.TSMappedType | TSESTree.TSTypeAliasDeclaration | TSESTree.TSTypeParameter, null, TSESTree.Identifier> {
|
|
7
|
+
readonly isTypeDefinition = true;
|
|
8
|
+
readonly isVariableDefinition = false;
|
|
9
|
+
constructor(name: TSESTree.Identifier, node: TypeDefinition['node']);
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import { DefinitionBase } from './DefinitionBase';
|
|
5
|
+
import { DefinitionType } from './DefinitionType';
|
|
6
|
+
export declare class VariableDefinition extends DefinitionBase<DefinitionType.Variable, TSESTree.VariableDeclarator, TSESTree.VariableDeclaration, TSESTree.Identifier> {
|
|
7
|
+
readonly isTypeDefinition = false;
|
|
8
|
+
readonly isVariableDefinition = true;
|
|
9
|
+
constructor(name: TSESTree.Identifier, node: VariableDefinition['node'], decl: TSESTree.VariableDeclaration);
|
|
10
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export * from './CatchClauseDefinition';
|
|
4
|
+
export * from './ClassNameDefinition';
|
|
5
|
+
export * from './Definition';
|
|
6
|
+
export * from './DefinitionType';
|
|
7
|
+
export * from './FunctionNameDefinition';
|
|
8
|
+
export * from './ImplicitGlobalVariableDefinition';
|
|
9
|
+
export * from './ImportBindingDefinition';
|
|
10
|
+
export * from './ParameterDefinition';
|
|
11
|
+
export * from './TSEnumMemberDefinition';
|
|
12
|
+
export * from './TSEnumNameDefinition';
|
|
13
|
+
export * from './TSModuleNameDefinition';
|
|
14
|
+
export * from './TypeDefinition';
|
|
15
|
+
export * from './VariableDefinition';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@8.68.0 (MIT, Copyright JS Foundation and other contributors).
|
|
2
|
+
// Generated by scripts/vendor-estree-types.ts — do not edit; regenerate.
|
|
3
|
+
export { analyze, type AnalyzeOptions } from './analyze';
|
|
4
|
+
export * from './definition';
|
|
5
|
+
export { PatternVisitor, type PatternVisitorCallback, type PatternVisitorOptions, } from './referencer/PatternVisitor';
|
|
6
|
+
export { Reference } from './referencer/Reference';
|
|
7
|
+
export { Visitor } from './referencer/Visitor';
|
|
8
|
+
export * from './scope';
|
|
9
|
+
export { ScopeManager } from './ScopeManager';
|
|
10
|
+
export * from './variable';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// Vendored from @typescript-eslint/scope-manager@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 { TSESTree } from '../../types/index';
|
|
4
|
+
import type { VisitorOptions } from './VisitorBase';
|
|
5
|
+
import { VisitorBase } from './VisitorBase';
|
|
6
|
+
export type PatternVisitorCallback = (pattern: TSESTree.Identifier, info: {
|
|
7
|
+
assignments: (TSESTree.AssignmentExpression | TSESTree.AssignmentPattern)[];
|
|
8
|
+
rest: boolean;
|
|
9
|
+
topLevel: boolean;
|
|
10
|
+
}) => void;
|
|
11
|
+
export type PatternVisitorOptions = VisitorOptions;
|
|
12
|
+
export declare class PatternVisitor extends VisitorBase {
|
|
13
|
+
readonly rightHandNodes: TSESTree.Node[];
|
|
14
|
+
constructor(options: PatternVisitorOptions, rootPattern: TSESTree.Node, callback: PatternVisitorCallback);
|
|
15
|
+
static isPattern(node: TSESTree.Node): node is TSESTree.ArrayPattern | TSESTree.AssignmentPattern | TSESTree.Identifier | TSESTree.ObjectPattern | TSESTree.RestElement | TSESTree.SpreadElement;
|
|
16
|
+
}
|