Bump packages to fix linter
This commit is contained in:
parent
ed9506bbaf
commit
0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions
1212
node_modules/@typescript-eslint/experimental-utils/CHANGELOG.md
generated
vendored
1212
node_modules/@typescript-eslint/experimental-utils/CHANGELOG.md
generated
vendored
File diff suppressed because it is too large
Load diff
21
node_modules/@typescript-eslint/experimental-utils/LICENSE
generated
vendored
21
node_modules/@typescript-eslint/experimental-utils/LICENSE
generated
vendored
|
|
@ -1,21 +0,0 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2019 TypeScript ESLint and other contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
37
node_modules/@typescript-eslint/experimental-utils/README.md
generated
vendored
37
node_modules/@typescript-eslint/experimental-utils/README.md
generated
vendored
|
|
@ -1,37 +0,0 @@
|
|||
<h1 align="center">Utils for ESLint Plugins</h1>
|
||||
|
||||
<p align="center">Utilities for working with TypeScript + ESLint together.</p>
|
||||
|
||||
<p align="center">
|
||||
<img src="https://github.com/typescript-eslint/typescript-eslint/workflows/CI/badge.svg" alt="CI" />
|
||||
<a href="https://www.npmjs.com/package/@typescript-eslint/eslint-plugin"><img src="https://img.shields.io/npm/v/@typescript-eslint/eslint-plugin.svg?style=flat-square" alt="NPM Version" /></a>
|
||||
<a href="https://www.npmjs.com/package/@typescript-eslint/eslint-plugin"><img src="https://img.shields.io/npm/dm/@typescript-eslint/eslint-plugin.svg?style=flat-square" alt="NPM Downloads" /></a>
|
||||
</p>
|
||||
|
||||
## Note
|
||||
|
||||
This package has inherited its version number from the `@typescript-eslint` project.
|
||||
Meaning that even though this package is `2.x.y`, you shouldn't expect 100% stability between minor version bumps.
|
||||
i.e. treat it as a `0.x.y` package.
|
||||
|
||||
Feel free to use it now, and let us know what utilities you need or send us PRs with utilities you build on top of it.
|
||||
|
||||
Once it is stable, it will be renamed to `@typescript-eslint/util` for a `4.0.0` release.
|
||||
|
||||
## Exports
|
||||
|
||||
| Name | Description |
|
||||
| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| [`ASTUtils`](./src/ast-utils) | Tools for operating on the ESTree AST. Also includes the [`eslint-utils`](https://www.npmjs.com/package/eslint-utils) package, correctly typed to work with the types found in `TSESTree` |
|
||||
| [`ESLintUtils`](./src/eslint-utils) | Tools for creating ESLint rules with TypeScript. |
|
||||
| `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. |
|
||||
| [`TSESLint`](./src/ts-eslint) | Types for ESLint, correctly typed to work with the types found in `TSESTree`. |
|
||||
| [`TSESLintScope`](./src/ts-eslint-scope) | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` |
|
||||
| [`TSESTree`](../types/src/ts-estree.ts) | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. |
|
||||
| [`AST_NODE_TYPES`](../types/src/ast-node-types.ts) | An enum with the names of every single _node_ found in `TSESTree`. |
|
||||
| [`AST_TOKEN_TYPES`](../types/src/ast-token-types.ts) | An enum with the names of every single _token_ found in `TSESTree`. |
|
||||
| [`ParserServices`](../typescript-estree/src/parser-options.ts) | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. |
|
||||
|
||||
## Contributing
|
||||
|
||||
[See the contributing guide here](../../CONTRIBUTING.md)
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
interface PatternMatcher {
|
||||
/**
|
||||
* Iterate all matched parts in a given string.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-execall}
|
||||
*/
|
||||
execAll(str: string): IterableIterator<RegExpExecArray>;
|
||||
/**
|
||||
* Check whether this pattern matches a given string or not.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-test}
|
||||
*/
|
||||
test(str: string): boolean;
|
||||
/**
|
||||
* Replace all matched parts by a given replacer.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-symbol-replace}
|
||||
* @example
|
||||
* const { PatternMatcher } = require("eslint-utils")
|
||||
* const matcher = new PatternMatcher(/\\p{Script=Greek}/g)
|
||||
*
|
||||
* module.exports = {
|
||||
* meta: {},
|
||||
* create(context) {
|
||||
* return {
|
||||
* "Literal[regex]"(node) {
|
||||
* const replacedPattern = node.regex.pattern.replace(
|
||||
* matcher,
|
||||
* "[\\u0370-\\u0373\\u0375-\\u0377\\u037A-\\u037D\\u037F\\u0384\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03E1\\u03F0-\\u03FF\\u1D26-\\u1D2A\\u1D5D-\\u1D61\\u1D66-\\u1D6A\\u1DBF\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FC4\\u1FC6-\\u1FD3\\u1FD6-\\u1FDB\\u1FDD-\\u1FEF\\u1FF2-\\u1FF4\\u1FF6-\\u1FFE\\u2126\\uAB65]|\\uD800[\\uDD40-\\uDD8E\\uDDA0]|\\uD834[\\uDE00-\\uDE45]"
|
||||
* )
|
||||
* },
|
||||
* }
|
||||
* },
|
||||
* }
|
||||
*/
|
||||
[Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string;
|
||||
}
|
||||
/**
|
||||
* The class to find a pattern in strings as handling escape sequences.
|
||||
* It ignores the found pattern if it's escaped with `\`.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class}
|
||||
*/
|
||||
declare const PatternMatcher: new (pattern: RegExp, options?: {
|
||||
escaped?: boolean | undefined;
|
||||
} | undefined) => PatternMatcher;
|
||||
export { PatternMatcher };
|
||||
//# sourceMappingURL=PatternMatcher.d.ts.map
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
import { TSESTree } from '../../ts-estree';
|
||||
import * as TSESLint from '../../ts-eslint';
|
||||
declare const ReferenceTrackerREAD: unique symbol;
|
||||
declare const ReferenceTrackerCALL: unique symbol;
|
||||
declare const ReferenceTrackerCONSTRUCT: unique symbol;
|
||||
declare const ReferenceTrackerESM: unique symbol;
|
||||
interface ReferenceTracker {
|
||||
/**
|
||||
* Iterate the references that the given `traceMap` determined.
|
||||
* This method starts to search from global variables.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateglobalreferences}
|
||||
*/
|
||||
iterateGlobalReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
|
||||
/**
|
||||
* Iterate the references that the given `traceMap` determined.
|
||||
* This method starts to search from `require()` expression.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iteratecjsreferences}
|
||||
*/
|
||||
iterateCjsReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
|
||||
/**
|
||||
* Iterate the references that the given `traceMap` determined.
|
||||
* This method starts to search from `import`/`export` declarations.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateesmreferences}
|
||||
*/
|
||||
iterateEsmReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
|
||||
}
|
||||
interface ReferenceTrackerStatic {
|
||||
new (globalScope: TSESLint.Scope.Scope, options?: {
|
||||
/**
|
||||
* The mode which determines how the `tracker.iterateEsmReferences()` method scans CommonJS modules.
|
||||
* If this is `"strict"`, the method binds CommonJS modules to the default export. Otherwise, the method binds
|
||||
* CommonJS modules to both the default export and named exports. Optional. Default is `"strict"`.
|
||||
*/
|
||||
mode?: 'strict' | 'legacy';
|
||||
/**
|
||||
* The name list of Global Object. Optional. Default is `["global", "globalThis", "self", "window"]`.
|
||||
*/
|
||||
globalObjectNames?: readonly string[];
|
||||
}): ReferenceTracker;
|
||||
readonly READ: typeof ReferenceTrackerREAD;
|
||||
readonly CALL: typeof ReferenceTrackerCALL;
|
||||
readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT;
|
||||
readonly ESM: typeof ReferenceTrackerESM;
|
||||
}
|
||||
declare namespace ReferenceTracker {
|
||||
type READ = ReferenceTrackerStatic['READ'];
|
||||
type CALL = ReferenceTrackerStatic['CALL'];
|
||||
type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT'];
|
||||
type ESM = ReferenceTrackerStatic['ESM'];
|
||||
type ReferenceType = READ | CALL | CONSTRUCT;
|
||||
type TraceMap<T = any> = Record<string, TraceMapElement<T>>;
|
||||
interface TraceMapElement<T> {
|
||||
[ReferenceTrackerREAD]?: T;
|
||||
[ReferenceTrackerCALL]?: T;
|
||||
[ReferenceTrackerCONSTRUCT]?: T;
|
||||
[ReferenceTrackerESM]?: true;
|
||||
[key: string]: TraceMapElement<T>;
|
||||
}
|
||||
interface FoundReference<T = any> {
|
||||
node: TSESTree.Node;
|
||||
path: readonly string[];
|
||||
type: ReferenceType;
|
||||
entry: T;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class}
|
||||
*/
|
||||
declare const ReferenceTracker: ReferenceTrackerStatic;
|
||||
export { ReferenceTracker };
|
||||
//# sourceMappingURL=ReferenceTracker.d.ts.map
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
import * as TSESLint from '../../ts-eslint';
|
||||
import { TSESTree } from '../../ts-estree';
|
||||
/**
|
||||
* Get the proper location of a given function node to report.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionheadlocation}
|
||||
*/
|
||||
declare const getFunctionHeadLocation: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation;
|
||||
/**
|
||||
* Get the name and kind of a given function node.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionnamewithkind}
|
||||
*/
|
||||
declare const getFunctionNameWithKind: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression) => string;
|
||||
/**
|
||||
* Get the property name of a given property node.
|
||||
* If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getpropertyname}
|
||||
* @returns The property name of the node. If the property name is not constant then it returns `null`.
|
||||
*/
|
||||
declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.Property | TSESTree.MethodDefinition, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/Scope").Scope | undefined) => string | null;
|
||||
/**
|
||||
* Get the value of a given node if it can decide the value statically.
|
||||
* If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
|
||||
* given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
|
||||
* not been modified.
|
||||
* For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue}
|
||||
* @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
|
||||
* static value of the node, it returns `null`.
|
||||
*/
|
||||
declare const getStaticValue: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/Scope").Scope | undefined) => {
|
||||
value: unknown;
|
||||
} | null;
|
||||
/**
|
||||
* Get the string value of a given node.
|
||||
* This function is a tiny wrapper of the getStaticValue function.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstringifconstant}
|
||||
*/
|
||||
declare const getStringIfConstant: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/Scope").Scope | undefined) => string | null;
|
||||
/**
|
||||
* Check whether a given node has any side effect or not.
|
||||
* The side effect means that it may modify a certain variable or object member. This function considers the node which
|
||||
* contains the following types as the node which has side effects:
|
||||
* - `AssignmentExpression`
|
||||
* - `AwaitExpression`
|
||||
* - `CallExpression`
|
||||
* - `ImportExpression`
|
||||
* - `NewExpression`
|
||||
* - `UnaryExpression([operator = "delete"])`
|
||||
* - `UpdateExpression`
|
||||
* - `YieldExpression`
|
||||
* - When `options.considerGetters` is `true`:
|
||||
* - `MemberExpression`
|
||||
* - When `options.considerImplicitTypeConversion` is `true`:
|
||||
* - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
|
||||
* - `MemberExpression([computed = true])`
|
||||
* - `MethodDefinition([computed = true])`
|
||||
* - `Property([computed = true])`
|
||||
* - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#hassideeffect}
|
||||
*/
|
||||
declare const hasSideEffect: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode, options?: {
|
||||
considerGetters?: boolean | undefined;
|
||||
considerImplicitTypeConversion?: boolean | undefined;
|
||||
} | undefined) => boolean;
|
||||
declare const isParenthesized: {
|
||||
(node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
|
||||
(times: number, node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
|
||||
};
|
||||
export { getFunctionHeadLocation, getFunctionNameWithKind, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isParenthesized, };
|
||||
//# sourceMappingURL=astUtilities.d.ts.map
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
export * from './astUtilities';
|
||||
export * from './PatternMatcher';
|
||||
export * from './predicates';
|
||||
export * from './ReferenceTracker';
|
||||
export * from './scopeAnalysis';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
import { TSESTree } from '../../ts-estree';
|
||||
declare type IsSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is SpecificToken;
|
||||
declare type IsNotSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is Exclude<TSESTree.Token, SpecificToken>;
|
||||
declare type PunctuatorTokenWithValue<Value extends string> = TSESTree.PunctuatorToken & {
|
||||
value: Value;
|
||||
};
|
||||
declare type IsPunctuatorTokenWithValueFunction<Value extends string> = IsSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
|
||||
declare type IsNotPunctuatorTokenWithValueFunction<Value extends string> = IsNotSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
|
||||
declare const isArrowToken: IsPunctuatorTokenWithValueFunction<"=>">;
|
||||
declare const isNotArrowToken: IsNotPunctuatorTokenWithValueFunction<"=>">;
|
||||
declare const isClosingBraceToken: IsPunctuatorTokenWithValueFunction<"}">;
|
||||
declare const isNotClosingBraceToken: IsNotPunctuatorTokenWithValueFunction<"}">;
|
||||
declare const isClosingBracketToken: IsPunctuatorTokenWithValueFunction<"]">;
|
||||
declare const isNotClosingBracketToken: IsNotPunctuatorTokenWithValueFunction<"]">;
|
||||
declare const isClosingParenToken: IsPunctuatorTokenWithValueFunction<")">;
|
||||
declare const isNotClosingParenToken: IsNotPunctuatorTokenWithValueFunction<")">;
|
||||
declare const isColonToken: IsPunctuatorTokenWithValueFunction<":">;
|
||||
declare const isNotColonToken: IsNotPunctuatorTokenWithValueFunction<":">;
|
||||
declare const isCommaToken: IsPunctuatorTokenWithValueFunction<",">;
|
||||
declare const isNotCommaToken: IsNotPunctuatorTokenWithValueFunction<",">;
|
||||
declare const isCommentToken: IsSpecificTokenFunction<TSESTree.Comment>;
|
||||
declare const isNotCommentToken: IsNotSpecificTokenFunction<TSESTree.Comment>;
|
||||
declare const isOpeningBraceToken: IsPunctuatorTokenWithValueFunction<"{">;
|
||||
declare const isNotOpeningBraceToken: IsNotPunctuatorTokenWithValueFunction<"{">;
|
||||
declare const isOpeningBracketToken: IsPunctuatorTokenWithValueFunction<"[">;
|
||||
declare const isNotOpeningBracketToken: IsNotPunctuatorTokenWithValueFunction<"[">;
|
||||
declare const isOpeningParenToken: IsPunctuatorTokenWithValueFunction<"(">;
|
||||
declare const isNotOpeningParenToken: IsNotPunctuatorTokenWithValueFunction<"(">;
|
||||
declare const isSemicolonToken: IsPunctuatorTokenWithValueFunction<";">;
|
||||
declare const isNotSemicolonToken: IsNotPunctuatorTokenWithValueFunction<";">;
|
||||
export { isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isSemicolonToken, };
|
||||
//# sourceMappingURL=predicates.d.ts.map
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { TSESTree } from '../../ts-estree';
|
||||
import * as TSESLint from '../../ts-eslint';
|
||||
/**
|
||||
* Get the variable of a given name.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#findvariable}
|
||||
*/
|
||||
declare const findVariable: (initialScope: TSESLint.Scope.Scope, nameOrNode: string | TSESTree.Identifier) => TSESLint.Scope.Variable | null;
|
||||
/**
|
||||
* Get the innermost scope which contains a given node.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#getinnermostscope}
|
||||
* @returns The innermost scope which contains the given node.
|
||||
* If such scope doesn't exist then it returns the 1st argument `initialScope`.
|
||||
*/
|
||||
declare const getInnermostScope: (initialScope: TSESLint.Scope.Scope, node: TSESTree.Node) => TSESLint.Scope.Scope;
|
||||
export { findVariable, getInnermostScope };
|
||||
//# sourceMappingURL=scopeAnalysis.d.ts.map
|
||||
4
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/index.d.ts
generated
vendored
4
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/index.d.ts
generated
vendored
|
|
@ -1,4 +0,0 @@
|
|||
export * from './misc';
|
||||
export * from './predicates';
|
||||
export * from './eslint-utils';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
8
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/misc.d.ts
generated
vendored
8
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/misc.d.ts
generated
vendored
|
|
@ -1,8 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
declare const LINEBREAK_MATCHER: RegExp;
|
||||
/**
|
||||
* Determines whether two adjacent tokens are on the same line
|
||||
*/
|
||||
declare function isTokenOnSameLine(left: TSESTree.Token, right: TSESTree.Token): boolean;
|
||||
export { isTokenOnSameLine, LINEBREAK_MATCHER };
|
||||
//# sourceMappingURL=misc.d.ts.map
|
||||
84
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/predicates.d.ts
generated
vendored
84
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ast-utils/predicates.d.ts
generated
vendored
|
|
@ -1,84 +0,0 @@
|
|||
import { AST_NODE_TYPES, TSESTree } from '../ts-estree';
|
||||
declare function isOptionalChainPunctuator(token: TSESTree.Token): token is TSESTree.PunctuatorToken & {
|
||||
value: '?.';
|
||||
};
|
||||
declare function isNotOptionalChainPunctuator(token: TSESTree.Token): token is Exclude<TSESTree.Token, TSESTree.PunctuatorToken & {
|
||||
value: '?.';
|
||||
}>;
|
||||
declare function isNonNullAssertionPunctuator(token: TSESTree.Token): token is TSESTree.PunctuatorToken & {
|
||||
value: '!';
|
||||
};
|
||||
declare function isNotNonNullAssertionPunctuator(token: TSESTree.Token): token is Exclude<TSESTree.Token, TSESTree.PunctuatorToken & {
|
||||
value: '!';
|
||||
}>;
|
||||
/**
|
||||
* Returns true if and only if the node represents: foo?.() or foo.bar?.()
|
||||
*/
|
||||
declare const isOptionalCallExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.CallExpression & {
|
||||
type: AST_NODE_TYPES.CallExpression;
|
||||
} & {
|
||||
optional: true;
|
||||
};
|
||||
/**
|
||||
* Returns true if and only if the node represents logical OR
|
||||
*/
|
||||
declare const isLogicalOrOperator: (node: TSESTree.Node | null | undefined) => node is TSESTree.LogicalExpression & {
|
||||
type: AST_NODE_TYPES.LogicalExpression;
|
||||
} & {
|
||||
operator: "||";
|
||||
};
|
||||
/**
|
||||
* Checks if a node is a type assertion:
|
||||
* ```
|
||||
* x as foo
|
||||
* <foo>x
|
||||
* ```
|
||||
*/
|
||||
declare function isTypeAssertion(node: TSESTree.Node | undefined | null): node is TSESTree.TSAsExpression | TSESTree.TSTypeAssertion;
|
||||
declare const isVariableDeclarator: (node: TSESTree.Node | null | undefined) => node is TSESTree.VariableDeclarator & {
|
||||
type: AST_NODE_TYPES.VariableDeclarator;
|
||||
};
|
||||
declare function isFunction(node: TSESTree.Node | undefined): node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression;
|
||||
declare function isFunctionType(node: TSESTree.Node | undefined): node is TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature;
|
||||
declare function isFunctionOrFunctionType(node: TSESTree.Node | undefined): node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature;
|
||||
declare const isTSFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSFunctionType & {
|
||||
type: AST_NODE_TYPES.TSFunctionType;
|
||||
};
|
||||
declare const isTSConstructorType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSConstructorType & {
|
||||
type: AST_NODE_TYPES.TSConstructorType;
|
||||
};
|
||||
declare function isClassOrTypeElement(node: TSESTree.Node | undefined): node is TSESTree.ClassElement | TSESTree.TypeElement;
|
||||
/**
|
||||
* Checks if a node is a constructor method.
|
||||
*/
|
||||
declare const isConstructor: (node: TSESTree.Node | null | undefined) => node is (TSESTree.MethodDefinitionComputedName & {
|
||||
type: AST_NODE_TYPES.MethodDefinition;
|
||||
} & {
|
||||
kind: "constructor";
|
||||
}) | (TSESTree.MethodDefinitionNonComputedName & {
|
||||
type: AST_NODE_TYPES.MethodDefinition;
|
||||
} & {
|
||||
kind: "constructor";
|
||||
});
|
||||
/**
|
||||
* Checks if a node is a setter method.
|
||||
*/
|
||||
declare function isSetter(node: TSESTree.Node | undefined): node is TSESTree.MethodDefinition | TSESTree.Property;
|
||||
declare const isIdentifier: (node: TSESTree.Node | null | undefined) => node is TSESTree.Identifier & {
|
||||
type: AST_NODE_TYPES.Identifier;
|
||||
};
|
||||
/**
|
||||
* Checks if a node represents an `await …` expression.
|
||||
*/
|
||||
declare const isAwaitExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.AwaitExpression & {
|
||||
type: AST_NODE_TYPES.AwaitExpression;
|
||||
};
|
||||
/**
|
||||
* Checks if a possible token is the `await` keyword.
|
||||
*/
|
||||
declare function isAwaitKeyword(node: TSESTree.Token | undefined | null): node is TSESTree.IdentifierToken & {
|
||||
value: 'await';
|
||||
};
|
||||
declare function isLoop(node: TSESTree.Node | undefined | null): node is TSESTree.DoWhileStatement | TSESTree.ForStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.WhileStatement;
|
||||
export { isAwaitExpression, isAwaitKeyword, isConstructor, isClassOrTypeElement, isFunction, isFunctionOrFunctionType, isFunctionType, isIdentifier, isLoop, isLogicalOrOperator, isNonNullAssertionPunctuator, isNotNonNullAssertionPunctuator, isNotOptionalChainPunctuator, isOptionalChainPunctuator, isOptionalCallExpression, isSetter, isTSConstructorType, isTSFunctionType, isTypeAssertion, isVariableDeclarator, };
|
||||
//# sourceMappingURL=predicates.d.ts.map
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import { RuleCreateFunction, RuleModule } from '../ts-eslint';
|
||||
/**
|
||||
* Uses type inference to fetch the TOptions type from the given RuleModule
|
||||
*/
|
||||
declare type InferOptionsTypeFromRule<T> = T extends RuleModule<infer _TMessageIds, infer TOptions> ? TOptions : T extends RuleCreateFunction<infer _TMessageIds, infer TOptions> ? TOptions : unknown;
|
||||
/**
|
||||
* Uses type inference to fetch the TMessageIds type from the given RuleModule
|
||||
*/
|
||||
declare type InferMessageIdsTypeFromRule<T> = T extends RuleModule<infer TMessageIds, infer _TOptions> ? TMessageIds : T extends RuleCreateFunction<infer TMessageIds, infer _TOptions> ? TMessageIds : unknown;
|
||||
export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule };
|
||||
//# sourceMappingURL=InferTypesFromRule.d.ts.map
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
import { RuleMetaData, RuleMetaDataDocs, RuleListener, RuleContext, RuleModule } from '../ts-eslint/Rule';
|
||||
declare type CreateRuleMetaDocs = Pick<RuleMetaDataDocs, Exclude<keyof RuleMetaDataDocs, 'url'>>;
|
||||
declare type CreateRuleMeta<TMessageIds extends string> = {
|
||||
docs: CreateRuleMetaDocs;
|
||||
} & Pick<RuleMetaData<TMessageIds>, Exclude<keyof RuleMetaData<TMessageIds>, 'docs'>>;
|
||||
declare function RuleCreator(urlCreator: (ruleName: string) => string): <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends RuleListener = RuleListener>({ name, meta, defaultOptions, create, }: Readonly<{
|
||||
name: string;
|
||||
meta: CreateRuleMeta<TMessageIds>;
|
||||
defaultOptions: Readonly<TOptions>;
|
||||
create: (context: Readonly<RuleContext<TMessageIds, TOptions>>, optionsWithDefault: Readonly<TOptions>) => TRuleListener;
|
||||
}>) => RuleModule<TMessageIds, TOptions, TRuleListener>;
|
||||
export { RuleCreator };
|
||||
//# sourceMappingURL=RuleCreator.d.ts.map
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import * as TSESLint from '../ts-eslint';
|
||||
declare const parser = "@typescript-eslint/parser";
|
||||
declare type RuleTesterConfig = Pick<TSESLint.RuleTesterConfig, Exclude<keyof TSESLint.RuleTesterConfig, 'parser'>> & {
|
||||
parser: typeof parser;
|
||||
};
|
||||
declare class RuleTester extends TSESLint.RuleTester {
|
||||
private "RuleTester.#private";
|
||||
constructor(options: RuleTesterConfig);
|
||||
private getFilename;
|
||||
run<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(name: string, rule: TSESLint.RuleModule<TMessageIds, TOptions>, testsReadonly: TSESLint.RunTests<TMessageIds, TOptions>): void;
|
||||
}
|
||||
/**
|
||||
* Simple no-op tag to mark code samples as "should not format with prettier"
|
||||
* for the internal/plugin-test-formatting lint rule
|
||||
*/
|
||||
declare function noFormat(strings: TemplateStringsArray, ...keys: string[]): string;
|
||||
export { noFormat, RuleTester };
|
||||
//# sourceMappingURL=RuleTester.d.ts.map
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* Pure function - doesn't mutate either parameter!
|
||||
* Uses the default options and overrides with the options provided by the user
|
||||
* @param defaultOptions the defaults
|
||||
* @param userOptions the user opts
|
||||
* @returns the options with defaults
|
||||
*/
|
||||
declare function applyDefault<TUser extends readonly unknown[], TDefault extends TUser>(defaultOptions: Readonly<TDefault>, userOptions: Readonly<TUser> | null): TDefault;
|
||||
export { applyDefault };
|
||||
//# sourceMappingURL=applyDefault.d.ts.map
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
import { ValidTestCase, InvalidTestCase } from '../ts-eslint';
|
||||
/**
|
||||
* Converts a batch of single line tests into a number of separate test cases.
|
||||
* This makes it easier to write tests which use the same options.
|
||||
*
|
||||
* Why wouldn't you just leave them as one test?
|
||||
* Because it makes the test error messages harder to decipher.
|
||||
* This way each line will fail separately, instead of them all failing together.
|
||||
*/
|
||||
declare function batchedSingleLineTests<TOptions extends Readonly<unknown[]>>(test: ValidTestCase<TOptions>): ValidTestCase<TOptions>[];
|
||||
/**
|
||||
* Converts a batch of single line tests into a number of separate test cases.
|
||||
* This makes it easier to write tests which use the same options.
|
||||
*
|
||||
* Why wouldn't you just leave them as one test?
|
||||
* Because it makes the test error messages harder to decipher.
|
||||
* This way each line will fail separately, instead of them all failing together.
|
||||
*
|
||||
* Make sure you have your line numbers correct for error reporting, as it will match
|
||||
* the line numbers up with the split tests!
|
||||
*/
|
||||
declare function batchedSingleLineTests<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(test: InvalidTestCase<TMessageIds, TOptions>): InvalidTestCase<TMessageIds, TOptions>[];
|
||||
export { batchedSingleLineTests };
|
||||
//# sourceMappingURL=batchedSingleLineTests.d.ts.map
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
declare type ObjectLike<T = unknown> = Record<string, T>;
|
||||
/**
|
||||
* Check if the variable contains an object strictly rejecting arrays
|
||||
* @param obj an object
|
||||
* @returns `true` if obj is an object
|
||||
*/
|
||||
declare function isObjectNotArray<T extends ObjectLike>(obj: unknown | unknown[]): obj is T;
|
||||
/**
|
||||
* Pure function - doesn't mutate either parameter!
|
||||
* Merges two objects together deeply, overwriting the properties in first with the properties in second
|
||||
* @param first The first object
|
||||
* @param second The second object
|
||||
* @returns a new object
|
||||
*/
|
||||
export declare function deepMerge(first?: ObjectLike, second?: ObjectLike): Record<string, unknown>;
|
||||
export { isObjectNotArray };
|
||||
//# sourceMappingURL=deepMerge.d.ts.map
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
import * as TSESLint from '../ts-eslint';
|
||||
import { ParserServices } from '../ts-estree';
|
||||
/**
|
||||
* Try to retrieve typescript parser service from context
|
||||
*/
|
||||
declare function getParserServices<TMessageIds extends string, TOptions extends readonly unknown[]>(context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, allowWithoutFullTypeInformation?: boolean): ParserServices;
|
||||
export { getParserServices };
|
||||
//# sourceMappingURL=getParserServices.d.ts.map
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
export * from './applyDefault';
|
||||
export * from './batchedSingleLineTests';
|
||||
export * from './getParserServices';
|
||||
export * from './InferTypesFromRule';
|
||||
export * from './RuleCreator';
|
||||
export * from './RuleTester';
|
||||
export * from './deepMerge';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
8
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/index.d.ts
generated
vendored
8
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/index.d.ts
generated
vendored
|
|
@ -1,8 +0,0 @@
|
|||
import * as ASTUtils from './ast-utils';
|
||||
import * as ESLintUtils from './eslint-utils';
|
||||
import * as JSONSchema from './json-schema';
|
||||
import * as TSESLint from './ts-eslint';
|
||||
import * as TSESLintScope from './ts-eslint-scope';
|
||||
export { ASTUtils, ESLintUtils, JSONSchema, TSESLint, TSESLintScope };
|
||||
export * from './ts-estree';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
2
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/json-schema.d.ts
generated
vendored
2
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/json-schema.d.ts
generated
vendored
|
|
@ -1,2 +0,0 @@
|
|||
export { JSONSchema4, JSONSchema4Type, JSONSchema4TypeName, JSONSchema4Version, JSONSchema6, JSONSchema6Definition, JSONSchema6Type, JSONSchema6TypeName, JSONSchema6Version, JSONSchema7, JSONSchema7Array, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName, JSONSchema7Version, ValidationError, ValidationResult, } from 'json-schema';
|
||||
//# sourceMappingURL=json-schema.d.ts.map
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
interface Definition {
|
||||
type: string;
|
||||
name: TSESTree.BindingName;
|
||||
node: TSESTree.Node;
|
||||
parent?: TSESTree.Node | null;
|
||||
index?: number | null;
|
||||
kind?: string | null;
|
||||
rest?: boolean;
|
||||
}
|
||||
interface DefinitionConstructor {
|
||||
new (type: string, name: TSESTree.BindingName | TSESTree.PropertyName, node: TSESTree.Node, parent?: TSESTree.Node | null, index?: number | null, kind?: string | null): Definition;
|
||||
}
|
||||
declare const Definition: DefinitionConstructor;
|
||||
interface ParameterDefinition extends Definition {
|
||||
}
|
||||
declare const ParameterDefinition: DefinitionConstructor & (new (name: TSESTree.Node, node: TSESTree.Node, index?: number | null | undefined, rest?: boolean | undefined) => ParameterDefinition);
|
||||
export { Definition, ParameterDefinition };
|
||||
//# sourceMappingURL=Definition.d.ts.map
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
declare type PatternVisitorCallback = (pattern: TSESTree.Identifier, info: {
|
||||
rest: boolean;
|
||||
topLevel: boolean;
|
||||
assignments: TSESTree.AssignmentPattern[];
|
||||
}) => void;
|
||||
interface PatternVisitorOptions {
|
||||
processRightHandNodes?: boolean;
|
||||
}
|
||||
interface Visitor {
|
||||
visitChildren<T extends TSESTree.BaseNode | undefined | null>(node?: T): void;
|
||||
visit<T extends TSESTree.BaseNode | undefined | null>(node?: T): void;
|
||||
}
|
||||
export { PatternVisitorCallback, PatternVisitorOptions, Visitor };
|
||||
//# sourceMappingURL=Options.d.ts.map
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
import { ScopeManager } from './ScopeManager';
|
||||
import { PatternVisitorCallback, PatternVisitorOptions, Visitor } from './Options';
|
||||
interface PatternVisitor extends Visitor {
|
||||
options: PatternVisitorOptions;
|
||||
scopeManager: ScopeManager;
|
||||
parent?: TSESTree.Node;
|
||||
rightHandNodes: TSESTree.Node[];
|
||||
Identifier(pattern: TSESTree.Node): void;
|
||||
Property(property: TSESTree.Node): void;
|
||||
ArrayPattern(pattern: TSESTree.Node): void;
|
||||
AssignmentPattern(pattern: TSESTree.Node): void;
|
||||
RestElement(pattern: TSESTree.Node): void;
|
||||
MemberExpression(node: TSESTree.Node): void;
|
||||
SpreadElement(node: TSESTree.Node): void;
|
||||
ArrayExpression(node: TSESTree.Node): void;
|
||||
AssignmentExpression(node: TSESTree.Node): void;
|
||||
CallExpression(node: TSESTree.Node): void;
|
||||
}
|
||||
declare const PatternVisitor: {
|
||||
new (options: PatternVisitorOptions, rootPattern: TSESTree.BaseNode, callback: PatternVisitorCallback): PatternVisitor;
|
||||
isPattern(node: TSESTree.Node): boolean;
|
||||
};
|
||||
export { PatternVisitor };
|
||||
//# sourceMappingURL=PatternVisitor.d.ts.map
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
import { Scope } from './Scope';
|
||||
import { Variable } from './Variable';
|
||||
export declare type ReferenceFlag = 0x1 | 0x2 | 0x3;
|
||||
interface Reference {
|
||||
identifier: TSESTree.Identifier;
|
||||
from: Scope;
|
||||
resolved: Variable | null;
|
||||
writeExpr: TSESTree.Node | null;
|
||||
init: boolean;
|
||||
partial: boolean;
|
||||
__maybeImplicitGlobal: boolean;
|
||||
tainted?: boolean;
|
||||
typeMode?: boolean;
|
||||
isWrite(): boolean;
|
||||
isRead(): boolean;
|
||||
isWriteOnly(): boolean;
|
||||
isReadOnly(): boolean;
|
||||
isReadWrite(): boolean;
|
||||
}
|
||||
declare const Reference: {
|
||||
new (identifier: TSESTree.Identifier, scope: Scope, flag?: ReferenceFlag | undefined, writeExpr?: TSESTree.Node | null | undefined, maybeImplicitGlobal?: boolean | undefined, partial?: boolean | undefined, init?: boolean | undefined): Reference;
|
||||
READ: 0x1;
|
||||
WRITE: 0x2;
|
||||
RW: 0x3;
|
||||
};
|
||||
export { Reference };
|
||||
//# sourceMappingURL=Reference.d.ts.map
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
import { PatternVisitorCallback, PatternVisitorOptions, Visitor } from './Options';
|
||||
import { Scope } from './Scope';
|
||||
import { ScopeManager } from './ScopeManager';
|
||||
interface Referencer<SM extends ScopeManager> extends Visitor {
|
||||
isInnerMethodDefinition: boolean;
|
||||
options: any;
|
||||
scopeManager: SM;
|
||||
parent?: TSESTree.Node;
|
||||
currentScope(): Scope;
|
||||
close(node: TSESTree.Node): void;
|
||||
pushInnerMethodDefinition(isInnerMethodDefinition: boolean): boolean;
|
||||
popInnerMethodDefinition(isInnerMethodDefinition: boolean): void;
|
||||
referencingDefaultValue(pattern: any, assignments: any, maybeImplicitGlobal: any, init: boolean): void;
|
||||
visitPattern(node: TSESTree.Node, options: PatternVisitorOptions, callback: PatternVisitorCallback): void;
|
||||
visitFunction(node: TSESTree.Node): void;
|
||||
visitClass(node: TSESTree.Node): void;
|
||||
visitProperty(node: TSESTree.Node): void;
|
||||
visitForIn(node: TSESTree.Node): void;
|
||||
visitVariableDeclaration(variableTargetScope: any, type: any, node: TSESTree.Node, index: any): void;
|
||||
AssignmentExpression(node: TSESTree.Node): void;
|
||||
CatchClause(node: TSESTree.Node): void;
|
||||
Program(node: TSESTree.Program): void;
|
||||
Identifier(node: TSESTree.Identifier): void;
|
||||
UpdateExpression(node: TSESTree.Node): void;
|
||||
MemberExpression(node: TSESTree.Node): void;
|
||||
Property(node: TSESTree.Node): void;
|
||||
MethodDefinition(node: TSESTree.Node): void;
|
||||
BreakStatement(): void;
|
||||
ContinueStatement(): void;
|
||||
LabeledStatement(node: TSESTree.Node): void;
|
||||
ForStatement(node: TSESTree.Node): void;
|
||||
ClassExpression(node: TSESTree.Node): void;
|
||||
ClassDeclaration(node: TSESTree.Node): void;
|
||||
CallExpression(node: TSESTree.Node): void;
|
||||
BlockStatement(node: TSESTree.Node): void;
|
||||
ThisExpression(): void;
|
||||
WithStatement(node: TSESTree.Node): void;
|
||||
VariableDeclaration(node: TSESTree.Node): void;
|
||||
SwitchStatement(node: TSESTree.Node): void;
|
||||
FunctionDeclaration(node: TSESTree.Node): void;
|
||||
FunctionExpression(node: TSESTree.Node): void;
|
||||
ForOfStatement(node: TSESTree.Node): void;
|
||||
ForInStatement(node: TSESTree.Node): void;
|
||||
ArrowFunctionExpression(node: TSESTree.Node): void;
|
||||
ImportDeclaration(node: TSESTree.Node): void;
|
||||
visitExportDeclaration(node: TSESTree.Node): void;
|
||||
ExportDeclaration(node: TSESTree.Node): void;
|
||||
ExportNamedDeclaration(node: TSESTree.Node): void;
|
||||
ExportSpecifier(node: TSESTree.Node): void;
|
||||
MetaProperty(): void;
|
||||
}
|
||||
declare const Referencer: new <SM extends ScopeManager>(options: any, scopeManager: SM) => Referencer<SM>;
|
||||
export { Referencer };
|
||||
//# sourceMappingURL=Referencer.d.ts.map
|
||||
103
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts
generated
vendored
103
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint-scope/Scope.d.ts
generated
vendored
|
|
@ -1,103 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
import { Definition } from './Definition';
|
||||
import { Reference, ReferenceFlag } from './Reference';
|
||||
import { ScopeManager } from './ScopeManager';
|
||||
import { Variable } from './Variable';
|
||||
declare type ScopeType = 'block' | 'catch' | 'class' | 'for' | 'function' | 'function-expression-name' | 'global' | 'module' | 'switch' | 'with' | 'TDZ' | 'enum' | 'empty-function';
|
||||
interface Scope {
|
||||
type: ScopeType;
|
||||
isStrict: boolean;
|
||||
upper: Scope | null;
|
||||
childScopes: Scope[];
|
||||
variableScope: Scope;
|
||||
block: TSESTree.Node;
|
||||
variables: Variable[];
|
||||
set: Map<string, Variable>;
|
||||
references: Reference[];
|
||||
through: Reference[];
|
||||
thisFound?: boolean;
|
||||
taints: Map<string, boolean>;
|
||||
functionExpressionScope: boolean;
|
||||
__left: Reference[];
|
||||
__shouldStaticallyClose(scopeManager: ScopeManager): boolean;
|
||||
__shouldStaticallyCloseForGlobal(ref: any): boolean;
|
||||
__staticCloseRef(ref: any): void;
|
||||
__dynamicCloseRef(ref: any): void;
|
||||
__globalCloseRef(ref: any): void;
|
||||
__close(scopeManager: ScopeManager): Scope;
|
||||
__isValidResolution(ref: any, variable: any): variable is Variable;
|
||||
__resolve(ref: Reference): boolean;
|
||||
__delegateToUpperScope(ref: any): void;
|
||||
__addDeclaredVariablesOfNode(variable: any, node: TSESTree.Node): void;
|
||||
__defineGeneric(name: string, set: Map<string, Variable>, variables: Variable[], node: TSESTree.Identifier, def: Definition): void;
|
||||
__define(node: TSESTree.Node, def: Definition): void;
|
||||
__referencing(node: TSESTree.Node, assign?: ReferenceFlag, writeExpr?: TSESTree.Node, maybeImplicitGlobal?: any, partial?: any, init?: any): void;
|
||||
__detectEval(): void;
|
||||
__detectThis(): void;
|
||||
__isClosed(): boolean;
|
||||
/**
|
||||
* returns resolved {Reference}
|
||||
* @method Scope#resolve
|
||||
* @param {Espree.Identifier} ident - identifier to be resolved.
|
||||
* @returns {Reference} reference
|
||||
*/
|
||||
resolve(ident: TSESTree.Node): Reference;
|
||||
/**
|
||||
* returns this scope is static
|
||||
* @method Scope#isStatic
|
||||
* @returns {boolean} static
|
||||
*/
|
||||
isStatic(): boolean;
|
||||
/**
|
||||
* returns this scope has materialized arguments
|
||||
* @method Scope#isArgumentsMaterialized
|
||||
* @returns {boolean} arguments materialized
|
||||
*/
|
||||
isArgumentsMaterialized(): boolean;
|
||||
/**
|
||||
* returns this scope has materialized `this` reference
|
||||
* @method Scope#isThisMaterialized
|
||||
* @returns {boolean} this materialized
|
||||
*/
|
||||
isThisMaterialized(): boolean;
|
||||
isUsedName(name: any): boolean;
|
||||
}
|
||||
interface ScopeConstructor {
|
||||
new (scopeManager: ScopeManager, type: ScopeType, upperScope: Scope | null, block: TSESTree.Node | null, isMethodDefinition: boolean): Scope;
|
||||
}
|
||||
declare const Scope: ScopeConstructor;
|
||||
interface ScopeChildConstructorWithUpperScope<T> {
|
||||
new (scopeManager: ScopeManager, upperScope: Scope, block: TSESTree.Node | null): T;
|
||||
}
|
||||
interface GlobalScope extends Scope {
|
||||
}
|
||||
declare const GlobalScope: ScopeConstructor & (new (scopeManager: ScopeManager, block: TSESTree.Node | null) => GlobalScope);
|
||||
interface ModuleScope extends Scope {
|
||||
}
|
||||
declare const ModuleScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<ModuleScope>;
|
||||
interface FunctionExpressionNameScope extends Scope {
|
||||
}
|
||||
declare const FunctionExpressionNameScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<FunctionExpressionNameScope>;
|
||||
interface CatchScope extends Scope {
|
||||
}
|
||||
declare const CatchScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<CatchScope>;
|
||||
interface WithScope extends Scope {
|
||||
}
|
||||
declare const WithScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<WithScope>;
|
||||
interface BlockScope extends Scope {
|
||||
}
|
||||
declare const BlockScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<BlockScope>;
|
||||
interface SwitchScope extends Scope {
|
||||
}
|
||||
declare const SwitchScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<SwitchScope>;
|
||||
interface FunctionScope extends Scope {
|
||||
}
|
||||
declare const FunctionScope: ScopeConstructor & (new (scopeManager: ScopeManager, upperScope: Scope, block: TSESTree.Node | null, isMethodDefinition: boolean) => FunctionScope);
|
||||
interface ForScope extends Scope {
|
||||
}
|
||||
declare const ForScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<ForScope>;
|
||||
interface ClassScope extends Scope {
|
||||
}
|
||||
declare const ClassScope: ScopeConstructor & ScopeChildConstructorWithUpperScope<ClassScope>;
|
||||
export { ScopeType, Scope, GlobalScope, ModuleScope, FunctionExpressionNameScope, CatchScope, WithScope, BlockScope, SwitchScope, FunctionScope, ForScope, ClassScope, };
|
||||
//# sourceMappingURL=Scope.d.ts.map
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
import { EcmaVersion } from '../ts-eslint';
|
||||
import { Scope } from './Scope';
|
||||
import { Variable } from './Variable';
|
||||
interface ScopeManagerOptions {
|
||||
directive?: boolean;
|
||||
optimistic?: boolean;
|
||||
ignoreEval?: boolean;
|
||||
nodejsScope?: boolean;
|
||||
sourceType?: 'module' | 'script';
|
||||
impliedStrict?: boolean;
|
||||
ecmaVersion?: EcmaVersion;
|
||||
}
|
||||
interface ScopeManager {
|
||||
__options: ScopeManagerOptions;
|
||||
__currentScope: Scope;
|
||||
__nodeToScope: WeakMap<TSESTree.Node, Scope[]>;
|
||||
__declaredVariables: WeakMap<TSESTree.Node, Variable[]>;
|
||||
scopes: Scope[];
|
||||
globalScope: Scope;
|
||||
__useDirective(): boolean;
|
||||
__isOptimistic(): boolean;
|
||||
__ignoreEval(): boolean;
|
||||
__isNodejsScope(): boolean;
|
||||
isModule(): boolean;
|
||||
isImpliedStrict(): boolean;
|
||||
isStrictModeSupported(): boolean;
|
||||
__get(node: TSESTree.Node): Scope | undefined;
|
||||
getDeclaredVariables(node: TSESTree.Node): Variable[];
|
||||
acquire(node: TSESTree.Node, inner?: boolean): Scope | null;
|
||||
acquireAll(node: TSESTree.Node): Scope | null;
|
||||
release(node: TSESTree.Node, inner?: boolean): Scope | null;
|
||||
attach(): void;
|
||||
detach(): void;
|
||||
__nestScope<T extends Scope>(scope: T): T;
|
||||
__nestGlobalScope(node: TSESTree.Node): Scope;
|
||||
__nestBlockScope(node: TSESTree.Node): Scope;
|
||||
__nestFunctionScope(node: TSESTree.Node, isMethodDefinition: boolean): Scope;
|
||||
__nestForScope(node: TSESTree.Node): Scope;
|
||||
__nestCatchScope(node: TSESTree.Node): Scope;
|
||||
__nestWithScope(node: TSESTree.Node): Scope;
|
||||
__nestClassScope(node: TSESTree.Node): Scope;
|
||||
__nestSwitchScope(node: TSESTree.Node): Scope;
|
||||
__nestModuleScope(node: TSESTree.Node): Scope;
|
||||
__nestFunctionExpressionNameScope(node: TSESTree.Node): Scope;
|
||||
__isES6(): boolean;
|
||||
}
|
||||
declare const ScopeManager: new (options: ScopeManagerOptions) => ScopeManager;
|
||||
export { ScopeManager, ScopeManagerOptions };
|
||||
//# sourceMappingURL=ScopeManager.d.ts.map
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
import { Reference } from './Reference';
|
||||
import { Definition } from './Definition';
|
||||
import { Scope } from './Scope';
|
||||
interface Variable {
|
||||
name: string;
|
||||
identifiers: TSESTree.Identifier[];
|
||||
references: Reference[];
|
||||
defs: Definition[];
|
||||
eslintUsed?: boolean;
|
||||
stack?: unknown;
|
||||
tainted?: boolean;
|
||||
scope?: Scope;
|
||||
}
|
||||
declare const Variable: new () => Variable;
|
||||
export { Variable };
|
||||
//# sourceMappingURL=Variable.d.ts.map
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
import { EcmaVersion } from '../ts-eslint';
|
||||
import { TSESTree } from '../ts-estree';
|
||||
import { ScopeManager } from './ScopeManager';
|
||||
interface AnalysisOptions {
|
||||
optimistic?: boolean;
|
||||
directive?: boolean;
|
||||
ignoreEval?: boolean;
|
||||
nodejsScope?: boolean;
|
||||
impliedStrict?: boolean;
|
||||
fallback?: string | ((node: TSESTree.Node) => string[]);
|
||||
sourceType?: 'script' | 'module';
|
||||
ecmaVersion?: EcmaVersion;
|
||||
}
|
||||
declare const analyze: (ast: TSESTree.Node, options?: AnalysisOptions | undefined) => ScopeManager;
|
||||
export { analyze, AnalysisOptions };
|
||||
//# sourceMappingURL=analyze.d.ts.map
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
export * from './analyze';
|
||||
export * from './Definition';
|
||||
export * from './Options';
|
||||
export * from './PatternVisitor';
|
||||
export * from './Reference';
|
||||
export * from './Referencer';
|
||||
export * from './Scope';
|
||||
export * from './ScopeManager';
|
||||
export * from './Variable';
|
||||
export declare const version: string;
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
9
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/AST.d.ts
generated
vendored
9
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/AST.d.ts
generated
vendored
|
|
@ -1,9 +0,0 @@
|
|||
import { TSESTree, AST_TOKEN_TYPES } from '../ts-estree';
|
||||
declare namespace AST {
|
||||
type TokenType = AST_TOKEN_TYPES;
|
||||
type Token = TSESTree.Token;
|
||||
type SourceLocation = TSESTree.SourceLocation;
|
||||
type Range = TSESTree.Range;
|
||||
}
|
||||
export { AST };
|
||||
//# sourceMappingURL=AST.d.ts.map
|
||||
143
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts
generated
vendored
143
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/CLIEngine.d.ts
generated
vendored
|
|
@ -1,143 +0,0 @@
|
|||
import { Linter } from './Linter';
|
||||
import { RuleListener, RuleMetaData, RuleModule } from './Rule';
|
||||
declare class CLIEngineBase {
|
||||
/**
|
||||
* Creates a new instance of the core CLI engine.
|
||||
* @param providedOptions The options for this instance.
|
||||
*/
|
||||
constructor(options: CLIEngine.Options);
|
||||
/**
|
||||
* Add a plugin by passing its configuration
|
||||
* @param name Name of the plugin.
|
||||
* @param pluginObject Plugin configuration object.
|
||||
*/
|
||||
addPlugin(name: string, pluginObject: Linter.Plugin): void;
|
||||
/**
|
||||
* Executes the current configuration on an array of file and directory names.
|
||||
* @param patterns An array of file and directory names.
|
||||
* @returns The results for all files that were linted.
|
||||
*/
|
||||
executeOnFiles(patterns: string[]): CLIEngine.LintReport;
|
||||
/**
|
||||
* Executes the current configuration on text.
|
||||
* @param text A string of JavaScript code to lint.
|
||||
* @param filename An optional string representing the texts filename.
|
||||
* @param warnIgnored Always warn when a file is ignored
|
||||
* @returns The results for the linting.
|
||||
*/
|
||||
executeOnText(text: string, filename?: string, warnIgnored?: boolean): CLIEngine.LintReport;
|
||||
/**
|
||||
* Returns a configuration object for the given file based on the CLI options.
|
||||
* This is the same logic used by the ESLint CLI executable to determine configuration for each file it processes.
|
||||
* @param filePath The path of the file to retrieve a config object for.
|
||||
* @returns A configuration object for the file.
|
||||
*/
|
||||
getConfigForFile(filePath: string): Linter.Config;
|
||||
/**
|
||||
* Returns the formatter representing the given format.
|
||||
* @param format The name of the format to load or the path to a custom formatter.
|
||||
* @returns The formatter function.
|
||||
*/
|
||||
getFormatter(format?: string): CLIEngine.Formatter;
|
||||
/**
|
||||
* Checks if a given path is ignored by ESLint.
|
||||
* @param filePath The path of the file to check.
|
||||
* @returns Whether or not the given path is ignored.
|
||||
*/
|
||||
isPathIgnored(filePath: string): boolean;
|
||||
/**
|
||||
* Resolves the patterns passed into `executeOnFiles()` into glob-based patterns for easier handling.
|
||||
* @param patterns The file patterns passed on the command line.
|
||||
* @returns The equivalent glob patterns.
|
||||
*/
|
||||
resolveFileGlobPatterns(patterns: string[]): string[];
|
||||
getRules<TMessageIds extends string = string, TOptions extends readonly unknown[] = unknown[], TRuleListener extends RuleListener = RuleListener>(): Map<string, RuleModule<TMessageIds, TOptions, TRuleListener>>;
|
||||
/**
|
||||
* Returns results that only contains errors.
|
||||
* @param results The results to filter.
|
||||
* @returns The filtered results.
|
||||
*/
|
||||
static getErrorResults(results: CLIEngine.LintResult[]): CLIEngine.LintResult[];
|
||||
/**
|
||||
* Returns the formatter representing the given format or null if the `format` is not a string.
|
||||
* @param format The name of the format to load or the path to a custom formatter.
|
||||
* @returns The formatter function.
|
||||
*/
|
||||
static getFormatter(format?: string): CLIEngine.Formatter;
|
||||
/**
|
||||
* Outputs fixes from the given results to files.
|
||||
* @param report The report object created by CLIEngine.
|
||||
*/
|
||||
static outputFixes(report: CLIEngine.LintReport): void;
|
||||
static version: string;
|
||||
}
|
||||
declare namespace CLIEngine {
|
||||
interface Options {
|
||||
allowInlineConfig?: boolean;
|
||||
baseConfig?: false | {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
cache?: boolean;
|
||||
cacheFile?: string;
|
||||
cacheLocation?: string;
|
||||
configFile?: string;
|
||||
cwd?: string;
|
||||
envs?: string[];
|
||||
errorOnUnmatchedPattern?: boolean;
|
||||
extensions?: string[];
|
||||
fix?: boolean;
|
||||
globals?: string[];
|
||||
ignore?: boolean;
|
||||
ignorePath?: string;
|
||||
ignorePattern?: string | string[];
|
||||
useEslintrc?: boolean;
|
||||
parser?: string;
|
||||
parserOptions?: Linter.ParserOptions;
|
||||
plugins?: string[];
|
||||
resolvePluginsRelativeTo?: string;
|
||||
rules?: {
|
||||
[name: string]: Linter.RuleLevel | Linter.RuleLevelAndOptions;
|
||||
};
|
||||
rulePaths?: string[];
|
||||
reportUnusedDisableDirectives?: boolean;
|
||||
}
|
||||
interface LintResult {
|
||||
filePath: string;
|
||||
messages: Linter.LintMessage[];
|
||||
errorCount: number;
|
||||
warningCount: number;
|
||||
fixableErrorCount: number;
|
||||
fixableWarningCount: number;
|
||||
output?: string;
|
||||
source?: string;
|
||||
}
|
||||
interface LintReport {
|
||||
results: LintResult[];
|
||||
errorCount: number;
|
||||
warningCount: number;
|
||||
fixableErrorCount: number;
|
||||
fixableWarningCount: number;
|
||||
usedDeprecatedRules: DeprecatedRuleUse[];
|
||||
}
|
||||
interface DeprecatedRuleUse {
|
||||
ruleId: string;
|
||||
replacedBy: string[];
|
||||
}
|
||||
interface LintResultData<TMessageIds extends string> {
|
||||
rulesMeta: {
|
||||
[ruleId: string]: RuleMetaData<TMessageIds>;
|
||||
};
|
||||
}
|
||||
type Formatter = <TMessageIds extends string>(results: LintResult[], data?: LintResultData<TMessageIds>) => string;
|
||||
}
|
||||
declare const CLIEngine_base: typeof CLIEngineBase;
|
||||
/**
|
||||
* The underlying utility that runs the ESLint command line interface. This object will read the filesystem for
|
||||
* configuration and file information but will not output any results. Instead, it allows you direct access to the
|
||||
* important information so you can deal with the output yourself.
|
||||
* @deprecated use the ESLint class instead
|
||||
*/
|
||||
declare class CLIEngine extends CLIEngine_base {
|
||||
}
|
||||
export { CLIEngine };
|
||||
//# sourceMappingURL=CLIEngine.d.ts.map
|
||||
341
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ESLint.d.ts
generated
vendored
341
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/ESLint.d.ts
generated
vendored
|
|
@ -1,341 +0,0 @@
|
|||
import { Linter } from './Linter';
|
||||
declare class ESLintBase {
|
||||
/**
|
||||
* Creates a new instance of the main ESLint API.
|
||||
* @param options The options for this instance.
|
||||
*/
|
||||
constructor(options?: ESLint.ESLintOptions);
|
||||
/**
|
||||
* This method calculates the configuration for a given file, which can be useful for debugging purposes.
|
||||
* - It resolves and merges extends and overrides settings into the top level configuration.
|
||||
* - It resolves the parser setting to absolute paths.
|
||||
* - It normalizes the plugins setting to align short names. (e.g., eslint-plugin-foo → foo)
|
||||
* - It adds the processor setting if a legacy file extension processor is matched.
|
||||
* - It doesn't interpret the env setting to the globals and parserOptions settings, so the result object contains
|
||||
* the env setting as is.
|
||||
* @param filePath The path to the file whose configuration you would like to calculate. Directory paths are forbidden
|
||||
* because ESLint cannot handle the overrides setting.
|
||||
* @returns The promise that will be fulfilled with a configuration object.
|
||||
*/
|
||||
calculateConfigForFile(filePath: string): Promise<Linter.Config>;
|
||||
/**
|
||||
* This method checks if a given file is ignored by your configuration.
|
||||
* @param filePath The path to the file you want to check.
|
||||
* @returns The promise that will be fulfilled with whether the file is ignored or not. If the file is ignored, then
|
||||
* it will return true.
|
||||
*/
|
||||
isPathIgnored(filePath: string): Promise<boolean>;
|
||||
/**
|
||||
* This method lints the files that match the glob patterns and then returns the results.
|
||||
* @param patterns The lint target files. This can contain any of file paths, directory paths, and glob patterns.
|
||||
* @returns The promise that will be fulfilled with an array of LintResult objects.
|
||||
*/
|
||||
lintFiles(patterns: string | string[]): Promise<ESLint.LintResult[]>;
|
||||
/**
|
||||
* This method lints the given source code text and then returns the results.
|
||||
*
|
||||
* By default, this method uses the configuration that applies to files in the current working directory (the cwd
|
||||
* constructor option). If you want to use a different configuration, pass options.filePath, and ESLint will load the
|
||||
* same configuration that eslint.lintFiles() would use for a file at options.filePath.
|
||||
*
|
||||
* If the options.filePath value is configured to be ignored, this method returns an empty array. If the
|
||||
* options.warnIgnored option is set along with the options.filePath option, this method returns a LintResult object.
|
||||
* In that case, the result may contain a warning that indicates the file was ignored.
|
||||
* @param code The source code text to check.
|
||||
* @param options The options.
|
||||
* @returns The promise that will be fulfilled with an array of LintResult objects. This is an array (despite there
|
||||
* being only one lint result) in order to keep the interfaces between this and the eslint.lintFiles()
|
||||
* method similar.
|
||||
*/
|
||||
lintText(code: string, options?: ESLint.LintTextOptions): Promise<ESLint.LintResult[]>;
|
||||
/**
|
||||
* This method loads a formatter. Formatters convert lint results to a human- or machine-readable string.
|
||||
* @param name TThe path to the file you want to check.
|
||||
* The following values are allowed:
|
||||
* - undefined. In this case, loads the "stylish" built-in formatter.
|
||||
* - A name of built-in formatters.
|
||||
* - A name of third-party formatters. For examples:
|
||||
* -- `foo` will load eslint-formatter-foo.
|
||||
* -- `@foo` will load `@foo/eslint-formatter`.
|
||||
* -- `@foo/bar` will load `@foo/eslint-formatter-bar`.
|
||||
* - A path to the file that defines a formatter. The path must contain one or more path separators (/) in order to distinguish if it's a path or not. For example, start with ./.
|
||||
* @returns The promise that will be fulfilled with a Formatter object.
|
||||
*/
|
||||
loadFormatter(name?: string): Promise<ESLint.Formatter>;
|
||||
/**
|
||||
* This method copies the given results and removes warnings. The returned value contains only errors.
|
||||
* @param results The LintResult objects to filter.
|
||||
* @returns The filtered LintResult objects.
|
||||
*/
|
||||
static getErrorResults(results: ESLint.LintResult): ESLint.LintResult;
|
||||
/**
|
||||
* This method writes code modified by ESLint's autofix feature into its respective file. If any of the modified
|
||||
* files don't exist, this method does nothing.
|
||||
* @param results The LintResult objects to write.
|
||||
* @returns The promise that will be fulfilled after all files are written.
|
||||
*/
|
||||
static outputFixes(results: ESLint.LintResult): Promise<void>;
|
||||
/**
|
||||
* The version text.
|
||||
*/
|
||||
static readonly version: string;
|
||||
}
|
||||
declare namespace ESLint {
|
||||
interface ESLintOptions {
|
||||
/**
|
||||
* If false is present, ESLint suppresses directive comments in source code.
|
||||
* If this option is false, it overrides the noInlineConfig setting in your configurations.
|
||||
*/
|
||||
allowInlineConfig?: boolean;
|
||||
/**
|
||||
* Configuration object, extended by all configurations used with this instance.
|
||||
* You can use this option to define the default settings that will be used if your configuration files don't
|
||||
* configure it.
|
||||
*/
|
||||
baseConfig?: Linter.Config | null;
|
||||
/**
|
||||
* If true is present, the eslint.lintFiles() method caches lint results and uses it if each target file is not
|
||||
* changed. Please mind that ESLint doesn't clear the cache when you upgrade ESLint plugins. In that case, you have
|
||||
* to remove the cache file manually. The eslint.lintText() method doesn't use caches even if you pass the
|
||||
* options.filePath to the method.
|
||||
*/
|
||||
cache?: boolean;
|
||||
/**
|
||||
* The eslint.lintFiles() method writes caches into this file.
|
||||
*/
|
||||
cacheLocation?: string;
|
||||
/**
|
||||
* The working directory. This must be an absolute path.
|
||||
*/
|
||||
cwd?: string;
|
||||
/**
|
||||
* Unless set to false, the eslint.lintFiles() method will throw an error when no target files are found.
|
||||
*/
|
||||
errorOnUnmatchedPattern?: boolean;
|
||||
/**
|
||||
* If you pass directory paths to the eslint.lintFiles() method, ESLint checks the files in those directories that
|
||||
* have the given extensions. For example, when passing the src/ directory and extensions is [".js", ".ts"], ESLint
|
||||
* will lint *.js and *.ts files in src/. If extensions is null, ESLint checks *.js files and files that match
|
||||
* overrides[].files patterns in your configuration.
|
||||
* Note: This option only applies when you pass directory paths to the eslint.lintFiles() method.
|
||||
* If you pass glob patterns, ESLint will lint all files matching the glob pattern regardless of extension.
|
||||
*/
|
||||
extensions?: string[] | null;
|
||||
/**
|
||||
* If true is present, the eslint.lintFiles() and eslint.lintText() methods work in autofix mode.
|
||||
* If a predicate function is present, the methods pass each lint message to the function, then use only the
|
||||
* lint messages for which the function returned true.
|
||||
*/
|
||||
fix?: boolean | ((message: LintMessage) => boolean);
|
||||
/**
|
||||
* The types of the rules that the eslint.lintFiles() and eslint.lintText() methods use for autofix.
|
||||
*/
|
||||
fixTypes?: string[];
|
||||
/**
|
||||
* If false is present, the eslint.lintFiles() method doesn't interpret glob patterns.
|
||||
*/
|
||||
globInputPaths?: boolean;
|
||||
/**
|
||||
* If false is present, the eslint.lintFiles() method doesn't respect `.eslintignore` files or ignorePatterns in
|
||||
* your configuration.
|
||||
*/
|
||||
ignore?: boolean;
|
||||
/**
|
||||
* The path to a file ESLint uses instead of `$CWD/.eslintignore`.
|
||||
* If a path is present and the file doesn't exist, this constructor will throw an error.
|
||||
*/
|
||||
ignorePath?: string;
|
||||
/**
|
||||
* Configuration object, overrides all configurations used with this instance.
|
||||
* You can use this option to define the settings that will be used even if your configuration files configure it.
|
||||
*/
|
||||
overrideConfig?: Linter.ConfigOverride | null;
|
||||
/**
|
||||
* The path to a configuration file, overrides all configurations used with this instance.
|
||||
* The options.overrideConfig option is applied after this option is applied.
|
||||
*/
|
||||
overrideConfigFile?: string | null;
|
||||
/**
|
||||
* The plugin implementations that ESLint uses for the plugins setting of your configuration.
|
||||
* This is a map-like object. Those keys are plugin IDs and each value is implementation.
|
||||
*/
|
||||
plugins?: Record<string, Linter.Plugin> | null;
|
||||
/**
|
||||
* The severity to report unused eslint-disable directives.
|
||||
* If this option is a severity, it overrides the reportUnusedDisableDirectives setting in your configurations.
|
||||
*/
|
||||
reportUnusedDisableDirectives?: Linter.SeverityString | null;
|
||||
/**
|
||||
* The path to a directory where plugins should be resolved from.
|
||||
* If null is present, ESLint loads plugins from the location of the configuration file that contains the plugin
|
||||
* setting.
|
||||
* If a path is present, ESLint loads all plugins from there.
|
||||
*/
|
||||
resolvePluginsRelativeTo?: string | null;
|
||||
/**
|
||||
* An array of paths to directories to load custom rules from.
|
||||
*/
|
||||
rulePaths?: string[];
|
||||
/**
|
||||
* If false is present, ESLint doesn't load configuration files (.eslintrc.* files).
|
||||
* Only the configuration of the constructor options is valid.
|
||||
*/
|
||||
useEslintrc?: boolean;
|
||||
}
|
||||
interface DeprecatedRuleInfo {
|
||||
/**
|
||||
* The rule ID.
|
||||
*/
|
||||
ruleId: string;
|
||||
/**
|
||||
* The rule IDs that replace this deprecated rule.
|
||||
*/
|
||||
replacedBy: string[];
|
||||
}
|
||||
/**
|
||||
* The LintResult value is the information of the linting result of each file.
|
||||
*/
|
||||
interface LintResult {
|
||||
/**
|
||||
* The number of errors. This includes fixable errors.
|
||||
*/
|
||||
errorCount: number;
|
||||
/**
|
||||
* The absolute path to the file of this result. This is the string "<text>" if the file path is unknown (when you
|
||||
* didn't pass the options.filePath option to the eslint.lintText() method).
|
||||
*/
|
||||
filePath: string;
|
||||
/**
|
||||
* The number of errors that can be fixed automatically by the fix constructor option.
|
||||
*/
|
||||
fixableErrorCount: number;
|
||||
/**
|
||||
* The number of warnings that can be fixed automatically by the fix constructor option.
|
||||
*/
|
||||
fixableWarningCount: number;
|
||||
/**
|
||||
* The array of LintMessage objects.
|
||||
*/
|
||||
messages: Linter.LintMessage[];
|
||||
/**
|
||||
* The source code of the file that was linted, with as many fixes applied as possible.
|
||||
*/
|
||||
output?: string;
|
||||
/**
|
||||
* The original source code text. This property is undefined if any messages didn't exist or the output
|
||||
* property exists.
|
||||
*/
|
||||
source?: string;
|
||||
/**
|
||||
* The information about the deprecated rules that were used to check this file.
|
||||
*/
|
||||
usedDeprecatedRules: DeprecatedRuleInfo[];
|
||||
/**
|
||||
* The number of warnings. This includes fixable warnings.
|
||||
*/
|
||||
warningCount: number;
|
||||
}
|
||||
interface LintTextOptions {
|
||||
/**
|
||||
* The path to the file of the source code text. If omitted, the result.filePath becomes the string "<text>".
|
||||
*/
|
||||
filePath?: string;
|
||||
/**
|
||||
* If true is present and the options.filePath is a file ESLint should ignore, this method returns a lint result
|
||||
* contains a warning message.
|
||||
*/
|
||||
warnIgnored?: boolean;
|
||||
}
|
||||
/**
|
||||
* The LintMessage value is the information of each linting error.
|
||||
*/
|
||||
interface LintMessage {
|
||||
/**
|
||||
* The 1-based column number of the begin point of this message.
|
||||
*/
|
||||
column: number;
|
||||
/**
|
||||
* The 1-based column number of the end point of this message. This property is undefined if this message
|
||||
* is not a range.
|
||||
*/
|
||||
endColumn: number | undefined;
|
||||
/**
|
||||
* The 1-based line number of the end point of this message. This property is undefined if this
|
||||
* message is not a range.
|
||||
*/
|
||||
endLine: number | undefined;
|
||||
/**
|
||||
* The EditInfo object of autofix. This property is undefined if this message is not fixable.
|
||||
*/
|
||||
fix: EditInfo | undefined;
|
||||
/**
|
||||
* The 1-based line number of the begin point of this message.
|
||||
*/
|
||||
line: number;
|
||||
/**
|
||||
* The error message
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* The rule name that generates this lint message. If this message is generated by the ESLint core rather than
|
||||
* rules, this is null.
|
||||
*/
|
||||
ruleId: string | null;
|
||||
/**
|
||||
* The severity of this message. 1 means warning and 2 means error.
|
||||
*/
|
||||
severity: 1 | 2;
|
||||
/**
|
||||
* The list of suggestions. Each suggestion is the pair of a description and an EditInfo object to fix code. API
|
||||
* users such as editor integrations can choose one of them to fix the problem of this message. This property is
|
||||
* undefined if this message doesn't have any suggestions.
|
||||
*/
|
||||
suggestions: {
|
||||
desc: string;
|
||||
fix: EditInfo;
|
||||
}[] | undefined;
|
||||
}
|
||||
/**
|
||||
* The EditInfo value is information to edit text.
|
||||
*
|
||||
* This edit information means replacing the range of the range property by the text property value. It's like
|
||||
* sourceCodeText.slice(0, edit.range[0]) + edit.text + sourceCodeText.slice(edit.range[1]). Therefore, it's an add
|
||||
* if the range[0] and range[1] property values are the same value, and it's removal if the text property value is
|
||||
* empty string.
|
||||
*/
|
||||
interface EditInfo {
|
||||
/**
|
||||
* The pair of 0-based indices in source code text to remove.
|
||||
*/
|
||||
range: [
|
||||
number,
|
||||
number
|
||||
];
|
||||
/**
|
||||
* The text to add.
|
||||
*/
|
||||
text: string;
|
||||
}
|
||||
/**
|
||||
* The Formatter value is the object to convert the LintResult objects to text.
|
||||
*/
|
||||
interface Formatter {
|
||||
/**
|
||||
* The method to convert the LintResult objects to text
|
||||
*/
|
||||
format(results: LintResult[]): string;
|
||||
}
|
||||
}
|
||||
declare const _ESLint: typeof ESLintBase;
|
||||
/**
|
||||
* The ESLint class is the primary class to use in Node.js applications.
|
||||
* This class depends on the Node.js fs module and the file system, so you cannot use it in browsers.
|
||||
*
|
||||
* If you want to lint code on browsers, use the Linter class instead.
|
||||
*
|
||||
* @since 7.0.0
|
||||
*/
|
||||
declare class ESLint extends _ESLint {
|
||||
}
|
||||
export { ESLint };
|
||||
//# sourceMappingURL=ESLint.d.ts.map
|
||||
326
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Linter.d.ts
generated
vendored
326
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Linter.d.ts
generated
vendored
|
|
@ -1,326 +0,0 @@
|
|||
import { TSESTree, ParserServices } from '../ts-estree';
|
||||
import { ParserOptions as TSParserOptions } from './ParserOptions';
|
||||
import { RuleCreateFunction, RuleFix, RuleModule, SharedConfigurationSettings } from './Rule';
|
||||
import { Scope } from './Scope';
|
||||
import { SourceCode } from './SourceCode';
|
||||
declare class LinterBase {
|
||||
/**
|
||||
* Initialize the Linter.
|
||||
* @param config the config object
|
||||
*/
|
||||
constructor(config?: Linter.LinterOptions);
|
||||
/**
|
||||
* Define a new parser module
|
||||
* @param parserId Name of the parser
|
||||
* @param parserModule The parser object
|
||||
*/
|
||||
defineParser(parserId: string, parserModule: Linter.ParserModule): void;
|
||||
/**
|
||||
* Defines a new linting rule.
|
||||
* @param ruleId A unique rule identifier
|
||||
* @param ruleModule Function from context to object mapping AST node types to event handlers
|
||||
*/
|
||||
defineRule<TMessageIds extends string, TOptions extends readonly unknown[]>(ruleId: string, ruleModule: RuleModule<TMessageIds, TOptions> | RuleCreateFunction): void;
|
||||
/**
|
||||
* Defines many new linting rules.
|
||||
* @param rulesToDefine map from unique rule identifier to rule
|
||||
*/
|
||||
defineRules<TMessageIds extends string, TOptions extends readonly unknown[]>(rulesToDefine: Record<string, RuleModule<TMessageIds, TOptions> | RuleCreateFunction>): void;
|
||||
/**
|
||||
* Gets an object with all loaded rules.
|
||||
* @returns All loaded rules
|
||||
*/
|
||||
getRules(): Map<string, RuleModule<string, unknown[]>>;
|
||||
/**
|
||||
* Gets the `SourceCode` object representing the parsed source.
|
||||
* @returns The `SourceCode` object.
|
||||
*/
|
||||
getSourceCode(): SourceCode;
|
||||
/**
|
||||
* Verifies the text against the rules specified by the second argument.
|
||||
* @param textOrSourceCode The text to parse or a SourceCode object.
|
||||
* @param config An ESLintConfig instance to configure everything.
|
||||
* @param filenameOrOptions The optional filename of the file being checked.
|
||||
* If this is not set, the filename will default to '<input>' in the rule context.
|
||||
* If this is an object, then it has "filename", "allowInlineConfig", and some properties.
|
||||
* @returns The results as an array of messages or an empty array if no messages.
|
||||
*/
|
||||
verify(textOrSourceCode: SourceCode | string, config: Linter.Config, filenameOrOptions?: string | Linter.VerifyOptions): Linter.LintMessage[];
|
||||
/**
|
||||
* Performs multiple autofix passes over the text until as many fixes as possible have been applied.
|
||||
* @param text The source text to apply fixes to.
|
||||
* @param config The ESLint config object to use.
|
||||
* @param options The ESLint options object to use.
|
||||
* @returns The result of the fix operation as returned from the SourceCodeFixer.
|
||||
*/
|
||||
verifyAndFix(code: string, config: Linter.Config, options: Linter.FixOptions): Linter.FixReport;
|
||||
/**
|
||||
* The version from package.json.
|
||||
*/
|
||||
readonly version: string;
|
||||
/**
|
||||
* The version from package.json.
|
||||
*/
|
||||
static readonly version: string;
|
||||
}
|
||||
declare namespace Linter {
|
||||
export interface LinterOptions {
|
||||
/**
|
||||
* path to a directory that should be considered as the current working directory.
|
||||
*/
|
||||
cwd?: string;
|
||||
}
|
||||
export type Severity = 0 | 1 | 2;
|
||||
export type SeverityString = 'off' | 'warn' | 'error';
|
||||
export type RuleLevel = Severity | SeverityString;
|
||||
export type RuleLevelAndOptions = [
|
||||
RuleLevel,
|
||||
...unknown[]
|
||||
];
|
||||
export type RuleEntry = RuleLevel | RuleLevelAndOptions;
|
||||
export type RulesRecord = Partial<Record<string, RuleEntry>>;
|
||||
export type GlobalVariableOption = 'readonly' | 'writable' | 'off' | boolean;
|
||||
interface BaseConfig {
|
||||
$schema?: string;
|
||||
/**
|
||||
* The environment settings.
|
||||
*/
|
||||
env?: {
|
||||
[name: string]: boolean;
|
||||
};
|
||||
/**
|
||||
* The path to other config files or the package name of shareable configs.
|
||||
*/
|
||||
extends?: string | string[];
|
||||
/**
|
||||
* The global variable settings.
|
||||
*/
|
||||
globals?: {
|
||||
[name: string]: GlobalVariableOption;
|
||||
};
|
||||
/**
|
||||
* The flag that disables directive comments.
|
||||
*/
|
||||
noInlineConfig?: boolean;
|
||||
/**
|
||||
* The override settings per kind of files.
|
||||
*/
|
||||
overrides?: ConfigOverride[];
|
||||
/**
|
||||
* The path to a parser or the package name of a parser.
|
||||
*/
|
||||
parser?: string;
|
||||
/**
|
||||
* The parser options.
|
||||
*/
|
||||
parserOptions?: ParserOptions;
|
||||
/**
|
||||
* The plugin specifiers.
|
||||
*/
|
||||
plugins?: string[];
|
||||
/**
|
||||
* The processor specifier.
|
||||
*/
|
||||
processor?: string;
|
||||
/**
|
||||
* The flag to report unused `eslint-disable` comments.
|
||||
*/
|
||||
reportUnusedDisableDirectives?: boolean;
|
||||
/**
|
||||
* The rule settings.
|
||||
*/
|
||||
rules?: RulesRecord;
|
||||
/**
|
||||
* The shared settings.
|
||||
*/
|
||||
settings?: SharedConfigurationSettings;
|
||||
}
|
||||
export interface ConfigOverride extends BaseConfig {
|
||||
excludedFiles?: string | string[];
|
||||
files: string | string[];
|
||||
}
|
||||
export interface Config extends BaseConfig {
|
||||
/**
|
||||
* The glob patterns that ignore to lint.
|
||||
*/
|
||||
ignorePatterns?: string | string[];
|
||||
/**
|
||||
* The root flag.
|
||||
*/
|
||||
root?: boolean;
|
||||
}
|
||||
export type ParserOptions = TSParserOptions;
|
||||
export interface VerifyOptions {
|
||||
/**
|
||||
* Allow/disallow inline comments' ability to change config once it is set. Defaults to true if not supplied.
|
||||
* Useful if you want to validate JS without comments overriding rules.
|
||||
*/
|
||||
allowInlineConfig?: boolean;
|
||||
/**
|
||||
* if `true` then the linter doesn't make `fix` properties into the lint result.
|
||||
*/
|
||||
disableFixes?: boolean;
|
||||
/**
|
||||
* the filename of the source code.
|
||||
*/
|
||||
filename?: string;
|
||||
/**
|
||||
* the predicate function that selects adopt code blocks.
|
||||
*/
|
||||
filterCodeBlock?: (filename: string, text: string) => boolean;
|
||||
/**
|
||||
* postprocessor for report messages.
|
||||
* If provided, this should accept an array of the message lists
|
||||
* for each code block returned from the preprocessor, apply a mapping to
|
||||
* the messages as appropriate, and return a one-dimensional array of
|
||||
* messages.
|
||||
*/
|
||||
postprocess?: Processor['postprocess'];
|
||||
/**
|
||||
* preprocessor for source text.
|
||||
* If provided, this should accept a string of source text, and return an array of code blocks to lint.
|
||||
*/
|
||||
preprocess?: Processor['preprocess'];
|
||||
/**
|
||||
* Adds reported errors for unused `eslint-disable` directives.
|
||||
*/
|
||||
reportUnusedDisableDirectives?: boolean | SeverityString;
|
||||
}
|
||||
export interface FixOptions extends VerifyOptions {
|
||||
/**
|
||||
* Determines whether fixes should be applied.
|
||||
*/
|
||||
fix?: boolean;
|
||||
}
|
||||
export interface LintSuggestion {
|
||||
desc: string;
|
||||
fix: RuleFix;
|
||||
messageId?: string;
|
||||
}
|
||||
export interface LintMessage {
|
||||
/**
|
||||
* The 1-based column number.
|
||||
*/
|
||||
column: number;
|
||||
/**
|
||||
* The 1-based column number of the end location.
|
||||
*/
|
||||
endColumn?: number;
|
||||
/**
|
||||
* The 1-based line number of the end location.
|
||||
*/
|
||||
endLine?: number;
|
||||
/**
|
||||
* If `true` then this is a fatal error.
|
||||
*/
|
||||
fatal?: true;
|
||||
/**
|
||||
* Information for autofix.
|
||||
*/
|
||||
fix?: RuleFix;
|
||||
/**
|
||||
* The 1-based line number.
|
||||
*/
|
||||
line: number;
|
||||
/**
|
||||
* The error message.
|
||||
*/
|
||||
message: string;
|
||||
messageId?: string;
|
||||
nodeType: string;
|
||||
/**
|
||||
* The ID of the rule which makes this message.
|
||||
*/
|
||||
ruleId: string | null;
|
||||
/**
|
||||
* The severity of this message.
|
||||
*/
|
||||
severity: Severity;
|
||||
source: string | null;
|
||||
/**
|
||||
* Information for suggestions
|
||||
*/
|
||||
suggestions?: LintSuggestion[];
|
||||
}
|
||||
export interface FixReport {
|
||||
/**
|
||||
* True, if the code was fixed
|
||||
*/
|
||||
fixed: boolean;
|
||||
/**
|
||||
* Fixed code text (might be the same as input if no fixes were applied).
|
||||
*/
|
||||
output: string;
|
||||
/**
|
||||
* Collection of all messages for the given code
|
||||
*/
|
||||
messages: LintMessage[];
|
||||
}
|
||||
export type ParserModule = {
|
||||
parse(text: string, options?: ParserOptions): TSESTree.Program;
|
||||
} | {
|
||||
parseForESLint(text: string, options?: ParserOptions): ESLintParseResult;
|
||||
};
|
||||
export interface ESLintParseResult {
|
||||
ast: TSESTree.Program;
|
||||
parserServices?: ParserServices;
|
||||
scopeManager?: Scope.ScopeManager;
|
||||
visitorKeys?: SourceCode.VisitorKeys;
|
||||
}
|
||||
export interface Processor {
|
||||
/**
|
||||
* The function to extract code blocks.
|
||||
*/
|
||||
preprocess?: (text: string, filename: string) => Array<string | {
|
||||
text: string;
|
||||
filename: string;
|
||||
}>;
|
||||
/**
|
||||
* The function to merge messages.
|
||||
*/
|
||||
postprocess?: (messagesList: Linter.LintMessage[][], filename: string) => Linter.LintMessage[];
|
||||
/**
|
||||
* If `true` then it means the processor supports autofix.
|
||||
*/
|
||||
supportsAutofix?: boolean;
|
||||
}
|
||||
export interface Environment {
|
||||
/**
|
||||
* The definition of global variables.
|
||||
*/
|
||||
globals?: Record<string, Linter.Config>;
|
||||
/**
|
||||
* The parser options that will be enabled under this environment.
|
||||
*/
|
||||
parserOptions?: ParserOptions;
|
||||
}
|
||||
export interface Plugin {
|
||||
/**
|
||||
* The definition of plugin configs.
|
||||
*/
|
||||
configs?: Record<string, Linter.Config>;
|
||||
/**
|
||||
* The definition of plugin environments.
|
||||
*/
|
||||
environments?: Record<string, Environment>;
|
||||
/**
|
||||
* The definition of plugin processors.
|
||||
*/
|
||||
processors?: Record<string, Processor>;
|
||||
/**
|
||||
* The definition of plugin rules.
|
||||
*/
|
||||
rules?: Record<string, RuleCreateFunction | RuleModule<string, unknown[]>>;
|
||||
}
|
||||
export {};
|
||||
}
|
||||
declare const Linter_base: typeof LinterBase;
|
||||
/**
|
||||
* The Linter object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it
|
||||
* simply parses and reports on the code. In particular, the Linter object does not process configuration objects
|
||||
* or files.
|
||||
*/
|
||||
declare class Linter extends Linter_base {
|
||||
}
|
||||
export { Linter };
|
||||
//# sourceMappingURL=Linter.d.ts.map
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
export { DebugLevel, EcmaVersion, ParserOptions, SourceType, } from '@typescript-eslint/types';
|
||||
//# sourceMappingURL=ParserOptions.d.ts.map
|
||||
390
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Rule.d.ts
generated
vendored
390
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Rule.d.ts
generated
vendored
|
|
@ -1,390 +0,0 @@
|
|||
import { JSONSchema4 } from '../json-schema';
|
||||
import { ParserServices, TSESTree } from '../ts-estree';
|
||||
import { AST } from './AST';
|
||||
import { Linter } from './Linter';
|
||||
import { Scope } from './Scope';
|
||||
import { SourceCode } from './SourceCode';
|
||||
interface RuleMetaDataDocs {
|
||||
/**
|
||||
* The general category the rule falls within
|
||||
*/
|
||||
category: 'Best Practices' | 'Stylistic Issues' | 'Variables' | 'Possible Errors';
|
||||
/**
|
||||
* Concise description of the rule
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* The recommendation level for the rule.
|
||||
* Used by the build tools to generate the recommended config.
|
||||
* Set to false to not include it as a recommendation
|
||||
*/
|
||||
recommended: 'error' | 'warn' | false;
|
||||
/**
|
||||
* The URL of the rule's docs
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* Specifies whether the rule can return suggestions.
|
||||
*/
|
||||
suggestion?: boolean;
|
||||
/**
|
||||
* Does the rule require us to create a full TypeScript Program in order for it
|
||||
* to type-check code. This is only used for documentation purposes.
|
||||
*/
|
||||
requiresTypeChecking?: boolean;
|
||||
/**
|
||||
* Does the rule extend (or is it based off of) an ESLint code rule?
|
||||
* Alternately accepts the name of the base rule, in case the rule has been renamed.
|
||||
* This is only used for documentation purposes.
|
||||
*/
|
||||
extendsBaseRule?: boolean | string;
|
||||
}
|
||||
interface RuleMetaData<TMessageIds extends string> {
|
||||
/**
|
||||
* True if the rule is deprecated, false otherwise
|
||||
*/
|
||||
deprecated?: boolean;
|
||||
/**
|
||||
* Documentation for the rule, unnecessary for custom rules/plugins
|
||||
*/
|
||||
docs?: RuleMetaDataDocs;
|
||||
/**
|
||||
* The fixer category. Omit if there is no fixer
|
||||
*/
|
||||
fixable?: 'code' | 'whitespace';
|
||||
/**
|
||||
* A map of messages which the rule can report.
|
||||
* The key is the messageId, and the string is the parameterised error string.
|
||||
* See: https://eslint.org/docs/developer-guide/working-with-rules#messageids
|
||||
*/
|
||||
messages: Record<TMessageIds, string>;
|
||||
/**
|
||||
* The type of rule.
|
||||
* - `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve.
|
||||
* - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed.
|
||||
* - `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses, all the parts of the program that determine how the code looks rather than how it executes. These rules work on parts of the code that aren’t specified in the AST.
|
||||
*/
|
||||
type: 'suggestion' | 'problem' | 'layout';
|
||||
/**
|
||||
* The name of the rule this rule was replaced by, if it was deprecated.
|
||||
*/
|
||||
replacedBy?: string[];
|
||||
/**
|
||||
* The options schema. Supply an empty array if there are no options.
|
||||
*/
|
||||
schema: JSONSchema4 | JSONSchema4[];
|
||||
}
|
||||
interface RuleFix {
|
||||
range: AST.Range;
|
||||
text: string;
|
||||
}
|
||||
interface RuleFixer {
|
||||
insertTextAfter(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix;
|
||||
insertTextAfterRange(range: AST.Range, text: string): RuleFix;
|
||||
insertTextBefore(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix;
|
||||
insertTextBeforeRange(range: AST.Range, text: string): RuleFix;
|
||||
remove(nodeOrToken: TSESTree.Node | TSESTree.Token): RuleFix;
|
||||
removeRange(range: AST.Range): RuleFix;
|
||||
replaceText(nodeOrToken: TSESTree.Node | TSESTree.Token, text: string): RuleFix;
|
||||
replaceTextRange(range: AST.Range, text: string): RuleFix;
|
||||
}
|
||||
interface SuggestionReportDescriptor<TMessageIds extends string> extends Pick<ReportDescriptorBase<TMessageIds>, Exclude<keyof ReportDescriptorBase<TMessageIds>, 'fix'>> {
|
||||
readonly fix: ReportFixFunction;
|
||||
}
|
||||
declare type ReportFixFunction = (fixer: RuleFixer) => null | RuleFix | readonly RuleFix[] | IterableIterator<RuleFix>;
|
||||
declare type ReportSuggestionArray<TMessageIds extends string> = SuggestionReportDescriptor<TMessageIds>[];
|
||||
interface ReportDescriptorBase<TMessageIds extends string> {
|
||||
/**
|
||||
* The parameters for the message string associated with `messageId`.
|
||||
*/
|
||||
readonly data?: Readonly<Record<string, unknown>>;
|
||||
/**
|
||||
* The fixer function.
|
||||
*/
|
||||
readonly fix?: ReportFixFunction | null;
|
||||
/**
|
||||
* The messageId which is being reported.
|
||||
*/
|
||||
readonly messageId: TMessageIds;
|
||||
}
|
||||
interface ReportDescriptorWithSuggestion<TMessageIds extends string> extends ReportDescriptorBase<TMessageIds> {
|
||||
/**
|
||||
* 6.7's Suggestions API
|
||||
*/
|
||||
readonly suggest?: Readonly<ReportSuggestionArray<TMessageIds>> | null;
|
||||
}
|
||||
interface ReportDescriptorNodeOptionalLoc {
|
||||
/**
|
||||
* The Node or AST Token which the report is being attached to
|
||||
*/
|
||||
readonly node: TSESTree.Node | TSESTree.Token;
|
||||
/**
|
||||
* An override of the location of the report
|
||||
*/
|
||||
readonly loc?: Readonly<TSESTree.SourceLocation> | Readonly<TSESTree.LineAndColumnData>;
|
||||
}
|
||||
interface ReportDescriptorLocOnly {
|
||||
/**
|
||||
* An override of the location of the report
|
||||
*/
|
||||
loc: Readonly<TSESTree.SourceLocation> | Readonly<TSESTree.LineAndColumnData>;
|
||||
}
|
||||
declare type ReportDescriptor<TMessageIds extends string> = ReportDescriptorWithSuggestion<TMessageIds> & (ReportDescriptorNodeOptionalLoc | ReportDescriptorLocOnly);
|
||||
/**
|
||||
* Plugins can add their settings using declaration
|
||||
* merging against this interface.
|
||||
*/
|
||||
interface SharedConfigurationSettings {
|
||||
[name: string]: unknown;
|
||||
}
|
||||
interface RuleContext<TMessageIds extends string, TOptions extends readonly unknown[]> {
|
||||
/**
|
||||
* The rule ID.
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* An array of the configured options for this rule.
|
||||
* This array does not include the rule severity.
|
||||
*/
|
||||
options: TOptions;
|
||||
/**
|
||||
* The name of the parser from configuration.
|
||||
*/
|
||||
parserPath: string;
|
||||
/**
|
||||
* The parser options configured for this run
|
||||
*/
|
||||
parserOptions: Linter.ParserOptions;
|
||||
/**
|
||||
* An object containing parser-provided services for rules
|
||||
*/
|
||||
parserServices?: ParserServices;
|
||||
/**
|
||||
* The shared settings from configuration.
|
||||
* We do not have any shared settings in this plugin.
|
||||
*/
|
||||
settings: SharedConfigurationSettings;
|
||||
/**
|
||||
* Returns an array of the ancestors of the currently-traversed node, starting at
|
||||
* the root of the AST and continuing through the direct parent of the current node.
|
||||
* This array does not include the currently-traversed node itself.
|
||||
*/
|
||||
getAncestors(): TSESTree.Node[];
|
||||
/**
|
||||
* Returns a list of variables declared by the given node.
|
||||
* This information can be used to track references to variables.
|
||||
*/
|
||||
getDeclaredVariables(node: TSESTree.Node): Scope.Variable[];
|
||||
/**
|
||||
* Returns the current working directory passed to Linter.
|
||||
* It is a path to a directory that should be considered as the current working directory.
|
||||
* This was added in v6.6.0
|
||||
* @since 6.6.0
|
||||
*/
|
||||
getCwd?(): string;
|
||||
/**
|
||||
* Returns the filename associated with the source.
|
||||
*/
|
||||
getFilename(): string;
|
||||
/**
|
||||
* Returns the full path of the file on disk without any code block information (unlike `getFilename()`).
|
||||
* This was added in v7.28.0
|
||||
* @since 7.28.0
|
||||
*/
|
||||
getPhysicalFilename?(): string;
|
||||
/**
|
||||
* Returns the scope of the currently-traversed node.
|
||||
* This information can be used track references to variables.
|
||||
*/
|
||||
getScope(): Scope.Scope;
|
||||
/**
|
||||
* Returns a SourceCode object that you can use to work with the source that
|
||||
* was passed to ESLint.
|
||||
*/
|
||||
getSourceCode(): Readonly<SourceCode>;
|
||||
/**
|
||||
* Marks a variable with the given name in the current scope as used.
|
||||
* This affects the no-unused-vars rule.
|
||||
*/
|
||||
markVariableAsUsed(name: string): boolean;
|
||||
/**
|
||||
* Reports a problem in the code.
|
||||
*/
|
||||
report(descriptor: ReportDescriptor<TMessageIds>): void;
|
||||
}
|
||||
declare type RuleFunction<T extends TSESTree.BaseNode = never> = (node: T) => void;
|
||||
interface RuleListener {
|
||||
[nodeSelector: string]: RuleFunction | undefined;
|
||||
ArrayExpression?: RuleFunction<TSESTree.ArrayExpression>;
|
||||
ArrayPattern?: RuleFunction<TSESTree.ArrayPattern>;
|
||||
ArrowFunctionExpression?: RuleFunction<TSESTree.ArrowFunctionExpression>;
|
||||
AssignmentPattern?: RuleFunction<TSESTree.AssignmentPattern>;
|
||||
AssignmentExpression?: RuleFunction<TSESTree.AssignmentExpression>;
|
||||
AwaitExpression?: RuleFunction<TSESTree.AwaitExpression>;
|
||||
BigIntLiteral?: RuleFunction<TSESTree.BigIntLiteral>;
|
||||
BinaryExpression?: RuleFunction<TSESTree.BinaryExpression>;
|
||||
BlockStatement?: RuleFunction<TSESTree.BlockStatement>;
|
||||
BreakStatement?: RuleFunction<TSESTree.BreakStatement>;
|
||||
CallExpression?: RuleFunction<TSESTree.CallExpression>;
|
||||
CatchClause?: RuleFunction<TSESTree.CatchClause>;
|
||||
ChainExpression?: RuleFunction<TSESTree.ChainExpression>;
|
||||
ClassBody?: RuleFunction<TSESTree.ClassBody>;
|
||||
ClassDeclaration?: RuleFunction<TSESTree.ClassDeclaration>;
|
||||
ClassExpression?: RuleFunction<TSESTree.ClassExpression>;
|
||||
ClassProperty?: RuleFunction<TSESTree.ClassProperty>;
|
||||
ConditionalExpression?: RuleFunction<TSESTree.ConditionalExpression>;
|
||||
ContinueStatement?: RuleFunction<TSESTree.ContinueStatement>;
|
||||
DebuggerStatement?: RuleFunction<TSESTree.DebuggerStatement>;
|
||||
Decorator?: RuleFunction<TSESTree.Decorator>;
|
||||
DoWhileStatement?: RuleFunction<TSESTree.DoWhileStatement>;
|
||||
EmptyStatement?: RuleFunction<TSESTree.EmptyStatement>;
|
||||
ExportAllDeclaration?: RuleFunction<TSESTree.ExportAllDeclaration>;
|
||||
ExportDefaultDeclaration?: RuleFunction<TSESTree.ExportDefaultDeclaration>;
|
||||
ExportNamedDeclaration?: RuleFunction<TSESTree.ExportNamedDeclaration>;
|
||||
ExportSpecifier?: RuleFunction<TSESTree.ExportSpecifier>;
|
||||
ExpressionStatement?: RuleFunction<TSESTree.ExpressionStatement>;
|
||||
ForInStatement?: RuleFunction<TSESTree.ForInStatement>;
|
||||
ForOfStatement?: RuleFunction<TSESTree.ForOfStatement>;
|
||||
ForStatement?: RuleFunction<TSESTree.ForStatement>;
|
||||
FunctionDeclaration?: RuleFunction<TSESTree.FunctionDeclaration>;
|
||||
FunctionExpression?: RuleFunction<TSESTree.FunctionExpression>;
|
||||
Identifier?: RuleFunction<TSESTree.Identifier>;
|
||||
IfStatement?: RuleFunction<TSESTree.IfStatement>;
|
||||
ImportDeclaration?: RuleFunction<TSESTree.ImportDeclaration>;
|
||||
ImportDefaultSpecifier?: RuleFunction<TSESTree.ImportDefaultSpecifier>;
|
||||
ImportExpression?: RuleFunction<TSESTree.ImportExpression>;
|
||||
ImportNamespaceSpecifier?: RuleFunction<TSESTree.ImportNamespaceSpecifier>;
|
||||
ImportSpecifier?: RuleFunction<TSESTree.ImportSpecifier>;
|
||||
JSXAttribute?: RuleFunction<TSESTree.JSXAttribute>;
|
||||
JSXClosingElement?: RuleFunction<TSESTree.JSXClosingElement>;
|
||||
JSXClosingFragment?: RuleFunction<TSESTree.JSXClosingFragment>;
|
||||
JSXElement?: RuleFunction<TSESTree.JSXElement>;
|
||||
JSXEmptyExpression?: RuleFunction<TSESTree.JSXEmptyExpression>;
|
||||
JSXExpressionContainer?: RuleFunction<TSESTree.JSXExpressionContainer>;
|
||||
JSXFragment?: RuleFunction<TSESTree.JSXFragment>;
|
||||
JSXIdentifier?: RuleFunction<TSESTree.JSXIdentifier>;
|
||||
JSXMemberExpression?: RuleFunction<TSESTree.JSXMemberExpression>;
|
||||
JSXOpeningElement?: RuleFunction<TSESTree.JSXOpeningElement>;
|
||||
JSXOpeningFragment?: RuleFunction<TSESTree.JSXOpeningFragment>;
|
||||
JSXSpreadAttribute?: RuleFunction<TSESTree.JSXSpreadAttribute>;
|
||||
JSXSpreadChild?: RuleFunction<TSESTree.JSXSpreadChild>;
|
||||
JSXText?: RuleFunction<TSESTree.JSXText>;
|
||||
LabeledStatement?: RuleFunction<TSESTree.LabeledStatement>;
|
||||
Literal?: RuleFunction<TSESTree.Literal>;
|
||||
LogicalExpression?: RuleFunction<TSESTree.LogicalExpression>;
|
||||
MemberExpression?: RuleFunction<TSESTree.MemberExpression>;
|
||||
MetaProperty?: RuleFunction<TSESTree.MetaProperty>;
|
||||
MethodDefinition?: RuleFunction<TSESTree.MethodDefinition>;
|
||||
NewExpression?: RuleFunction<TSESTree.NewExpression>;
|
||||
ObjectExpression?: RuleFunction<TSESTree.ObjectExpression>;
|
||||
ObjectPattern?: RuleFunction<TSESTree.ObjectPattern>;
|
||||
Program?: RuleFunction<TSESTree.Program>;
|
||||
Property?: RuleFunction<TSESTree.Property>;
|
||||
RestElement?: RuleFunction<TSESTree.RestElement>;
|
||||
ReturnStatement?: RuleFunction<TSESTree.ReturnStatement>;
|
||||
SequenceExpression?: RuleFunction<TSESTree.SequenceExpression>;
|
||||
SpreadElement?: RuleFunction<TSESTree.SpreadElement>;
|
||||
Super?: RuleFunction<TSESTree.Super>;
|
||||
SwitchCase?: RuleFunction<TSESTree.SwitchCase>;
|
||||
SwitchStatement?: RuleFunction<TSESTree.SwitchStatement>;
|
||||
TaggedTemplateExpression?: RuleFunction<TSESTree.TaggedTemplateExpression>;
|
||||
TemplateElement?: RuleFunction<TSESTree.TemplateElement>;
|
||||
TemplateLiteral?: RuleFunction<TSESTree.TemplateLiteral>;
|
||||
ThisExpression?: RuleFunction<TSESTree.ThisExpression>;
|
||||
ThrowStatement?: RuleFunction<TSESTree.ThrowStatement>;
|
||||
TryStatement?: RuleFunction<TSESTree.TryStatement>;
|
||||
TSAbstractClassProperty?: RuleFunction<TSESTree.TSAbstractClassProperty>;
|
||||
TSAbstractKeyword?: RuleFunction<TSESTree.TSAbstractKeyword>;
|
||||
TSAbstractMethodDefinition?: RuleFunction<TSESTree.TSAbstractMethodDefinition>;
|
||||
TSAnyKeyword?: RuleFunction<TSESTree.TSAnyKeyword>;
|
||||
TSArrayType?: RuleFunction<TSESTree.TSArrayType>;
|
||||
TSAsExpression?: RuleFunction<TSESTree.TSAsExpression>;
|
||||
TSAsyncKeyword?: RuleFunction<TSESTree.TSAsyncKeyword>;
|
||||
TSBigIntKeyword?: RuleFunction<TSESTree.TSBigIntKeyword>;
|
||||
TSBooleanKeyword?: RuleFunction<TSESTree.TSBooleanKeyword>;
|
||||
TSCallSignatureDeclaration?: RuleFunction<TSESTree.TSCallSignatureDeclaration>;
|
||||
TSClassImplements?: RuleFunction<TSESTree.TSClassImplements>;
|
||||
TSConditionalType?: RuleFunction<TSESTree.TSConditionalType>;
|
||||
TSConstructorType?: RuleFunction<TSESTree.TSConstructorType>;
|
||||
TSConstructSignatureDeclaration?: RuleFunction<TSESTree.TSConstructSignatureDeclaration>;
|
||||
TSDeclareKeyword?: RuleFunction<TSESTree.TSDeclareKeyword>;
|
||||
TSDeclareFunction?: RuleFunction<TSESTree.TSDeclareFunction>;
|
||||
TSEmptyBodyFunctionExpression?: RuleFunction<TSESTree.TSEmptyBodyFunctionExpression>;
|
||||
TSEnumDeclaration?: RuleFunction<TSESTree.TSEnumDeclaration>;
|
||||
TSEnumMember?: RuleFunction<TSESTree.TSEnumMember>;
|
||||
TSExportAssignment?: RuleFunction<TSESTree.TSExportAssignment>;
|
||||
TSExportKeyword?: RuleFunction<TSESTree.TSExportKeyword>;
|
||||
TSExternalModuleReference?: RuleFunction<TSESTree.TSExternalModuleReference>;
|
||||
TSFunctionType?: RuleFunction<TSESTree.TSFunctionType>;
|
||||
TSImportEqualsDeclaration?: RuleFunction<TSESTree.TSImportEqualsDeclaration>;
|
||||
TSImportType?: RuleFunction<TSESTree.TSImportType>;
|
||||
TSIndexedAccessType?: RuleFunction<TSESTree.TSIndexedAccessType>;
|
||||
TSIndexSignature?: RuleFunction<TSESTree.TSIndexSignature>;
|
||||
TSInferType?: RuleFunction<TSESTree.TSInferType>;
|
||||
TSInterfaceBody?: RuleFunction<TSESTree.TSInterfaceBody>;
|
||||
TSInterfaceDeclaration?: RuleFunction<TSESTree.TSInterfaceDeclaration>;
|
||||
TSInterfaceHeritage?: RuleFunction<TSESTree.TSInterfaceHeritage>;
|
||||
TSIntersectionType?: RuleFunction<TSESTree.TSIntersectionType>;
|
||||
TSLiteralType?: RuleFunction<TSESTree.TSLiteralType>;
|
||||
TSMappedType?: RuleFunction<TSESTree.TSMappedType>;
|
||||
TSMethodSignature?: RuleFunction<TSESTree.TSMethodSignature>;
|
||||
TSModuleBlock?: RuleFunction<TSESTree.TSModuleBlock>;
|
||||
TSModuleDeclaration?: RuleFunction<TSESTree.TSModuleDeclaration>;
|
||||
TSNamespaceExportDeclaration?: RuleFunction<TSESTree.TSNamespaceExportDeclaration>;
|
||||
TSNeverKeyword?: RuleFunction<TSESTree.TSNeverKeyword>;
|
||||
TSNonNullExpression?: RuleFunction<TSESTree.TSNonNullExpression>;
|
||||
TSNullKeyword?: RuleFunction<TSESTree.TSNullKeyword>;
|
||||
TSNumberKeyword?: RuleFunction<TSESTree.TSNumberKeyword>;
|
||||
TSObjectKeyword?: RuleFunction<TSESTree.TSObjectKeyword>;
|
||||
TSOptionalType?: RuleFunction<TSESTree.TSOptionalType>;
|
||||
TSParameterProperty?: RuleFunction<TSESTree.TSParameterProperty>;
|
||||
TSParenthesizedType?: RuleFunction<TSESTree.TSParenthesizedType>;
|
||||
TSPrivateKeyword?: RuleFunction<TSESTree.TSPrivateKeyword>;
|
||||
TSPropertySignature?: RuleFunction<TSESTree.TSPropertySignature>;
|
||||
TSProtectedKeyword?: RuleFunction<TSESTree.TSProtectedKeyword>;
|
||||
TSPublicKeyword?: RuleFunction<TSESTree.TSPublicKeyword>;
|
||||
TSQualifiedName?: RuleFunction<TSESTree.TSQualifiedName>;
|
||||
TSReadonlyKeyword?: RuleFunction<TSESTree.TSReadonlyKeyword>;
|
||||
TSRestType?: RuleFunction<TSESTree.TSRestType>;
|
||||
TSStaticKeyword?: RuleFunction<TSESTree.TSStaticKeyword>;
|
||||
TSStringKeyword?: RuleFunction<TSESTree.TSStringKeyword>;
|
||||
TSSymbolKeyword?: RuleFunction<TSESTree.TSSymbolKeyword>;
|
||||
TSThisType?: RuleFunction<TSESTree.TSThisType>;
|
||||
TSTupleType?: RuleFunction<TSESTree.TSTupleType>;
|
||||
TSTypeAliasDeclaration?: RuleFunction<TSESTree.TSTypeAliasDeclaration>;
|
||||
TSTypeAnnotation?: RuleFunction<TSESTree.TSTypeAnnotation>;
|
||||
TSTypeAssertion?: RuleFunction<TSESTree.TSTypeAssertion>;
|
||||
TSTypeLiteral?: RuleFunction<TSESTree.TSTypeLiteral>;
|
||||
TSTypeOperator?: RuleFunction<TSESTree.TSTypeOperator>;
|
||||
TSTypeParameter?: RuleFunction<TSESTree.TSTypeParameter>;
|
||||
TSTypeParameterDeclaration?: RuleFunction<TSESTree.TSTypeParameterDeclaration>;
|
||||
TSTypeParameterInstantiation?: RuleFunction<TSESTree.TSTypeParameterInstantiation>;
|
||||
TSTypePredicate?: RuleFunction<TSESTree.TSTypePredicate>;
|
||||
TSTypeQuery?: RuleFunction<TSESTree.TSTypeQuery>;
|
||||
TSTypeReference?: RuleFunction<TSESTree.TSTypeReference>;
|
||||
TSUndefinedKeyword?: RuleFunction<TSESTree.TSUndefinedKeyword>;
|
||||
TSUnionType?: RuleFunction<TSESTree.TSUnionType>;
|
||||
TSUnknownKeyword?: RuleFunction<TSESTree.TSUnknownKeyword>;
|
||||
TSVoidKeyword?: RuleFunction<TSESTree.TSVoidKeyword>;
|
||||
UnaryExpression?: RuleFunction<TSESTree.UnaryExpression>;
|
||||
UpdateExpression?: RuleFunction<TSESTree.UpdateExpression>;
|
||||
VariableDeclaration?: RuleFunction<TSESTree.VariableDeclaration>;
|
||||
VariableDeclarator?: RuleFunction<TSESTree.VariableDeclarator>;
|
||||
WhileStatement?: RuleFunction<TSESTree.WhileStatement>;
|
||||
WithStatement?: RuleFunction<TSESTree.WithStatement>;
|
||||
YieldExpression?: RuleFunction<TSESTree.YieldExpression>;
|
||||
}
|
||||
interface RuleModule<TMessageIds extends string, TOptions extends readonly unknown[], TRuleListener extends RuleListener = RuleListener> {
|
||||
/**
|
||||
* Metadata about the rule
|
||||
*/
|
||||
meta: RuleMetaData<TMessageIds>;
|
||||
/**
|
||||
* Function which returns an object with methods that ESLint calls to “visit”
|
||||
* nodes while traversing the abstract syntax tree.
|
||||
*/
|
||||
create(context: Readonly<RuleContext<TMessageIds, TOptions>>): TRuleListener;
|
||||
}
|
||||
declare type RuleCreateFunction<TMessageIds extends string = never, TOptions extends readonly unknown[] = unknown[], TRuleListener extends RuleListener = RuleListener> = (context: Readonly<RuleContext<TMessageIds, TOptions>>) => TRuleListener;
|
||||
export { ReportDescriptor, ReportFixFunction, ReportSuggestionArray, RuleContext, RuleCreateFunction, RuleFix, RuleFixer, RuleFunction, RuleListener, RuleMetaData, RuleMetaDataDocs, RuleModule, SharedConfigurationSettings, };
|
||||
//# sourceMappingURL=Rule.d.ts.map
|
||||
148
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts
generated
vendored
148
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/RuleTester.d.ts
generated
vendored
|
|
@ -1,148 +0,0 @@
|
|||
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree';
|
||||
import { ParserOptions } from './ParserOptions';
|
||||
import { Linter } from './Linter';
|
||||
import { RuleCreateFunction, RuleModule, SharedConfigurationSettings } from './Rule';
|
||||
interface ValidTestCase<TOptions extends Readonly<unknown[]>> {
|
||||
/**
|
||||
* Code for the test case.
|
||||
*/
|
||||
readonly code: string;
|
||||
/**
|
||||
* Environments for the test case.
|
||||
*/
|
||||
readonly env?: Readonly<Record<string, boolean>>;
|
||||
/**
|
||||
* The fake filename for the test case. Useful for rules that make assertion about filenames.
|
||||
*/
|
||||
readonly filename?: string;
|
||||
/**
|
||||
* The additional global variables.
|
||||
*/
|
||||
readonly globals?: Record<string, 'readonly' | 'writable' | 'off' | true>;
|
||||
/**
|
||||
* Options for the test case.
|
||||
*/
|
||||
readonly options?: Readonly<TOptions>;
|
||||
/**
|
||||
* The absolute path for the parser.
|
||||
*/
|
||||
readonly parser?: string;
|
||||
/**
|
||||
* Options for the parser.
|
||||
*/
|
||||
readonly parserOptions?: Readonly<ParserOptions>;
|
||||
/**
|
||||
* Settings for the test case.
|
||||
*/
|
||||
readonly settings?: Readonly<SharedConfigurationSettings>;
|
||||
/**
|
||||
* Run this case exclusively for debugging in supported test frameworks.
|
||||
*/
|
||||
readonly only?: boolean;
|
||||
}
|
||||
interface SuggestionOutput<TMessageIds extends string> {
|
||||
/**
|
||||
* Reported message ID.
|
||||
*/
|
||||
readonly messageId: TMessageIds;
|
||||
/**
|
||||
* The data used to fill the message template.
|
||||
*/
|
||||
readonly data?: Readonly<Record<string, unknown>>;
|
||||
/**
|
||||
* NOTE: Suggestions will be applied as a stand-alone change, without triggering multi-pass fixes.
|
||||
* Each individual error has its own suggestion, so you have to show the correct, _isolated_ output for each suggestion.
|
||||
*/
|
||||
readonly output: string;
|
||||
}
|
||||
interface InvalidTestCase<TMessageIds extends string, TOptions extends Readonly<unknown[]>> extends ValidTestCase<TOptions> {
|
||||
/**
|
||||
* Expected errors.
|
||||
*/
|
||||
readonly errors: readonly TestCaseError<TMessageIds>[];
|
||||
/**
|
||||
* The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested.
|
||||
*/
|
||||
readonly output?: string | null;
|
||||
}
|
||||
interface TestCaseError<TMessageIds extends string> {
|
||||
/**
|
||||
* The 1-based column number of the reported start location.
|
||||
*/
|
||||
readonly column?: number;
|
||||
/**
|
||||
* The data used to fill the message template.
|
||||
*/
|
||||
readonly data?: Readonly<Record<string, unknown>>;
|
||||
/**
|
||||
* The 1-based column number of the reported end location.
|
||||
*/
|
||||
readonly endColumn?: number;
|
||||
/**
|
||||
* The 1-based line number of the reported end location.
|
||||
*/
|
||||
readonly endLine?: number;
|
||||
/**
|
||||
* The 1-based line number of the reported start location.
|
||||
*/
|
||||
readonly line?: number;
|
||||
/**
|
||||
* Reported message ID.
|
||||
*/
|
||||
readonly messageId: TMessageIds;
|
||||
/**
|
||||
* Reported suggestions.
|
||||
*/
|
||||
readonly suggestions?: SuggestionOutput<TMessageIds>[] | null;
|
||||
/**
|
||||
* The type of the reported AST node.
|
||||
*/
|
||||
readonly type?: AST_NODE_TYPES | AST_TOKEN_TYPES;
|
||||
}
|
||||
interface RunTests<TMessageIds extends string, TOptions extends Readonly<unknown[]>> {
|
||||
readonly valid: readonly (ValidTestCase<TOptions> | string)[];
|
||||
readonly invalid: readonly InvalidTestCase<TMessageIds, TOptions>[];
|
||||
}
|
||||
interface RuleTesterConfig extends Linter.Config {
|
||||
readonly parser: string;
|
||||
readonly parserOptions?: Readonly<ParserOptions>;
|
||||
}
|
||||
declare class RuleTesterBase {
|
||||
/**
|
||||
* Creates a new instance of RuleTester.
|
||||
* @param testerConfig extra configuration for the tester
|
||||
*/
|
||||
constructor(testerConfig?: RuleTesterConfig);
|
||||
/**
|
||||
* Adds a new rule test to execute.
|
||||
* @param ruleName The name of the rule to run.
|
||||
* @param rule The rule to test.
|
||||
* @param test The collection of tests to run.
|
||||
*/
|
||||
run<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(ruleName: string, rule: RuleModule<TMessageIds, TOptions>, tests: RunTests<TMessageIds, TOptions>): void;
|
||||
/**
|
||||
* If you supply a value to this property, the rule tester will call this instead of using the version defined on
|
||||
* the global namespace.
|
||||
* @param text a string describing the rule
|
||||
* @param callback the test callback
|
||||
*/
|
||||
static describe?: (text: string, callback: () => void) => void;
|
||||
/**
|
||||
* If you supply a value to this property, the rule tester will call this instead of using the version defined on
|
||||
* the global namespace.
|
||||
* @param text a string describing the test case
|
||||
* @param callback the test callback
|
||||
*/
|
||||
static it?: (text: string, callback: () => void) => void;
|
||||
/**
|
||||
* Define a rule for one particular run of tests.
|
||||
* @param name The name of the rule to define.
|
||||
* @param rule The rule definition.
|
||||
*/
|
||||
defineRule<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(name: string, rule: RuleModule<TMessageIds, TOptions> | RuleCreateFunction<TMessageIds, TOptions>): void;
|
||||
}
|
||||
declare const RuleTester_base: typeof RuleTesterBase;
|
||||
declare class RuleTester extends RuleTester_base {
|
||||
}
|
||||
export { InvalidTestCase, SuggestionOutput, RuleTester, RuleTesterConfig, RunTests, TestCaseError, ValidTestCase, };
|
||||
//# sourceMappingURL=RuleTester.d.ts.map
|
||||
44
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Scope.d.ts
generated
vendored
44
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/Scope.d.ts
generated
vendored
|
|
@ -1,44 +0,0 @@
|
|||
import * as scopeManager from '@typescript-eslint/scope-manager';
|
||||
declare namespace Scope {
|
||||
type ScopeManager = scopeManager.ScopeManager;
|
||||
type Reference = scopeManager.Reference;
|
||||
type Variable = scopeManager.Variable | scopeManager.ESLintScopeVariable;
|
||||
type Scope = scopeManager.Scope;
|
||||
const ScopeType: typeof scopeManager.ScopeType;
|
||||
type DefinitionType = scopeManager.Definition;
|
||||
type Definition = scopeManager.Definition;
|
||||
const DefinitionType: typeof scopeManager.DefinitionType;
|
||||
namespace Definitions {
|
||||
type CatchClauseDefinition = scopeManager.CatchClauseDefinition;
|
||||
type ClassNameDefinition = scopeManager.ClassNameDefinition;
|
||||
type FunctionNameDefinition = scopeManager.FunctionNameDefinition;
|
||||
type ImplicitGlobalVariableDefinition = scopeManager.ImplicitGlobalVariableDefinition;
|
||||
type ImportBindingDefinition = scopeManager.ImportBindingDefinition;
|
||||
type ParameterDefinition = scopeManager.ParameterDefinition;
|
||||
type TSEnumMemberDefinition = scopeManager.TSEnumMemberDefinition;
|
||||
type TSEnumNameDefinition = scopeManager.TSEnumNameDefinition;
|
||||
type TSModuleNameDefinition = scopeManager.TSModuleNameDefinition;
|
||||
type TypeDefinition = scopeManager.TypeDefinition;
|
||||
type VariableDefinition = scopeManager.VariableDefinition;
|
||||
}
|
||||
namespace Scopes {
|
||||
type BlockScope = scopeManager.BlockScope;
|
||||
type CatchScope = scopeManager.CatchScope;
|
||||
type ClassScope = scopeManager.ClassScope;
|
||||
type ConditionalTypeScope = scopeManager.ConditionalTypeScope;
|
||||
type ForScope = scopeManager.ForScope;
|
||||
type FunctionExpressionNameScope = scopeManager.FunctionExpressionNameScope;
|
||||
type FunctionScope = scopeManager.FunctionScope;
|
||||
type FunctionTypeScope = scopeManager.FunctionTypeScope;
|
||||
type GlobalScope = scopeManager.GlobalScope;
|
||||
type MappedTypeScope = scopeManager.MappedTypeScope;
|
||||
type ModuleScope = scopeManager.ModuleScope;
|
||||
type SwitchScope = scopeManager.SwitchScope;
|
||||
type TSEnumScope = scopeManager.TSEnumScope;
|
||||
type TSModuleScope = scopeManager.TSModuleScope;
|
||||
type TypeScope = scopeManager.TypeScope;
|
||||
type WithScope = scopeManager.WithScope;
|
||||
}
|
||||
}
|
||||
export { Scope };
|
||||
//# sourceMappingURL=Scope.d.ts.map
|
||||
352
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts
generated
vendored
352
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/SourceCode.d.ts
generated
vendored
|
|
@ -1,352 +0,0 @@
|
|||
import { ParserServices, TSESTree } from '../ts-estree';
|
||||
import { Scope } from './Scope';
|
||||
declare class TokenStore {
|
||||
/**
|
||||
* Checks whether any comments exist or not between the given 2 nodes.
|
||||
* @param left The node to check.
|
||||
* @param right The node to check.
|
||||
* @returns `true` if one or more comments exist.
|
||||
*/
|
||||
commentsExistBetween(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token): boolean;
|
||||
/**
|
||||
* Gets all comment tokens directly after the given node or token.
|
||||
* @param nodeOrToken The AST node or token to check for adjacent comment tokens.
|
||||
* @returns An array of comments in occurrence order.
|
||||
*/
|
||||
getCommentsAfter(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[];
|
||||
/**
|
||||
* Gets all comment tokens directly before the given node or token.
|
||||
* @param nodeOrToken The AST node or token to check for adjacent comment tokens.
|
||||
* @returns An array of comments in occurrence order.
|
||||
*/
|
||||
getCommentsBefore(nodeOrToken: TSESTree.Node | TSESTree.Token): TSESTree.Comment[];
|
||||
/**
|
||||
* Gets all comment tokens inside the given node.
|
||||
* @param node The AST node to get the comments for.
|
||||
* @returns An array of comments in occurrence order.
|
||||
*/
|
||||
getCommentsInside(node: TSESTree.Node): TSESTree.Comment[];
|
||||
/**
|
||||
* Gets the first token of the given node.
|
||||
* @param node The AST node.
|
||||
* @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
|
||||
* @returns An object representing the token.
|
||||
*/
|
||||
getFirstToken<T extends SourceCode.CursorWithSkipOptions>(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
|
||||
/**
|
||||
* Gets the first token between two non-overlapping nodes.
|
||||
* @param left Node before the desired token range.
|
||||
* @param right Node after the desired token range.
|
||||
* @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
|
||||
* @returns An object representing the token.
|
||||
*/
|
||||
getFirstTokenBetween<T extends SourceCode.CursorWithSkipOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
|
||||
/**
|
||||
* Gets the first `count` tokens of the given node.
|
||||
* @param node The AST node.
|
||||
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
|
||||
* @returns Tokens.
|
||||
*/
|
||||
getFirstTokens<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
|
||||
/**
|
||||
* Gets the first `count` tokens between two non-overlapping nodes.
|
||||
* @param left Node before the desired token range.
|
||||
* @param right Node after the desired token range.
|
||||
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
|
||||
* @returns Tokens between left and right.
|
||||
*/
|
||||
getFirstTokensBetween<T extends SourceCode.CursorWithCountOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
|
||||
/**
|
||||
* Gets the last token of the given node.
|
||||
* @param node The AST node.
|
||||
* @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
|
||||
* @returns An object representing the token.
|
||||
*/
|
||||
getLastToken<T extends SourceCode.CursorWithSkipOptions>(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
|
||||
/**
|
||||
* Gets the last token between two non-overlapping nodes.
|
||||
* @param left Node before the desired token range.
|
||||
* @param right Node after the desired token range.
|
||||
* @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
|
||||
* @returns An object representing the token.
|
||||
*/
|
||||
getLastTokenBetween<T extends SourceCode.CursorWithSkipOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
|
||||
/**
|
||||
* Gets the last `count` tokens of the given node.
|
||||
* @param node The AST node.
|
||||
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
|
||||
* @returns Tokens.
|
||||
*/
|
||||
getLastTokens<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
|
||||
/**
|
||||
* Gets the last `count` tokens between two non-overlapping nodes.
|
||||
* @param left Node before the desired token range.
|
||||
* @param right Node after the desired token range.
|
||||
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
|
||||
* @returns Tokens between left and right.
|
||||
*/
|
||||
getLastTokensBetween<T extends SourceCode.CursorWithCountOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
|
||||
/**
|
||||
* Gets the token that follows a given node or token.
|
||||
* @param node The AST node or token.
|
||||
* @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
|
||||
* @returns An object representing the token.
|
||||
*/
|
||||
getTokenAfter<T extends SourceCode.CursorWithSkipOptions>(node: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
|
||||
/**
|
||||
* Gets the token that precedes a given node or token.
|
||||
* @param node The AST node or token.
|
||||
* @param options The option object
|
||||
* @returns An object representing the token.
|
||||
*/
|
||||
getTokenBefore<T extends SourceCode.CursorWithSkipOptions>(node: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
|
||||
/**
|
||||
* Gets the token starting at the specified index.
|
||||
* @param offset Index of the start of the token's range.
|
||||
* @param option The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
|
||||
* @returns The token starting at index, or null if no such token.
|
||||
*/
|
||||
getTokenByRangeStart<T extends {
|
||||
includeComments?: boolean;
|
||||
}>(offset: number, options?: T): SourceCode.ReturnTypeFromOptions<T> | null;
|
||||
/**
|
||||
* Gets all tokens that are related to the given node.
|
||||
* @param node The AST node.
|
||||
* @param beforeCount The number of tokens before the node to retrieve.
|
||||
* @param afterCount The number of tokens after the node to retrieve.
|
||||
* @returns Array of objects representing tokens.
|
||||
*/
|
||||
getTokens(node: TSESTree.Node, beforeCount?: number, afterCount?: number): TSESTree.Token[];
|
||||
/**
|
||||
* Gets all tokens that are related to the given node.
|
||||
* @param node The AST node.
|
||||
* @param options The option object. If this is a function then it's `options.filter`.
|
||||
* @returns Array of objects representing tokens.
|
||||
*/
|
||||
getTokens<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node, options: T): SourceCode.ReturnTypeFromOptions<T>[];
|
||||
/**
|
||||
* Gets the `count` tokens that follows a given node or token.
|
||||
* @param node The AST node.
|
||||
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
|
||||
* @returns Tokens.
|
||||
*/
|
||||
getTokensAfter<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
|
||||
/**
|
||||
* Gets the `count` tokens that precedes a given node or token.
|
||||
* @param node The AST node.
|
||||
* @param options The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
|
||||
* @returns Tokens.
|
||||
*/
|
||||
getTokensBefore<T extends SourceCode.CursorWithCountOptions>(node: TSESTree.Node | TSESTree.Token, options?: T): SourceCode.ReturnTypeFromOptions<T>[];
|
||||
/**
|
||||
* Gets all of the tokens between two non-overlapping nodes.
|
||||
* @param left Node before the desired token range.
|
||||
* @param right Node after the desired token range.
|
||||
* @param options The option object. If this is a function then it's `options.filter`.
|
||||
* @returns Tokens between left and right.
|
||||
*/
|
||||
getTokensBetween<T extends SourceCode.CursorWithCountOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, padding?: T): SourceCode.ReturnTypeFromOptions<T>[];
|
||||
/**
|
||||
* Gets all of the tokens between two non-overlapping nodes.
|
||||
* @param left Node before the desired token range.
|
||||
* @param right Node after the desired token range.
|
||||
* @param padding Number of extra tokens on either side of center.
|
||||
* @returns Tokens between left and right.
|
||||
*/
|
||||
getTokensBetween<T extends SourceCode.CursorWithCountOptions>(left: TSESTree.Node | TSESTree.Token, right: TSESTree.Node | TSESTree.Token, padding?: number): SourceCode.ReturnTypeFromOptions<T>[];
|
||||
}
|
||||
declare class SourceCodeBase extends TokenStore {
|
||||
/**
|
||||
* Represents parsed source code.
|
||||
* @param text The source code text.
|
||||
* @param ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
|
||||
*/
|
||||
constructor(text: string, ast: SourceCode.Program);
|
||||
/**
|
||||
* Represents parsed source code.
|
||||
* @param config The config object.
|
||||
*/
|
||||
constructor(config: SourceCode.SourceCodeConfig);
|
||||
/**
|
||||
* The parsed AST for the source code.
|
||||
*/
|
||||
ast: SourceCode.Program;
|
||||
/**
|
||||
* Retrieves an array containing all comments in the source code.
|
||||
* @returns An array of comment nodes.
|
||||
*/
|
||||
getAllComments(): TSESTree.Comment[];
|
||||
/**
|
||||
* Gets all comments for the given node.
|
||||
* @param node The AST node to get the comments for.
|
||||
* @returns An object containing a leading and trailing array of comments indexed by their position.
|
||||
*/
|
||||
getComments(node: TSESTree.Node): {
|
||||
leading: TSESTree.Comment[];
|
||||
trailing: TSESTree.Comment[];
|
||||
};
|
||||
/**
|
||||
* Converts a (line, column) pair into a range index.
|
||||
* @param loc A line/column location
|
||||
* @returns The range index of the location in the file.
|
||||
*/
|
||||
getIndexFromLoc(location: TSESTree.LineAndColumnData): number;
|
||||
/**
|
||||
* Gets the entire source text split into an array of lines.
|
||||
* @returns The source text as an array of lines.
|
||||
*/
|
||||
getLines(): string[];
|
||||
/**
|
||||
* Converts a source text index into a (line, column) pair.
|
||||
* @param index The index of a character in a file
|
||||
* @returns A {line, column} location object with a 0-indexed column
|
||||
*/
|
||||
getLocFromIndex(index: number): TSESTree.LineAndColumnData;
|
||||
/**
|
||||
* Gets the deepest node containing a range index.
|
||||
* @param index Range index of the desired node.
|
||||
* @returns The node if found or `null` if not found.
|
||||
*/
|
||||
getNodeByRangeIndex(index: number): TSESTree.Node | null;
|
||||
/**
|
||||
* Gets the source code for the given node.
|
||||
* @param node The AST node to get the text for.
|
||||
* @param beforeCount The number of characters before the node to retrieve.
|
||||
* @param afterCount The number of characters after the node to retrieve.
|
||||
* @returns The text representing the AST node.
|
||||
*/
|
||||
getText(node?: TSESTree.Node, beforeCount?: number, afterCount?: number): string;
|
||||
/**
|
||||
* The flag to indicate that the source code has Unicode BOM.
|
||||
*/
|
||||
hasBOM: boolean;
|
||||
/**
|
||||
* Determines if two nodes or tokens have at least one whitespace character
|
||||
* between them. Order does not matter. Returns false if the given nodes or
|
||||
* tokens overlap.
|
||||
* This was added in v6.7.0.
|
||||
* @since 6.7.0
|
||||
* @param first The first node or token to check between.
|
||||
* @param second The second node or token to check between.
|
||||
* @returns True if there is a whitespace character between any of the tokens found between the two given nodes or tokens.
|
||||
*/
|
||||
isSpaceBetween?(first: TSESTree.Token | TSESTree.Node, second: TSESTree.Token | TSESTree.Node): boolean;
|
||||
/**
|
||||
* Determines if two nodes or tokens have at least one whitespace character
|
||||
* between them. Order does not matter. Returns false if the given nodes or
|
||||
* tokens overlap.
|
||||
* For backward compatibility, this method returns true if there are
|
||||
* `JSXText` tokens that contain whitespace between the two.
|
||||
* @param first The first node or token to check between.
|
||||
* @param second The second node or token to check between.
|
||||
* @returns {boolean} True if there is a whitespace character between
|
||||
* any of the tokens found between the two given nodes or tokens.
|
||||
* @deprecated in favor of isSpaceBetween
|
||||
*/
|
||||
isSpaceBetweenTokens(first: TSESTree.Token, second: TSESTree.Token): boolean;
|
||||
/**
|
||||
* The source code split into lines according to ECMA-262 specification.
|
||||
* This is done to avoid each rule needing to do so separately.
|
||||
*/
|
||||
lines: string[];
|
||||
/**
|
||||
* The indexes in `text` that each line starts
|
||||
*/
|
||||
lineStartIndices: number[];
|
||||
/**
|
||||
* The parser services of this source code.
|
||||
*/
|
||||
parserServices: ParserServices;
|
||||
/**
|
||||
* The scope of this source code.
|
||||
*/
|
||||
scopeManager: Scope.ScopeManager | null;
|
||||
/**
|
||||
* The original text source code. BOM was stripped from this text.
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* All of the tokens and comments in the AST.
|
||||
*
|
||||
* TODO: rename to 'tokens'
|
||||
*/
|
||||
tokensAndComments: TSESTree.Token[];
|
||||
/**
|
||||
* The visitor keys to traverse AST.
|
||||
*/
|
||||
visitorKeys: SourceCode.VisitorKeys;
|
||||
/**
|
||||
* Split the source code into multiple lines based on the line delimiters.
|
||||
* @param text Source code as a string.
|
||||
* @returns Array of source code lines.
|
||||
*/
|
||||
static splitLines(text: string): string[];
|
||||
}
|
||||
declare namespace SourceCode {
|
||||
interface Program extends TSESTree.Program {
|
||||
comments: TSESTree.Comment[];
|
||||
tokens: TSESTree.Token[];
|
||||
}
|
||||
interface SourceCodeConfig {
|
||||
/**
|
||||
* The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
|
||||
*/
|
||||
ast: Program;
|
||||
/**
|
||||
* The parser services.
|
||||
*/
|
||||
parserServices: ParserServices | null;
|
||||
/**
|
||||
* The scope of this source code.
|
||||
*/
|
||||
scopeManager: Scope.ScopeManager | null;
|
||||
/**
|
||||
* The source code text.
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* The visitor keys to traverse AST.
|
||||
*/
|
||||
visitorKeys: VisitorKeys | null;
|
||||
}
|
||||
interface VisitorKeys {
|
||||
[nodeType: string]: string[];
|
||||
}
|
||||
type FilterPredicate = (token: TSESTree.Token) => boolean;
|
||||
type ReturnTypeFromOptions<T> = T extends {
|
||||
includeComments: true;
|
||||
} ? TSESTree.Token : Exclude<TSESTree.Token, TSESTree.Comment>;
|
||||
type CursorWithSkipOptions = number | FilterPredicate | {
|
||||
/**
|
||||
* The predicate function to choose tokens.
|
||||
*/
|
||||
filter?: FilterPredicate;
|
||||
/**
|
||||
* The flag to iterate comments as well.
|
||||
*/
|
||||
includeComments?: boolean;
|
||||
/**
|
||||
* The count of tokens the cursor skips.
|
||||
*/
|
||||
skip?: number;
|
||||
};
|
||||
type CursorWithCountOptions = number | FilterPredicate | {
|
||||
/**
|
||||
* The predicate function to choose tokens.
|
||||
*/
|
||||
filter?: FilterPredicate;
|
||||
/**
|
||||
* The flag to iterate comments as well.
|
||||
*/
|
||||
includeComments?: boolean;
|
||||
/**
|
||||
* The maximum count of tokens the cursor iterates.
|
||||
*/
|
||||
count?: number;
|
||||
};
|
||||
}
|
||||
declare const SourceCode_base: typeof SourceCodeBase;
|
||||
declare class SourceCode extends SourceCode_base {
|
||||
}
|
||||
export { SourceCode };
|
||||
//# sourceMappingURL=SourceCode.d.ts.map
|
||||
10
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/index.d.ts
generated
vendored
10
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-eslint/index.d.ts
generated
vendored
|
|
@ -1,10 +0,0 @@
|
|||
export * from './AST';
|
||||
export * from './CLIEngine';
|
||||
export * from './ESLint';
|
||||
export * from './Linter';
|
||||
export * from './ParserOptions';
|
||||
export * from './Rule';
|
||||
export * from './RuleTester';
|
||||
export * from './Scope';
|
||||
export * from './SourceCode';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
3
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-estree.d.ts
generated
vendored
3
node_modules/@typescript-eslint/experimental-utils/_ts3.4/dist/ts-estree.d.ts
generated
vendored
|
|
@ -1,3 +0,0 @@
|
|||
export { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/types';
|
||||
export { ParserServices } from '@typescript-eslint/typescript-estree/dist/parser-options';
|
||||
//# sourceMappingURL=ts-estree.d.ts.map
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
interface PatternMatcher {
|
||||
/**
|
||||
* Iterate all matched parts in a given string.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-execall}
|
||||
*/
|
||||
execAll(str: string): IterableIterator<RegExpExecArray>;
|
||||
/**
|
||||
* Check whether this pattern matches a given string or not.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-test}
|
||||
*/
|
||||
test(str: string): boolean;
|
||||
/**
|
||||
* Replace all matched parts by a given replacer.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#matcher-symbol-replace}
|
||||
* @example
|
||||
* const { PatternMatcher } = require("eslint-utils")
|
||||
* const matcher = new PatternMatcher(/\\p{Script=Greek}/g)
|
||||
*
|
||||
* module.exports = {
|
||||
* meta: {},
|
||||
* create(context) {
|
||||
* return {
|
||||
* "Literal[regex]"(node) {
|
||||
* const replacedPattern = node.regex.pattern.replace(
|
||||
* matcher,
|
||||
* "[\\u0370-\\u0373\\u0375-\\u0377\\u037A-\\u037D\\u037F\\u0384\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03E1\\u03F0-\\u03FF\\u1D26-\\u1D2A\\u1D5D-\\u1D61\\u1D66-\\u1D6A\\u1DBF\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FC4\\u1FC6-\\u1FD3\\u1FD6-\\u1FDB\\u1FDD-\\u1FEF\\u1FF2-\\u1FF4\\u1FF6-\\u1FFE\\u2126\\uAB65]|\\uD800[\\uDD40-\\uDD8E\\uDDA0]|\\uD834[\\uDE00-\\uDE45]"
|
||||
* )
|
||||
* },
|
||||
* }
|
||||
* },
|
||||
* }
|
||||
*/
|
||||
[Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string;
|
||||
}
|
||||
/**
|
||||
* The class to find a pattern in strings as handling escape sequences.
|
||||
* It ignores the found pattern if it's escaped with `\`.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class}
|
||||
*/
|
||||
declare const PatternMatcher: new (pattern: RegExp, options?: {
|
||||
escaped?: boolean | undefined;
|
||||
} | undefined) => PatternMatcher;
|
||||
export { PatternMatcher };
|
||||
//# sourceMappingURL=PatternMatcher.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"PatternMatcher.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":"AAEA,UAAU,cAAc;IACtB;;;;OAIG;IACH,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAAC,eAAe,CAAC,CAAC;IAExD;;;;OAIG;IACH,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAE3B;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,CAAC,MAAM,CAAC,OAAO,CAAC,CACd,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC,GACjD,MAAM,CAAC;CACX;AAED;;;;;GAKG;AACH,QAAA,MAAM,cAAc,gBACJ,MAAM;;kBAAoC,cACzD,CAAC;AAEF,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.PatternMatcher = void 0;
|
||||
const eslintUtils = __importStar(require("eslint-utils"));
|
||||
/**
|
||||
* The class to find a pattern in strings as handling escape sequences.
|
||||
* It ignores the found pattern if it's escaped with `\`.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#patternmatcher-class}
|
||||
*/
|
||||
const PatternMatcher = eslintUtils.PatternMatcher;
|
||||
exports.PatternMatcher = PatternMatcher;
|
||||
//# sourceMappingURL=PatternMatcher.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"PatternMatcher.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/PatternMatcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AA6C5C;;;;;GAKG;AACH,MAAM,cAAc,GAAG,WAAW,CAAC,cAElC,CAAC;AAEO,wCAAc"}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
import { TSESTree } from '../../ts-estree';
|
||||
import * as TSESLint from '../../ts-eslint';
|
||||
declare const ReferenceTrackerREAD: unique symbol;
|
||||
declare const ReferenceTrackerCALL: unique symbol;
|
||||
declare const ReferenceTrackerCONSTRUCT: unique symbol;
|
||||
declare const ReferenceTrackerESM: unique symbol;
|
||||
interface ReferenceTracker {
|
||||
/**
|
||||
* Iterate the references that the given `traceMap` determined.
|
||||
* This method starts to search from global variables.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateglobalreferences}
|
||||
*/
|
||||
iterateGlobalReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
|
||||
/**
|
||||
* Iterate the references that the given `traceMap` determined.
|
||||
* This method starts to search from `require()` expression.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iteratecjsreferences}
|
||||
*/
|
||||
iterateCjsReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
|
||||
/**
|
||||
* Iterate the references that the given `traceMap` determined.
|
||||
* This method starts to search from `import`/`export` declarations.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#tracker-iterateesmreferences}
|
||||
*/
|
||||
iterateEsmReferences<T>(traceMap: ReferenceTracker.TraceMap<T>): IterableIterator<ReferenceTracker.FoundReference<T>>;
|
||||
}
|
||||
interface ReferenceTrackerStatic {
|
||||
new (globalScope: TSESLint.Scope.Scope, options?: {
|
||||
/**
|
||||
* The mode which determines how the `tracker.iterateEsmReferences()` method scans CommonJS modules.
|
||||
* If this is `"strict"`, the method binds CommonJS modules to the default export. Otherwise, the method binds
|
||||
* CommonJS modules to both the default export and named exports. Optional. Default is `"strict"`.
|
||||
*/
|
||||
mode?: 'strict' | 'legacy';
|
||||
/**
|
||||
* The name list of Global Object. Optional. Default is `["global", "globalThis", "self", "window"]`.
|
||||
*/
|
||||
globalObjectNames?: readonly string[];
|
||||
}): ReferenceTracker;
|
||||
readonly READ: typeof ReferenceTrackerREAD;
|
||||
readonly CALL: typeof ReferenceTrackerCALL;
|
||||
readonly CONSTRUCT: typeof ReferenceTrackerCONSTRUCT;
|
||||
readonly ESM: typeof ReferenceTrackerESM;
|
||||
}
|
||||
declare namespace ReferenceTracker {
|
||||
type READ = ReferenceTrackerStatic['READ'];
|
||||
type CALL = ReferenceTrackerStatic['CALL'];
|
||||
type CONSTRUCT = ReferenceTrackerStatic['CONSTRUCT'];
|
||||
type ESM = ReferenceTrackerStatic['ESM'];
|
||||
type ReferenceType = READ | CALL | CONSTRUCT;
|
||||
type TraceMap<T = any> = Record<string, TraceMapElement<T>>;
|
||||
interface TraceMapElement<T> {
|
||||
[ReferenceTrackerREAD]?: T;
|
||||
[ReferenceTrackerCALL]?: T;
|
||||
[ReferenceTrackerCONSTRUCT]?: T;
|
||||
[ReferenceTrackerESM]?: true;
|
||||
[key: string]: TraceMapElement<T>;
|
||||
}
|
||||
interface FoundReference<T = any> {
|
||||
node: TSESTree.Node;
|
||||
path: readonly string[];
|
||||
type: ReferenceType;
|
||||
entry: T;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class}
|
||||
*/
|
||||
declare const ReferenceTracker: ReferenceTrackerStatic;
|
||||
export { ReferenceTracker };
|
||||
//# sourceMappingURL=ReferenceTracker.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ReferenceTracker.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/ReferenceTracker.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C,QAAA,MAAM,oBAAoB,EAAE,OAAO,MAA0C,CAAC;AAC9E,QAAA,MAAM,oBAAoB,EAAE,OAAO,MAA0C,CAAC;AAC9E,QAAA,MAAM,yBAAyB,EAAE,OAAO,MACA,CAAC;AACzC,QAAA,MAAM,mBAAmB,EAAE,OAAO,MAAyC,CAAC;AAE5E,UAAU,gBAAgB;IACxB;;;;;OAKG;IACH,uBAAuB,CAAC,CAAC,EACvB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACrC,gBAAgB,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAExD;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,EACpB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACrC,gBAAgB,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;IAExD;;;;;OAKG;IACH,oBAAoB,CAAC,CAAC,EACpB,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC,GACrC,gBAAgB,CAAC,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;CACzD;AACD,UAAU,sBAAsB;IAC9B,KACE,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,EACjC,OAAO,CAAC,EAAE;QACR;;;;WAIG;QACH,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;QAC3B;;WAEG;QACH,iBAAiB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;KACvC,GACA,gBAAgB,CAAC;IAEpB,QAAQ,CAAC,IAAI,EAAE,OAAO,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,IAAI,EAAE,OAAO,oBAAoB,CAAC;IAC3C,QAAQ,CAAC,SAAS,EAAE,OAAO,yBAAyB,CAAC;IACrD,QAAQ,CAAC,GAAG,EAAE,OAAO,mBAAmB,CAAC;CAC1C;AAED,kBAAU,gBAAgB,CAAC;IACzB,KAAY,IAAI,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAClD,KAAY,IAAI,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC;IAClD,KAAY,SAAS,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAC;IAC5D,KAAY,GAAG,GAAG,sBAAsB,CAAC,KAAK,CAAC,CAAC;IAChD,KAAY,aAAa,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IAEpD,KAAY,QAAQ,CAAC,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IACnE,UAAiB,eAAe,CAAC,CAAC;QAChC,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC;QAC3B,CAAC,yBAAyB,CAAC,CAAC,EAAE,CAAC,CAAC;QAChC,CAAC,mBAAmB,CAAC,CAAC,EAAE,IAAI,CAAC;QAC7B,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;KACnC;IAED,UAAiB,cAAc,CAAC,CAAC,GAAG,GAAG;QACrC,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC;QACpB,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;QACxB,IAAI,EAAE,aAAa,CAAC;QACpB,KAAK,EAAE,CAAC,CAAC;KACV;CACF;AAED;;;;GAIG;AACH,QAAA,MAAM,gBAAgB,wBAAyD,CAAC;AAEhF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.ReferenceTracker = void 0;
|
||||
/* eslint-disable @typescript-eslint/no-namespace */
|
||||
const eslintUtils = __importStar(require("eslint-utils"));
|
||||
const ReferenceTrackerREAD = eslintUtils.ReferenceTracker.READ;
|
||||
const ReferenceTrackerCALL = eslintUtils.ReferenceTracker.CALL;
|
||||
const ReferenceTrackerCONSTRUCT = eslintUtils.ReferenceTracker.CONSTRUCT;
|
||||
const ReferenceTrackerESM = eslintUtils.ReferenceTracker.ESM;
|
||||
/**
|
||||
* The tracker for references. This provides reference tracking for global variables, CommonJS modules, and ES modules.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#referencetracker-class}
|
||||
*/
|
||||
const ReferenceTracker = eslintUtils.ReferenceTracker;
|
||||
exports.ReferenceTracker = ReferenceTracker;
|
||||
//# sourceMappingURL=ReferenceTracker.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"ReferenceTracker.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/ReferenceTracker.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAoD;AACpD,0DAA4C;AAI5C,MAAM,oBAAoB,GAAkB,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC;AAC9E,MAAM,oBAAoB,GAAkB,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC;AAC9E,MAAM,yBAAyB,GAC7B,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC;AACzC,MAAM,mBAAmB,GAAkB,WAAW,CAAC,gBAAgB,CAAC,GAAG,CAAC;AAgF5E;;;;GAIG;AACH,MAAM,gBAAgB,GAAG,WAAW,CAAC,gBAA0C,CAAC;AAEvE,4CAAgB"}
|
||||
|
|
@ -1,76 +0,0 @@
|
|||
import * as TSESLint from '../../ts-eslint';
|
||||
import { TSESTree } from '../../ts-estree';
|
||||
/**
|
||||
* Get the proper location of a given function node to report.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionheadlocation}
|
||||
*/
|
||||
declare const getFunctionHeadLocation: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression, sourceCode: TSESLint.SourceCode) => TSESTree.SourceLocation;
|
||||
/**
|
||||
* Get the name and kind of a given function node.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionnamewithkind}
|
||||
*/
|
||||
declare const getFunctionNameWithKind: (node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.ArrowFunctionExpression) => string;
|
||||
/**
|
||||
* Get the property name of a given property node.
|
||||
* If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getpropertyname}
|
||||
* @returns The property name of the node. If the property name is not constant then it returns `null`.
|
||||
*/
|
||||
declare const getPropertyName: (node: TSESTree.MemberExpression | TSESTree.Property | TSESTree.MethodDefinition, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/Scope").Scope | undefined) => string | null;
|
||||
/**
|
||||
* Get the value of a given node if it can decide the value statically.
|
||||
* If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
|
||||
* given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
|
||||
* not been modified.
|
||||
* For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue}
|
||||
* @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
|
||||
* static value of the node, it returns `null`.
|
||||
*/
|
||||
declare const getStaticValue: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/Scope").Scope | undefined) => {
|
||||
value: unknown;
|
||||
} | null;
|
||||
/**
|
||||
* Get the string value of a given node.
|
||||
* This function is a tiny wrapper of the getStaticValue function.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstringifconstant}
|
||||
*/
|
||||
declare const getStringIfConstant: (node: TSESTree.Node, initialScope?: import("@typescript-eslint/scope-manager/dist/scope/Scope").Scope | undefined) => string | null;
|
||||
/**
|
||||
* Check whether a given node has any side effect or not.
|
||||
* The side effect means that it may modify a certain variable or object member. This function considers the node which
|
||||
* contains the following types as the node which has side effects:
|
||||
* - `AssignmentExpression`
|
||||
* - `AwaitExpression`
|
||||
* - `CallExpression`
|
||||
* - `ImportExpression`
|
||||
* - `NewExpression`
|
||||
* - `UnaryExpression([operator = "delete"])`
|
||||
* - `UpdateExpression`
|
||||
* - `YieldExpression`
|
||||
* - When `options.considerGetters` is `true`:
|
||||
* - `MemberExpression`
|
||||
* - When `options.considerImplicitTypeConversion` is `true`:
|
||||
* - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
|
||||
* - `MemberExpression([computed = true])`
|
||||
* - `MethodDefinition([computed = true])`
|
||||
* - `Property([computed = true])`
|
||||
* - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#hassideeffect}
|
||||
*/
|
||||
declare const hasSideEffect: (node: TSESTree.Node, sourceCode: TSESLint.SourceCode, options?: {
|
||||
considerGetters?: boolean | undefined;
|
||||
considerImplicitTypeConversion?: boolean | undefined;
|
||||
} | undefined) => boolean;
|
||||
declare const isParenthesized: {
|
||||
(node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
|
||||
(times: number, node: TSESTree.Node, sourceCode: TSESLint.SourceCode): boolean;
|
||||
};
|
||||
export { getFunctionHeadLocation, getFunctionNameWithKind, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isParenthesized, };
|
||||
//# sourceMappingURL=astUtilities.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"astUtilities.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/astUtilities.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,SAEvB,SAAS,mBAAmB,GAC5B,SAAS,kBAAkB,GAC3B,SAAS,uBAAuB,cACxB,SAAS,UAAU,KAC5B,SAAS,cAAc,CAAC;AAE7B;;;;GAIG;AACH,QAAA,MAAM,uBAAuB,SAEvB,SAAS,mBAAmB,GAC5B,SAAS,kBAAkB,GAC3B,SAAS,uBAAuB,KACjC,MAAM,CAAC;AAEZ;;;;;;GAMG;AACH,QAAA,MAAM,eAAe,SAEf,SAAS,gBAAgB,GACzB,SAAS,QAAQ,GACjB,SAAS,gBAAgB,mGAE1B,MAAM,GAAG,IAAI,CAAC;AAEnB;;;;;;;;;;GAUG;AACH,QAAA,MAAM,cAAc,SACZ,SAAS,IAAI,mGAEhB;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAAC;AAE/B;;;;;GAKG;AACH,QAAA,MAAM,mBAAmB,SACjB,SAAS,IAAI,mGAEhB,MAAM,GAAG,IAAI,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,QAAA,MAAM,aAAa,SACX,SAAS,IAAI,cACP,SAAS,UAAU;;;kBAK5B,OAAO,CAAC;AAEb,QAAA,MAAM,eAAe;WAUZ,SAAS,IAAI,cAAc,SAAS,UAAU,GAAG,OAAO;YAEtD,MAAM,QACP,SAAS,IAAI,cACP,SAAS,UAAU,GAC9B,OAAO;CACX,CAAC;AAEF,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,eAAe,GAChB,CAAC"}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isParenthesized = exports.hasSideEffect = exports.getStringIfConstant = exports.getStaticValue = exports.getPropertyName = exports.getFunctionNameWithKind = exports.getFunctionHeadLocation = void 0;
|
||||
const eslintUtils = __importStar(require("eslint-utils"));
|
||||
/**
|
||||
* Get the proper location of a given function node to report.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionheadlocation}
|
||||
*/
|
||||
const getFunctionHeadLocation = eslintUtils.getFunctionHeadLocation;
|
||||
exports.getFunctionHeadLocation = getFunctionHeadLocation;
|
||||
/**
|
||||
* Get the name and kind of a given function node.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getfunctionnamewithkind}
|
||||
*/
|
||||
const getFunctionNameWithKind = eslintUtils.getFunctionNameWithKind;
|
||||
exports.getFunctionNameWithKind = getFunctionNameWithKind;
|
||||
/**
|
||||
* Get the property name of a given property node.
|
||||
* If the node is a computed property, this tries to compute the property name by the getStringIfConstant function.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getpropertyname}
|
||||
* @returns The property name of the node. If the property name is not constant then it returns `null`.
|
||||
*/
|
||||
const getPropertyName = eslintUtils.getPropertyName;
|
||||
exports.getPropertyName = getPropertyName;
|
||||
/**
|
||||
* Get the value of a given node if it can decide the value statically.
|
||||
* If the 2nd parameter `initialScope` was given, this function tries to resolve identifier references which are in the
|
||||
* given node as much as possible. In the resolving way, it does on the assumption that built-in global objects have
|
||||
* not been modified.
|
||||
* For example, it considers `Symbol.iterator`, ` String.raw``hello`` `, and `Object.freeze({a: 1}).a` as static.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstaticvalue}
|
||||
* @returns The `{ value: any }` shaped object. The `value` property is the static value. If it couldn't compute the
|
||||
* static value of the node, it returns `null`.
|
||||
*/
|
||||
const getStaticValue = eslintUtils.getStaticValue;
|
||||
exports.getStaticValue = getStaticValue;
|
||||
/**
|
||||
* Get the string value of a given node.
|
||||
* This function is a tiny wrapper of the getStaticValue function.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#getstringifconstant}
|
||||
*/
|
||||
const getStringIfConstant = eslintUtils.getStringIfConstant;
|
||||
exports.getStringIfConstant = getStringIfConstant;
|
||||
/**
|
||||
* Check whether a given node has any side effect or not.
|
||||
* The side effect means that it may modify a certain variable or object member. This function considers the node which
|
||||
* contains the following types as the node which has side effects:
|
||||
* - `AssignmentExpression`
|
||||
* - `AwaitExpression`
|
||||
* - `CallExpression`
|
||||
* - `ImportExpression`
|
||||
* - `NewExpression`
|
||||
* - `UnaryExpression([operator = "delete"])`
|
||||
* - `UpdateExpression`
|
||||
* - `YieldExpression`
|
||||
* - When `options.considerGetters` is `true`:
|
||||
* - `MemberExpression`
|
||||
* - When `options.considerImplicitTypeConversion` is `true`:
|
||||
* - `BinaryExpression([operator = "==" | "!=" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in"])`
|
||||
* - `MemberExpression([computed = true])`
|
||||
* - `MethodDefinition([computed = true])`
|
||||
* - `Property([computed = true])`
|
||||
* - `UnaryExpression([operator = "-" | "+" | "!" | "~"])`
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/ast-utils.html#hassideeffect}
|
||||
*/
|
||||
const hasSideEffect = eslintUtils.hasSideEffect;
|
||||
exports.hasSideEffect = hasSideEffect;
|
||||
const isParenthesized = eslintUtils.isParenthesized;
|
||||
exports.isParenthesized = isParenthesized;
|
||||
//# sourceMappingURL=astUtilities.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"astUtilities.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/astUtilities.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAI5C;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAMhB,CAAC;AA2G3B,0DAAuB;AAzGzB;;;;GAIG;AACH,MAAM,uBAAuB,GAAG,WAAW,CAAC,uBAKjC,CAAC;AAgGV,0DAAuB;AA9FzB;;;;;;GAMG;AACH,MAAM,eAAe,GAAG,WAAW,CAAC,eAMlB,CAAC;AAkFjB,0CAAe;AAhFjB;;;;;;;;;;GAUG;AACH,MAAM,cAAc,GAAG,WAAW,CAAC,cAGL,CAAC;AAmE7B,wCAAc;AAjEhB;;;;;GAKG;AACH,MAAM,mBAAmB,GAAG,WAAW,CAAC,mBAGtB,CAAC;AAyDjB,kDAAmB;AAvDrB;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,aAAa,GAAG,WAAW,CAAC,aAOtB,CAAC;AA0BX,sCAAa;AAxBf,MAAM,eAAe,GAAG,WAAW,CAAC,eAgBnC,CAAC;AASA,0CAAe"}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
export * from './astUtilities';
|
||||
export * from './PatternMatcher';
|
||||
export * from './predicates';
|
||||
export * from './ReferenceTracker';
|
||||
export * from './scopeAnalysis';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC"}
|
||||
18
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js
generated
vendored
18
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/eslint-utils/index.js
generated
vendored
|
|
@ -1,18 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./astUtilities"), exports);
|
||||
__exportStar(require("./PatternMatcher"), exports);
|
||||
__exportStar(require("./predicates"), exports);
|
||||
__exportStar(require("./ReferenceTracker"), exports);
|
||||
__exportStar(require("./scopeAnalysis"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iDAA+B;AAC/B,mDAAiC;AACjC,+CAA6B;AAC7B,qDAAmC;AACnC,kDAAgC"}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
import { TSESTree } from '../../ts-estree';
|
||||
declare type IsSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is SpecificToken;
|
||||
declare type IsNotSpecificTokenFunction<SpecificToken extends TSESTree.Token> = (token: TSESTree.Token) => token is Exclude<TSESTree.Token, SpecificToken>;
|
||||
declare type PunctuatorTokenWithValue<Value extends string> = TSESTree.PunctuatorToken & {
|
||||
value: Value;
|
||||
};
|
||||
declare type IsPunctuatorTokenWithValueFunction<Value extends string> = IsSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
|
||||
declare type IsNotPunctuatorTokenWithValueFunction<Value extends string> = IsNotSpecificTokenFunction<PunctuatorTokenWithValue<Value>>;
|
||||
declare const isArrowToken: IsPunctuatorTokenWithValueFunction<"=>">;
|
||||
declare const isNotArrowToken: IsNotPunctuatorTokenWithValueFunction<"=>">;
|
||||
declare const isClosingBraceToken: IsPunctuatorTokenWithValueFunction<"}">;
|
||||
declare const isNotClosingBraceToken: IsNotPunctuatorTokenWithValueFunction<"}">;
|
||||
declare const isClosingBracketToken: IsPunctuatorTokenWithValueFunction<"]">;
|
||||
declare const isNotClosingBracketToken: IsNotPunctuatorTokenWithValueFunction<"]">;
|
||||
declare const isClosingParenToken: IsPunctuatorTokenWithValueFunction<")">;
|
||||
declare const isNotClosingParenToken: IsNotPunctuatorTokenWithValueFunction<")">;
|
||||
declare const isColonToken: IsPunctuatorTokenWithValueFunction<":">;
|
||||
declare const isNotColonToken: IsNotPunctuatorTokenWithValueFunction<":">;
|
||||
declare const isCommaToken: IsPunctuatorTokenWithValueFunction<",">;
|
||||
declare const isNotCommaToken: IsNotPunctuatorTokenWithValueFunction<",">;
|
||||
declare const isCommentToken: IsSpecificTokenFunction<TSESTree.Comment>;
|
||||
declare const isNotCommentToken: IsNotSpecificTokenFunction<TSESTree.Comment>;
|
||||
declare const isOpeningBraceToken: IsPunctuatorTokenWithValueFunction<"{">;
|
||||
declare const isNotOpeningBraceToken: IsNotPunctuatorTokenWithValueFunction<"{">;
|
||||
declare const isOpeningBracketToken: IsPunctuatorTokenWithValueFunction<"[">;
|
||||
declare const isNotOpeningBracketToken: IsNotPunctuatorTokenWithValueFunction<"[">;
|
||||
declare const isOpeningParenToken: IsPunctuatorTokenWithValueFunction<"(">;
|
||||
declare const isNotOpeningParenToken: IsNotPunctuatorTokenWithValueFunction<"(">;
|
||||
declare const isSemicolonToken: IsPunctuatorTokenWithValueFunction<";">;
|
||||
declare const isNotSemicolonToken: IsNotPunctuatorTokenWithValueFunction<";">;
|
||||
export { isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isSemicolonToken, };
|
||||
//# sourceMappingURL=predicates.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/predicates.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,aAAK,uBAAuB,CAAC,aAAa,SAAS,QAAQ,CAAC,KAAK,IAAI,CACnE,KAAK,EAAE,QAAQ,CAAC,KAAK,KAClB,KAAK,IAAI,aAAa,CAAC;AAE5B,aAAK,0BAA0B,CAAC,aAAa,SAAS,QAAQ,CAAC,KAAK,IAAI,CACtE,KAAK,EAAE,QAAQ,CAAC,KAAK,KAClB,KAAK,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;AAErD,aAAK,wBAAwB,CAAC,KAAK,SAAS,MAAM,IAChD,QAAQ,CAAC,eAAe,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC;AAC9C,aAAK,kCAAkC,CAAC,KAAK,SAAS,MAAM,IAC1D,uBAAuB,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAC3D,aAAK,qCAAqC,CAAC,KAAK,SAAS,MAAM,IAC7D,0BAA0B,CAAC,wBAAwB,CAAC,KAAK,CAAC,CAAC,CAAC;AAE9D,QAAA,MAAM,YAAY,0CACoD,CAAC;AACvE,QAAA,MAAM,eAAe,6CACuD,CAAC;AAE7E,QAAA,MAAM,mBAAmB,yCACmD,CAAC;AAC7E,QAAA,MAAM,sBAAsB,4CACsD,CAAC;AAEnF,QAAA,MAAM,qBAAqB,yCACmD,CAAC;AAC/E,QAAA,MAAM,wBAAwB,4CACsD,CAAC;AAErF,QAAA,MAAM,mBAAmB,yCACmD,CAAC;AAC7E,QAAA,MAAM,sBAAsB,4CACsD,CAAC;AAEnF,QAAA,MAAM,YAAY,yCACmD,CAAC;AACtE,QAAA,MAAM,eAAe,4CACsD,CAAC;AAE5E,QAAA,MAAM,YAAY,yCACmD,CAAC;AACtE,QAAA,MAAM,eAAe,4CACsD,CAAC;AAE5E,QAAA,MAAM,cAAc,2CACqD,CAAC;AAC1E,QAAA,MAAM,iBAAiB,8CACwD,CAAC;AAEhF,QAAA,MAAM,mBAAmB,yCACmD,CAAC;AAC7E,QAAA,MAAM,sBAAsB,4CACsD,CAAC;AAEnF,QAAA,MAAM,qBAAqB,yCACmD,CAAC;AAC/E,QAAA,MAAM,wBAAwB,4CACsD,CAAC;AAErF,QAAA,MAAM,mBAAmB,yCACmD,CAAC;AAC7E,QAAA,MAAM,sBAAsB,4CACsD,CAAC;AAEnF,QAAA,MAAM,gBAAgB,yCACmD,CAAC;AAC1E,QAAA,MAAM,mBAAmB,4CACsD,CAAC;AAEhF,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,eAAe,EACf,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,gBAAgB,GACjB,CAAC"}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isSemicolonToken = exports.isOpeningParenToken = exports.isOpeningBracketToken = exports.isOpeningBraceToken = exports.isNotSemicolonToken = exports.isNotOpeningParenToken = exports.isNotOpeningBracketToken = exports.isNotOpeningBraceToken = exports.isNotCommentToken = exports.isNotCommaToken = exports.isNotColonToken = exports.isNotClosingParenToken = exports.isNotClosingBracketToken = exports.isNotClosingBraceToken = exports.isNotArrowToken = exports.isCommentToken = exports.isCommaToken = exports.isColonToken = exports.isClosingParenToken = exports.isClosingBracketToken = exports.isClosingBraceToken = exports.isArrowToken = void 0;
|
||||
const eslintUtils = __importStar(require("eslint-utils"));
|
||||
const isArrowToken = eslintUtils.isArrowToken;
|
||||
exports.isArrowToken = isArrowToken;
|
||||
const isNotArrowToken = eslintUtils.isNotArrowToken;
|
||||
exports.isNotArrowToken = isNotArrowToken;
|
||||
const isClosingBraceToken = eslintUtils.isClosingBraceToken;
|
||||
exports.isClosingBraceToken = isClosingBraceToken;
|
||||
const isNotClosingBraceToken = eslintUtils.isNotClosingBraceToken;
|
||||
exports.isNotClosingBraceToken = isNotClosingBraceToken;
|
||||
const isClosingBracketToken = eslintUtils.isClosingBracketToken;
|
||||
exports.isClosingBracketToken = isClosingBracketToken;
|
||||
const isNotClosingBracketToken = eslintUtils.isNotClosingBracketToken;
|
||||
exports.isNotClosingBracketToken = isNotClosingBracketToken;
|
||||
const isClosingParenToken = eslintUtils.isClosingParenToken;
|
||||
exports.isClosingParenToken = isClosingParenToken;
|
||||
const isNotClosingParenToken = eslintUtils.isNotClosingParenToken;
|
||||
exports.isNotClosingParenToken = isNotClosingParenToken;
|
||||
const isColonToken = eslintUtils.isColonToken;
|
||||
exports.isColonToken = isColonToken;
|
||||
const isNotColonToken = eslintUtils.isNotColonToken;
|
||||
exports.isNotColonToken = isNotColonToken;
|
||||
const isCommaToken = eslintUtils.isCommaToken;
|
||||
exports.isCommaToken = isCommaToken;
|
||||
const isNotCommaToken = eslintUtils.isNotCommaToken;
|
||||
exports.isNotCommaToken = isNotCommaToken;
|
||||
const isCommentToken = eslintUtils.isCommentToken;
|
||||
exports.isCommentToken = isCommentToken;
|
||||
const isNotCommentToken = eslintUtils.isNotCommentToken;
|
||||
exports.isNotCommentToken = isNotCommentToken;
|
||||
const isOpeningBraceToken = eslintUtils.isOpeningBraceToken;
|
||||
exports.isOpeningBraceToken = isOpeningBraceToken;
|
||||
const isNotOpeningBraceToken = eslintUtils.isNotOpeningBraceToken;
|
||||
exports.isNotOpeningBraceToken = isNotOpeningBraceToken;
|
||||
const isOpeningBracketToken = eslintUtils.isOpeningBracketToken;
|
||||
exports.isOpeningBracketToken = isOpeningBracketToken;
|
||||
const isNotOpeningBracketToken = eslintUtils.isNotOpeningBracketToken;
|
||||
exports.isNotOpeningBracketToken = isNotOpeningBracketToken;
|
||||
const isOpeningParenToken = eslintUtils.isOpeningParenToken;
|
||||
exports.isOpeningParenToken = isOpeningParenToken;
|
||||
const isNotOpeningParenToken = eslintUtils.isNotOpeningParenToken;
|
||||
exports.isNotOpeningParenToken = isNotOpeningParenToken;
|
||||
const isSemicolonToken = eslintUtils.isSemicolonToken;
|
||||
exports.isSemicolonToken = isSemicolonToken;
|
||||
const isNotSemicolonToken = eslintUtils.isNotSemicolonToken;
|
||||
exports.isNotSemicolonToken = isNotSemicolonToken;
|
||||
//# sourceMappingURL=predicates.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/predicates.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAkB5C,MAAM,YAAY,GAChB,WAAW,CAAC,YAAwD,CAAC;AAuDrE,oCAAY;AAtDd,MAAM,eAAe,GACnB,WAAW,CAAC,eAA8D,CAAC;AA4D3E,0CAAe;AA1DjB,MAAM,mBAAmB,GACvB,WAAW,CAAC,mBAA8D,CAAC;AAmD3E,kDAAmB;AAlDrB,MAAM,sBAAsB,GAC1B,WAAW,CAAC,sBAAoE,CAAC;AAwDjF,wDAAsB;AAtDxB,MAAM,qBAAqB,GACzB,WAAW,CAAC,qBAAgE,CAAC;AA+C7E,sDAAqB;AA9CvB,MAAM,wBAAwB,GAC5B,WAAW,CAAC,wBAAsE,CAAC;AAoDnF,4DAAwB;AAlD1B,MAAM,mBAAmB,GACvB,WAAW,CAAC,mBAA8D,CAAC;AA2C3E,kDAAmB;AA1CrB,MAAM,sBAAsB,GAC1B,WAAW,CAAC,sBAAoE,CAAC;AAgDjF,wDAAsB;AA9CxB,MAAM,YAAY,GAChB,WAAW,CAAC,YAAuD,CAAC;AAuCpE,oCAAY;AAtCd,MAAM,eAAe,GACnB,WAAW,CAAC,eAA6D,CAAC;AA4C1E,0CAAe;AA1CjB,MAAM,YAAY,GAChB,WAAW,CAAC,YAAuD,CAAC;AAmCpE,oCAAY;AAlCd,MAAM,eAAe,GACnB,WAAW,CAAC,eAA6D,CAAC;AAwC1E,0CAAe;AAtCjB,MAAM,cAAc,GAClB,WAAW,CAAC,cAA2D,CAAC;AA+BxE,wCAAc;AA9BhB,MAAM,iBAAiB,GACrB,WAAW,CAAC,iBAAiE,CAAC;AAoC9E,8CAAiB;AAlCnB,MAAM,mBAAmB,GACvB,WAAW,CAAC,mBAA8D,CAAC;AAsC3E,kDAAmB;AArCrB,MAAM,sBAAsB,GAC1B,WAAW,CAAC,sBAAoE,CAAC;AAgCjF,wDAAsB;AA9BxB,MAAM,qBAAqB,GACzB,WAAW,CAAC,qBAAgE,CAAC;AAkC7E,sDAAqB;AAjCvB,MAAM,wBAAwB,GAC5B,WAAW,CAAC,wBAAsE,CAAC;AA4BnF,4DAAwB;AA1B1B,MAAM,mBAAmB,GACvB,WAAW,CAAC,mBAA8D,CAAC;AA8B3E,kDAAmB;AA7BrB,MAAM,sBAAsB,GAC1B,WAAW,CAAC,sBAAoE,CAAC;AAwBjF,wDAAsB;AAtBxB,MAAM,gBAAgB,GACpB,WAAW,CAAC,gBAA2D,CAAC;AA0BxE,4CAAgB;AAzBlB,MAAM,mBAAmB,GACvB,WAAW,CAAC,mBAAiE,CAAC;AAoB9E,kDAAmB"}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
import { TSESTree } from '../../ts-estree';
|
||||
import * as TSESLint from '../../ts-eslint';
|
||||
/**
|
||||
* Get the variable of a given name.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#findvariable}
|
||||
*/
|
||||
declare const findVariable: (initialScope: TSESLint.Scope.Scope, nameOrNode: string | TSESTree.Identifier) => TSESLint.Scope.Variable | null;
|
||||
/**
|
||||
* Get the innermost scope which contains a given node.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#getinnermostscope}
|
||||
* @returns The innermost scope which contains the given node.
|
||||
* If such scope doesn't exist then it returns the 1st argument `initialScope`.
|
||||
*/
|
||||
declare const getInnermostScope: (initialScope: TSESLint.Scope.Scope, node: TSESTree.Node) => TSESLint.Scope.Scope;
|
||||
export { findVariable, getInnermostScope };
|
||||
//# sourceMappingURL=scopeAnalysis.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"scopeAnalysis.d.ts","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/scopeAnalysis.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,KAAK,QAAQ,MAAM,iBAAiB,CAAC;AAE5C;;;;GAIG;AACH,QAAA,MAAM,YAAY,iBACF,SAAS,KAAK,CAAC,KAAK,cACtB,MAAM,GAAG,SAAS,UAAU,KACrC,SAAS,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC;AAEpC;;;;;;GAMG;AACH,QAAA,MAAM,iBAAiB,iBACP,SAAS,KAAK,CAAC,KAAK,QAC5B,SAAS,IAAI,KAChB,SAAS,KAAK,CAAC,KAAK,CAAC;AAE1B,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getInnermostScope = exports.findVariable = void 0;
|
||||
const eslintUtils = __importStar(require("eslint-utils"));
|
||||
/**
|
||||
* Get the variable of a given name.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#findvariable}
|
||||
*/
|
||||
const findVariable = eslintUtils.findVariable;
|
||||
exports.findVariable = findVariable;
|
||||
/**
|
||||
* Get the innermost scope which contains a given node.
|
||||
*
|
||||
* @see {@link https://eslint-utils.mysticatea.dev/api/scope-utils.html#getinnermostscope}
|
||||
* @returns The innermost scope which contains the given node.
|
||||
* If such scope doesn't exist then it returns the 1st argument `initialScope`.
|
||||
*/
|
||||
const getInnermostScope = eslintUtils.getInnermostScope;
|
||||
exports.getInnermostScope = getInnermostScope;
|
||||
//# sourceMappingURL=scopeAnalysis.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"scopeAnalysis.js","sourceRoot":"","sources":["../../../src/ast-utils/eslint-utils/scopeAnalysis.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0DAA4C;AAI5C;;;;GAIG;AACH,MAAM,YAAY,GAAG,WAAW,CAAC,YAGE,CAAC;AAc3B,oCAAY;AAZrB;;;;;;GAMG;AACH,MAAM,iBAAiB,GAAG,WAAW,CAAC,iBAGb,CAAC;AAEH,8CAAiB"}
|
||||
4
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts
generated
vendored
4
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts
generated
vendored
|
|
@ -1,4 +0,0 @@
|
|||
export * from './misc';
|
||||
export * from './predicates';
|
||||
export * from './eslint-utils';
|
||||
//# sourceMappingURL=index.d.ts.map
|
||||
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts.map
generated
vendored
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ast-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
|
||||
16
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js
generated
vendored
16
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js
generated
vendored
|
|
@ -1,16 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__exportStar(require("./misc"), exports);
|
||||
__exportStar(require("./predicates"), exports);
|
||||
__exportStar(require("./eslint-utils"), exports);
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js.map
generated
vendored
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/index.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ast-utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAuB;AACvB,+CAA6B;AAC7B,iDAA+B"}
|
||||
8
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts
generated
vendored
8
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts
generated
vendored
|
|
@ -1,8 +0,0 @@
|
|||
import { TSESTree } from '../ts-estree';
|
||||
declare const LINEBREAK_MATCHER: RegExp;
|
||||
/**
|
||||
* Determines whether two adjacent tokens are on the same line
|
||||
*/
|
||||
declare function isTokenOnSameLine(left: TSESTree.Token, right: TSESTree.Token): boolean;
|
||||
export { isTokenOnSameLine, LINEBREAK_MATCHER };
|
||||
//# sourceMappingURL=misc.d.ts.map
|
||||
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts.map
generated
vendored
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.d.ts.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../src/ast-utils/misc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,QAAA,MAAM,iBAAiB,QAA4B,CAAC;AAEpD;;GAEG;AACH,iBAAS,iBAAiB,CACxB,IAAI,EAAE,QAAQ,CAAC,KAAK,EACpB,KAAK,EAAE,QAAQ,CAAC,KAAK,GACpB,OAAO,CAET;AAED,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,CAAC"}
|
||||
13
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js
generated
vendored
13
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js
generated
vendored
|
|
@ -1,13 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.LINEBREAK_MATCHER = exports.isTokenOnSameLine = void 0;
|
||||
const LINEBREAK_MATCHER = /\r\n|[\r\n\u2028\u2029]/;
|
||||
exports.LINEBREAK_MATCHER = LINEBREAK_MATCHER;
|
||||
/**
|
||||
* Determines whether two adjacent tokens are on the same line
|
||||
*/
|
||||
function isTokenOnSameLine(left, right) {
|
||||
return left.loc.end.line === right.loc.start.line;
|
||||
}
|
||||
exports.isTokenOnSameLine = isTokenOnSameLine;
|
||||
//# sourceMappingURL=misc.js.map
|
||||
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js.map
generated
vendored
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/misc.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../src/ast-utils/misc.ts"],"names":[],"mappings":";;;AAEA,MAAM,iBAAiB,GAAG,yBAAyB,CAAC;AAYxB,8CAAiB;AAV7C;;GAEG;AACH,SAAS,iBAAiB,CACxB,IAAoB,EACpB,KAAqB;IAErB,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;AACpD,CAAC;AAEQ,8CAAiB"}
|
||||
84
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts
generated
vendored
84
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.d.ts
generated
vendored
|
|
@ -1,84 +0,0 @@
|
|||
import { AST_NODE_TYPES, TSESTree } from '../ts-estree';
|
||||
declare function isOptionalChainPunctuator(token: TSESTree.Token): token is TSESTree.PunctuatorToken & {
|
||||
value: '?.';
|
||||
};
|
||||
declare function isNotOptionalChainPunctuator(token: TSESTree.Token): token is Exclude<TSESTree.Token, TSESTree.PunctuatorToken & {
|
||||
value: '?.';
|
||||
}>;
|
||||
declare function isNonNullAssertionPunctuator(token: TSESTree.Token): token is TSESTree.PunctuatorToken & {
|
||||
value: '!';
|
||||
};
|
||||
declare function isNotNonNullAssertionPunctuator(token: TSESTree.Token): token is Exclude<TSESTree.Token, TSESTree.PunctuatorToken & {
|
||||
value: '!';
|
||||
}>;
|
||||
/**
|
||||
* Returns true if and only if the node represents: foo?.() or foo.bar?.()
|
||||
*/
|
||||
declare const isOptionalCallExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.CallExpression & {
|
||||
type: AST_NODE_TYPES.CallExpression;
|
||||
} & {
|
||||
optional: true;
|
||||
};
|
||||
/**
|
||||
* Returns true if and only if the node represents logical OR
|
||||
*/
|
||||
declare const isLogicalOrOperator: (node: TSESTree.Node | null | undefined) => node is TSESTree.LogicalExpression & {
|
||||
type: AST_NODE_TYPES.LogicalExpression;
|
||||
} & {
|
||||
operator: "||";
|
||||
};
|
||||
/**
|
||||
* Checks if a node is a type assertion:
|
||||
* ```
|
||||
* x as foo
|
||||
* <foo>x
|
||||
* ```
|
||||
*/
|
||||
declare function isTypeAssertion(node: TSESTree.Node | undefined | null): node is TSESTree.TSAsExpression | TSESTree.TSTypeAssertion;
|
||||
declare const isVariableDeclarator: (node: TSESTree.Node | null | undefined) => node is TSESTree.VariableDeclarator & {
|
||||
type: AST_NODE_TYPES.VariableDeclarator;
|
||||
};
|
||||
declare function isFunction(node: TSESTree.Node | undefined): node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression;
|
||||
declare function isFunctionType(node: TSESTree.Node | undefined): node is TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature;
|
||||
declare function isFunctionOrFunctionType(node: TSESTree.Node | undefined): node is TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression | TSESTree.TSCallSignatureDeclaration | TSESTree.TSConstructorType | TSESTree.TSConstructSignatureDeclaration | TSESTree.TSEmptyBodyFunctionExpression | TSESTree.TSFunctionType | TSESTree.TSMethodSignature;
|
||||
declare const isTSFunctionType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSFunctionType & {
|
||||
type: AST_NODE_TYPES.TSFunctionType;
|
||||
};
|
||||
declare const isTSConstructorType: (node: TSESTree.Node | null | undefined) => node is TSESTree.TSConstructorType & {
|
||||
type: AST_NODE_TYPES.TSConstructorType;
|
||||
};
|
||||
declare function isClassOrTypeElement(node: TSESTree.Node | undefined): node is TSESTree.ClassElement | TSESTree.TypeElement;
|
||||
/**
|
||||
* Checks if a node is a constructor method.
|
||||
*/
|
||||
declare const isConstructor: (node: TSESTree.Node | null | undefined) => node is (TSESTree.MethodDefinitionComputedName & {
|
||||
type: AST_NODE_TYPES.MethodDefinition;
|
||||
} & {
|
||||
kind: "constructor";
|
||||
}) | (TSESTree.MethodDefinitionNonComputedName & {
|
||||
type: AST_NODE_TYPES.MethodDefinition;
|
||||
} & {
|
||||
kind: "constructor";
|
||||
});
|
||||
/**
|
||||
* Checks if a node is a setter method.
|
||||
*/
|
||||
declare function isSetter(node: TSESTree.Node | undefined): node is TSESTree.MethodDefinition | TSESTree.Property;
|
||||
declare const isIdentifier: (node: TSESTree.Node | null | undefined) => node is TSESTree.Identifier & {
|
||||
type: AST_NODE_TYPES.Identifier;
|
||||
};
|
||||
/**
|
||||
* Checks if a node represents an `await …` expression.
|
||||
*/
|
||||
declare const isAwaitExpression: (node: TSESTree.Node | null | undefined) => node is TSESTree.AwaitExpression & {
|
||||
type: AST_NODE_TYPES.AwaitExpression;
|
||||
};
|
||||
/**
|
||||
* Checks if a possible token is the `await` keyword.
|
||||
*/
|
||||
declare function isAwaitKeyword(node: TSESTree.Token | undefined | null): node is TSESTree.IdentifierToken & {
|
||||
value: 'await';
|
||||
};
|
||||
declare function isLoop(node: TSESTree.Node | undefined | null): node is TSESTree.DoWhileStatement | TSESTree.ForStatement | TSESTree.ForInStatement | TSESTree.ForOfStatement | TSESTree.WhileStatement;
|
||||
export { isAwaitExpression, isAwaitKeyword, isConstructor, isClassOrTypeElement, isFunction, isFunctionOrFunctionType, isFunctionType, isIdentifier, isLoop, isLogicalOrOperator, isNonNullAssertionPunctuator, isNotNonNullAssertionPunctuator, isNotOptionalChainPunctuator, isOptionalChainPunctuator, isOptionalCallExpression, isSetter, isTSConstructorType, isTSFunctionType, isTypeAssertion, isVariableDeclarator, };
|
||||
//# sourceMappingURL=predicates.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"predicates.d.ts","sourceRoot":"","sources":["../../src/ast-utils/predicates.ts"],"names":[],"mappings":"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"}
|
||||
152
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js
generated
vendored
152
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js
generated
vendored
|
|
@ -1,152 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.isVariableDeclarator = exports.isTypeAssertion = exports.isTSFunctionType = exports.isTSConstructorType = exports.isSetter = exports.isOptionalCallExpression = exports.isOptionalChainPunctuator = exports.isNotOptionalChainPunctuator = exports.isNotNonNullAssertionPunctuator = exports.isNonNullAssertionPunctuator = exports.isLogicalOrOperator = exports.isLoop = exports.isIdentifier = exports.isFunctionType = exports.isFunctionOrFunctionType = exports.isFunction = exports.isClassOrTypeElement = exports.isConstructor = exports.isAwaitKeyword = exports.isAwaitExpression = void 0;
|
||||
const ts_estree_1 = require("../ts-estree");
|
||||
const isNodeOfType = (nodeType) => (node) => (node === null || node === void 0 ? void 0 : node.type) === nodeType;
|
||||
const isNodeOfTypeWithConditions = (nodeType, conditions) => {
|
||||
const entries = Object.entries(conditions);
|
||||
return (node) => (node === null || node === void 0 ? void 0 : node.type) === nodeType &&
|
||||
entries.every(([key, value]) => node[key] === value);
|
||||
};
|
||||
function isOptionalChainPunctuator(token) {
|
||||
return token.type === ts_estree_1.AST_TOKEN_TYPES.Punctuator && token.value === '?.';
|
||||
}
|
||||
exports.isOptionalChainPunctuator = isOptionalChainPunctuator;
|
||||
function isNotOptionalChainPunctuator(token) {
|
||||
return !isOptionalChainPunctuator(token);
|
||||
}
|
||||
exports.isNotOptionalChainPunctuator = isNotOptionalChainPunctuator;
|
||||
function isNonNullAssertionPunctuator(token) {
|
||||
return token.type === ts_estree_1.AST_TOKEN_TYPES.Punctuator && token.value === '!';
|
||||
}
|
||||
exports.isNonNullAssertionPunctuator = isNonNullAssertionPunctuator;
|
||||
function isNotNonNullAssertionPunctuator(token) {
|
||||
return !isNonNullAssertionPunctuator(token);
|
||||
}
|
||||
exports.isNotNonNullAssertionPunctuator = isNotNonNullAssertionPunctuator;
|
||||
/**
|
||||
* Returns true if and only if the node represents: foo?.() or foo.bar?.()
|
||||
*/
|
||||
const isOptionalCallExpression = isNodeOfTypeWithConditions(ts_estree_1.AST_NODE_TYPES.CallExpression,
|
||||
// this flag means the call expression itself is option
|
||||
// i.e. it is foo.bar?.() and not foo?.bar()
|
||||
{ optional: true });
|
||||
exports.isOptionalCallExpression = isOptionalCallExpression;
|
||||
/**
|
||||
* Returns true if and only if the node represents logical OR
|
||||
*/
|
||||
const isLogicalOrOperator = isNodeOfTypeWithConditions(ts_estree_1.AST_NODE_TYPES.LogicalExpression, { operator: '||' });
|
||||
exports.isLogicalOrOperator = isLogicalOrOperator;
|
||||
/**
|
||||
* Checks if a node is a type assertion:
|
||||
* ```
|
||||
* x as foo
|
||||
* <foo>x
|
||||
* ```
|
||||
*/
|
||||
function isTypeAssertion(node) {
|
||||
if (!node) {
|
||||
return false;
|
||||
}
|
||||
return (node.type === ts_estree_1.AST_NODE_TYPES.TSAsExpression ||
|
||||
node.type === ts_estree_1.AST_NODE_TYPES.TSTypeAssertion);
|
||||
}
|
||||
exports.isTypeAssertion = isTypeAssertion;
|
||||
const isVariableDeclarator = isNodeOfType(ts_estree_1.AST_NODE_TYPES.VariableDeclarator);
|
||||
exports.isVariableDeclarator = isVariableDeclarator;
|
||||
function isFunction(node) {
|
||||
if (!node) {
|
||||
return false;
|
||||
}
|
||||
return [
|
||||
ts_estree_1.AST_NODE_TYPES.ArrowFunctionExpression,
|
||||
ts_estree_1.AST_NODE_TYPES.FunctionDeclaration,
|
||||
ts_estree_1.AST_NODE_TYPES.FunctionExpression,
|
||||
].includes(node.type);
|
||||
}
|
||||
exports.isFunction = isFunction;
|
||||
function isFunctionType(node) {
|
||||
if (!node) {
|
||||
return false;
|
||||
}
|
||||
return [
|
||||
ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
|
||||
ts_estree_1.AST_NODE_TYPES.TSConstructorType,
|
||||
ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
|
||||
ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
|
||||
ts_estree_1.AST_NODE_TYPES.TSFunctionType,
|
||||
ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
|
||||
].includes(node.type);
|
||||
}
|
||||
exports.isFunctionType = isFunctionType;
|
||||
function isFunctionOrFunctionType(node) {
|
||||
return isFunction(node) || isFunctionType(node);
|
||||
}
|
||||
exports.isFunctionOrFunctionType = isFunctionOrFunctionType;
|
||||
const isTSFunctionType = isNodeOfType(ts_estree_1.AST_NODE_TYPES.TSFunctionType);
|
||||
exports.isTSFunctionType = isTSFunctionType;
|
||||
const isTSConstructorType = isNodeOfType(ts_estree_1.AST_NODE_TYPES.TSConstructorType);
|
||||
exports.isTSConstructorType = isTSConstructorType;
|
||||
function isClassOrTypeElement(node) {
|
||||
if (!node) {
|
||||
return false;
|
||||
}
|
||||
return [
|
||||
// ClassElement
|
||||
ts_estree_1.AST_NODE_TYPES.ClassProperty,
|
||||
ts_estree_1.AST_NODE_TYPES.FunctionExpression,
|
||||
ts_estree_1.AST_NODE_TYPES.MethodDefinition,
|
||||
ts_estree_1.AST_NODE_TYPES.TSAbstractClassProperty,
|
||||
ts_estree_1.AST_NODE_TYPES.TSAbstractMethodDefinition,
|
||||
ts_estree_1.AST_NODE_TYPES.TSEmptyBodyFunctionExpression,
|
||||
ts_estree_1.AST_NODE_TYPES.TSIndexSignature,
|
||||
// TypeElement
|
||||
ts_estree_1.AST_NODE_TYPES.TSCallSignatureDeclaration,
|
||||
ts_estree_1.AST_NODE_TYPES.TSConstructSignatureDeclaration,
|
||||
// AST_NODE_TYPES.TSIndexSignature,
|
||||
ts_estree_1.AST_NODE_TYPES.TSMethodSignature,
|
||||
ts_estree_1.AST_NODE_TYPES.TSPropertySignature,
|
||||
].includes(node.type);
|
||||
}
|
||||
exports.isClassOrTypeElement = isClassOrTypeElement;
|
||||
/**
|
||||
* Checks if a node is a constructor method.
|
||||
*/
|
||||
const isConstructor = isNodeOfTypeWithConditions(ts_estree_1.AST_NODE_TYPES.MethodDefinition, { kind: 'constructor' });
|
||||
exports.isConstructor = isConstructor;
|
||||
/**
|
||||
* Checks if a node is a setter method.
|
||||
*/
|
||||
function isSetter(node) {
|
||||
return (!!node &&
|
||||
(node.type === ts_estree_1.AST_NODE_TYPES.MethodDefinition ||
|
||||
node.type === ts_estree_1.AST_NODE_TYPES.Property) &&
|
||||
node.kind === 'set');
|
||||
}
|
||||
exports.isSetter = isSetter;
|
||||
const isIdentifier = isNodeOfType(ts_estree_1.AST_NODE_TYPES.Identifier);
|
||||
exports.isIdentifier = isIdentifier;
|
||||
/**
|
||||
* Checks if a node represents an `await …` expression.
|
||||
*/
|
||||
const isAwaitExpression = isNodeOfType(ts_estree_1.AST_NODE_TYPES.AwaitExpression);
|
||||
exports.isAwaitExpression = isAwaitExpression;
|
||||
/**
|
||||
* Checks if a possible token is the `await` keyword.
|
||||
*/
|
||||
function isAwaitKeyword(node) {
|
||||
return (node === null || node === void 0 ? void 0 : node.type) === ts_estree_1.AST_TOKEN_TYPES.Identifier && node.value === 'await';
|
||||
}
|
||||
exports.isAwaitKeyword = isAwaitKeyword;
|
||||
function isLoop(node) {
|
||||
if (!node) {
|
||||
return false;
|
||||
}
|
||||
return (node.type === ts_estree_1.AST_NODE_TYPES.DoWhileStatement ||
|
||||
node.type === ts_estree_1.AST_NODE_TYPES.ForStatement ||
|
||||
node.type === ts_estree_1.AST_NODE_TYPES.ForInStatement ||
|
||||
node.type === ts_estree_1.AST_NODE_TYPES.ForOfStatement ||
|
||||
node.type === ts_estree_1.AST_NODE_TYPES.WhileStatement);
|
||||
}
|
||||
exports.isLoop = isLoop;
|
||||
//# sourceMappingURL=predicates.js.map
|
||||
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js.map
generated
vendored
1
node_modules/@typescript-eslint/experimental-utils/dist/ast-utils/predicates.js.map
generated
vendored
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"predicates.js","sourceRoot":"","sources":["../../src/ast-utils/predicates.ts"],"names":[],"mappings":"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"}
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import { RuleCreateFunction, RuleModule } from '../ts-eslint';
|
||||
/**
|
||||
* Uses type inference to fetch the TOptions type from the given RuleModule
|
||||
*/
|
||||
declare type InferOptionsTypeFromRule<T> = T extends RuleModule<infer _TMessageIds, infer TOptions> ? TOptions : T extends RuleCreateFunction<infer _TMessageIds, infer TOptions> ? TOptions : unknown;
|
||||
/**
|
||||
* Uses type inference to fetch the TMessageIds type from the given RuleModule
|
||||
*/
|
||||
declare type InferMessageIdsTypeFromRule<T> = T extends RuleModule<infer TMessageIds, infer _TOptions> ? TMessageIds : T extends RuleCreateFunction<infer TMessageIds, infer _TOptions> ? TMessageIds : unknown;
|
||||
export { InferOptionsTypeFromRule, InferMessageIdsTypeFromRule };
|
||||
//# sourceMappingURL=InferTypesFromRule.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"InferTypesFromRule.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/InferTypesFromRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE9D;;GAEG;AACH,aAAK,wBAAwB,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CACrD,MAAM,YAAY,EAClB,MAAM,QAAQ,CACf,GACG,QAAQ,GACR,CAAC,SAAS,kBAAkB,CAAC,MAAM,YAAY,EAAE,MAAM,QAAQ,CAAC,GAChE,QAAQ,GACR,OAAO,CAAC;AAEZ;;GAEG;AACH,aAAK,2BAA2B,CAAC,CAAC,IAAI,CAAC,SAAS,UAAU,CACxD,MAAM,WAAW,EACjB,MAAM,SAAS,CAChB,GACG,WAAW,GACX,CAAC,SAAS,kBAAkB,CAAC,MAAM,WAAW,EAAE,MAAM,SAAS,CAAC,GAChE,WAAW,GACX,OAAO,CAAC;AAEZ,OAAO,EAAE,wBAAwB,EAAE,2BAA2B,EAAE,CAAC"}
|
||||
|
|
@ -1,3 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=InferTypesFromRule.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"InferTypesFromRule.js","sourceRoot":"","sources":["../../src/eslint-utils/InferTypesFromRule.ts"],"names":[],"mappings":""}
|
||||
13
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts
generated
vendored
13
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.d.ts
generated
vendored
|
|
@ -1,13 +0,0 @@
|
|||
import { RuleMetaData, RuleMetaDataDocs, RuleListener, RuleContext, RuleModule } from '../ts-eslint/Rule';
|
||||
declare type CreateRuleMetaDocs = Omit<RuleMetaDataDocs, 'url'>;
|
||||
declare type CreateRuleMeta<TMessageIds extends string> = {
|
||||
docs: CreateRuleMetaDocs;
|
||||
} & Omit<RuleMetaData<TMessageIds>, 'docs'>;
|
||||
declare function RuleCreator(urlCreator: (ruleName: string) => string): <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends RuleListener = RuleListener>({ name, meta, defaultOptions, create, }: Readonly<{
|
||||
name: string;
|
||||
meta: CreateRuleMeta<TMessageIds>;
|
||||
defaultOptions: Readonly<TOptions>;
|
||||
create: (context: Readonly<RuleContext<TMessageIds, TOptions>>, optionsWithDefault: Readonly<TOptions>) => TRuleListener;
|
||||
}>) => RuleModule<TMessageIds, TOptions, TRuleListener>;
|
||||
export { RuleCreator };
|
||||
//# sourceMappingURL=RuleCreator.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"RuleCreator.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/RuleCreator.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,UAAU,EACX,MAAM,mBAAmB,CAAC;AAI3B,aAAK,kBAAkB,GAAG,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;AACxD,aAAK,cAAc,CAAC,WAAW,SAAS,MAAM,IAAI;IAChD,IAAI,EAAE,kBAAkB,CAAC;CAC1B,GAAG,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC,CAAC;AAE5C,iBAAS,WAAW,CAAC,UAAU,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM;UAanD,MAAM;;;;wDA2Bf;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
||||
19
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js
generated
vendored
19
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleCreator.js
generated
vendored
|
|
@ -1,19 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RuleCreator = void 0;
|
||||
const applyDefault_1 = require("./applyDefault");
|
||||
function RuleCreator(urlCreator) {
|
||||
// This function will get much easier to call when this is merged https://github.com/Microsoft/TypeScript/pull/26349
|
||||
// TODO - when the above PR lands; add type checking for the context.report `data` property
|
||||
return function createRule({ name, meta, defaultOptions, create, }) {
|
||||
return {
|
||||
meta: Object.assign(Object.assign({}, meta), { docs: Object.assign(Object.assign({}, meta.docs), { url: urlCreator(name) }) }),
|
||||
create(context) {
|
||||
const optionsWithDefault = (0, applyDefault_1.applyDefault)(defaultOptions, context.options);
|
||||
return create(context, optionsWithDefault);
|
||||
},
|
||||
};
|
||||
};
|
||||
}
|
||||
exports.RuleCreator = RuleCreator;
|
||||
//# sourceMappingURL=RuleCreator.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"RuleCreator.js","sourceRoot":"","sources":["../../src/eslint-utils/RuleCreator.ts"],"names":[],"mappings":";;;AAOA,iDAA8C;AAQ9C,SAAS,WAAW,CAAC,UAAwC;IAC3D,oHAAoH;IACpH,2FAA2F;IAC3F,OAAO,SAAS,UAAU,CAIxB,EACA,IAAI,EACJ,IAAI,EACJ,cAAc,EACd,MAAM,GASN;QACA,OAAO;YACL,IAAI,kCACC,IAAI,KACP,IAAI,kCACC,IAAI,CAAC,IAAI,KACZ,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC,MAExB;YACD,MAAM,CACJ,OAAqD;gBAErD,MAAM,kBAAkB,GAAG,IAAA,2BAAY,EACrC,cAAc,EACd,OAAO,CAAC,OAAO,CAChB,CAAC;gBACF,OAAO,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;YAC7C,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAEQ,kCAAW"}
|
||||
18
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts
generated
vendored
18
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.d.ts
generated
vendored
|
|
@ -1,18 +0,0 @@
|
|||
import * as TSESLint from '../ts-eslint';
|
||||
declare const parser = "@typescript-eslint/parser";
|
||||
declare type RuleTesterConfig = Omit<TSESLint.RuleTesterConfig, 'parser'> & {
|
||||
parser: typeof parser;
|
||||
};
|
||||
declare class RuleTester extends TSESLint.RuleTester {
|
||||
#private;
|
||||
constructor(options: RuleTesterConfig);
|
||||
private getFilename;
|
||||
run<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(name: string, rule: TSESLint.RuleModule<TMessageIds, TOptions>, testsReadonly: TSESLint.RunTests<TMessageIds, TOptions>): void;
|
||||
}
|
||||
/**
|
||||
* Simple no-op tag to mark code samples as "should not format with prettier"
|
||||
* for the internal/plugin-test-formatting lint rule
|
||||
*/
|
||||
declare function noFormat(strings: TemplateStringsArray, ...keys: string[]): string;
|
||||
export { noFormat, RuleTester };
|
||||
//# sourceMappingURL=RuleTester.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"RuleTester.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/RuleTester.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,cAAc,CAAC;AAEzC,QAAA,MAAM,MAAM,8BAA8B,CAAC;AAE3C,aAAK,gBAAgB,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,QAAQ,CAAC,GAAG;IAClE,MAAM,EAAE,OAAO,MAAM,CAAC;CACvB,CAAC;AAEF,cAAM,UAAW,SAAQ,QAAQ,CAAC,UAAU;;gBAM9B,OAAO,EAAE,gBAAgB;IA0BrC,OAAO,CAAC,WAAW;IAuBnB,GAAG,CAAC,WAAW,SAAS,MAAM,EAAE,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAClE,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,WAAW,EAAE,QAAQ,CAAC,EAChD,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,GACtD,IAAI;CA4CR;AAED;;;GAGG;AACH,iBAAS,QAAQ,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,CAM1E;AAED,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC"}
|
||||
127
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js
generated
vendored
127
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/RuleTester.js
generated
vendored
|
|
@ -1,127 +0,0 @@
|
|||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
};
|
||||
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
};
|
||||
var _RuleTester_options;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.RuleTester = exports.noFormat = void 0;
|
||||
const path = __importStar(require("path"));
|
||||
const TSESLint = __importStar(require("../ts-eslint"));
|
||||
const parser = '@typescript-eslint/parser';
|
||||
class RuleTester extends TSESLint.RuleTester {
|
||||
// as of eslint 6 you have to provide an absolute path to the parser
|
||||
// but that's not as clean to type, this saves us trying to manually enforce
|
||||
// that contributors require.resolve everything
|
||||
constructor(options) {
|
||||
var _a, _b;
|
||||
super(Object.assign(Object.assign({}, options), { parserOptions: Object.assign(Object.assign({}, options.parserOptions), { warnOnUnsupportedTypeScriptVersion: (_b = (_a = options.parserOptions) === null || _a === void 0 ? void 0 : _a.warnOnUnsupportedTypeScriptVersion) !== null && _b !== void 0 ? _b : false }), parser: require.resolve(options.parser) }));
|
||||
_RuleTester_options.set(this, void 0);
|
||||
__classPrivateFieldSet(this, _RuleTester_options, options, "f");
|
||||
// make sure that the parser doesn't hold onto file handles between tests
|
||||
// on linux (i.e. our CI env), there can be very a limited number of watch handles available
|
||||
afterAll(() => {
|
||||
try {
|
||||
// instead of creating a hard dependency, just use a soft require
|
||||
// a bit weird, but if they're using this tooling, it'll be installed
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access
|
||||
require(parser).clearCaches();
|
||||
}
|
||||
catch (_a) {
|
||||
// ignored
|
||||
}
|
||||
});
|
||||
}
|
||||
getFilename(options) {
|
||||
var _a;
|
||||
if (options) {
|
||||
const filename = `file.ts${((_a = options.ecmaFeatures) === null || _a === void 0 ? void 0 : _a.jsx) ? 'x' : ''}`;
|
||||
if (options.project) {
|
||||
return path.join(options.tsconfigRootDir != null
|
||||
? options.tsconfigRootDir
|
||||
: process.cwd(), filename);
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
else if (__classPrivateFieldGet(this, _RuleTester_options, "f").parserOptions) {
|
||||
return this.getFilename(__classPrivateFieldGet(this, _RuleTester_options, "f").parserOptions);
|
||||
}
|
||||
return 'file.ts';
|
||||
}
|
||||
// as of eslint 6 you have to provide an absolute path to the parser
|
||||
// If you don't do that at the test level, the test will fail somewhat cryptically...
|
||||
// This is a lot more explicit
|
||||
run(name, rule, testsReadonly) {
|
||||
const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${parser}`;
|
||||
const tests = Object.assign({}, testsReadonly);
|
||||
// standardize the valid tests as objects
|
||||
tests.valid = tests.valid.map(test => {
|
||||
if (typeof test === 'string') {
|
||||
return {
|
||||
code: test,
|
||||
};
|
||||
}
|
||||
return test;
|
||||
});
|
||||
tests.valid = tests.valid.map(test => {
|
||||
if (typeof test !== 'string') {
|
||||
if (test.parser === parser) {
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
if (!test.filename) {
|
||||
return Object.assign(Object.assign({}, test), { filename: this.getFilename(test.parserOptions) });
|
||||
}
|
||||
}
|
||||
return test;
|
||||
});
|
||||
tests.invalid = tests.invalid.map(test => {
|
||||
if (test.parser === parser) {
|
||||
throw new Error(errorMessage);
|
||||
}
|
||||
if (!test.filename) {
|
||||
return Object.assign(Object.assign({}, test), { filename: this.getFilename(test.parserOptions) });
|
||||
}
|
||||
return test;
|
||||
});
|
||||
super.run(name, rule, tests);
|
||||
}
|
||||
}
|
||||
exports.RuleTester = RuleTester;
|
||||
_RuleTester_options = new WeakMap();
|
||||
/**
|
||||
* Simple no-op tag to mark code samples as "should not format with prettier"
|
||||
* for the internal/plugin-test-formatting lint rule
|
||||
*/
|
||||
function noFormat(strings, ...keys) {
|
||||
const lastIndex = strings.length - 1;
|
||||
return (strings.slice(0, lastIndex).reduce((p, s, i) => p + s + keys[i], '') +
|
||||
strings[lastIndex]);
|
||||
}
|
||||
exports.noFormat = noFormat;
|
||||
//# sourceMappingURL=RuleTester.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"RuleTester.js","sourceRoot":"","sources":["../../src/eslint-utils/RuleTester.ts"],"names":[],"mappings":"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"}
|
||||
10
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts
generated
vendored
10
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.d.ts
generated
vendored
|
|
@ -1,10 +0,0 @@
|
|||
/**
|
||||
* Pure function - doesn't mutate either parameter!
|
||||
* Uses the default options and overrides with the options provided by the user
|
||||
* @param defaultOptions the defaults
|
||||
* @param userOptions the user opts
|
||||
* @returns the options with defaults
|
||||
*/
|
||||
declare function applyDefault<TUser extends readonly unknown[], TDefault extends TUser>(defaultOptions: Readonly<TDefault>, userOptions: Readonly<TUser> | null): TDefault;
|
||||
export { applyDefault };
|
||||
//# sourceMappingURL=applyDefault.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"applyDefault.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/applyDefault.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,KAAK,SAAS,SAAS,OAAO,EAAE,EAAE,QAAQ,SAAS,KAAK,EAC5E,cAAc,EAAE,QAAQ,CAAC,QAAQ,CAAC,EAClC,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,GAClC,QAAQ,CAuBV;AAMD,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
||||
32
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js
generated
vendored
32
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/applyDefault.js
generated
vendored
|
|
@ -1,32 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.applyDefault = void 0;
|
||||
const deepMerge_1 = require("./deepMerge");
|
||||
/**
|
||||
* Pure function - doesn't mutate either parameter!
|
||||
* Uses the default options and overrides with the options provided by the user
|
||||
* @param defaultOptions the defaults
|
||||
* @param userOptions the user opts
|
||||
* @returns the options with defaults
|
||||
*/
|
||||
function applyDefault(defaultOptions, userOptions) {
|
||||
// clone defaults
|
||||
const options = JSON.parse(JSON.stringify(defaultOptions));
|
||||
if (userOptions === null || userOptions === undefined) {
|
||||
return options;
|
||||
}
|
||||
options.forEach((opt, i) => {
|
||||
if (userOptions[i] !== undefined) {
|
||||
const userOpt = userOptions[i];
|
||||
if ((0, deepMerge_1.isObjectNotArray)(userOpt) && (0, deepMerge_1.isObjectNotArray)(opt)) {
|
||||
options[i] = (0, deepMerge_1.deepMerge)(opt, userOpt);
|
||||
}
|
||||
else {
|
||||
options[i] = userOpt;
|
||||
}
|
||||
}
|
||||
});
|
||||
return options;
|
||||
}
|
||||
exports.applyDefault = applyDefault;
|
||||
//# sourceMappingURL=applyDefault.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"applyDefault.js","sourceRoot":"","sources":["../../src/eslint-utils/applyDefault.ts"],"names":[],"mappings":";;;AAAA,2CAA0D;AAE1D;;;;;;GAMG;AACH,SAAS,YAAY,CACnB,cAAkC,EAClC,WAAmC;IAEnC,iBAAiB;IACjB,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CACxB,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,CACR,CAAC;IAEzB,IAAI,WAAW,KAAK,IAAI,IAAI,WAAW,KAAK,SAAS,EAAE;QACrD,OAAO,OAAO,CAAC;KAChB;IAED,OAAO,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QACzB,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE;YAChC,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;YAE/B,IAAI,IAAA,4BAAgB,EAAC,OAAO,CAAC,IAAI,IAAA,4BAAgB,EAAC,GAAG,CAAC,EAAE;gBACtD,OAAO,CAAC,CAAC,CAAC,GAAG,IAAA,qBAAS,EAAC,GAAG,EAAE,OAAO,CAAC,CAAC;aACtC;iBAAM;gBACL,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC;aACtB;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC;AAMQ,oCAAY"}
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
import { ValidTestCase, InvalidTestCase } from '../ts-eslint';
|
||||
/**
|
||||
* Converts a batch of single line tests into a number of separate test cases.
|
||||
* This makes it easier to write tests which use the same options.
|
||||
*
|
||||
* Why wouldn't you just leave them as one test?
|
||||
* Because it makes the test error messages harder to decipher.
|
||||
* This way each line will fail separately, instead of them all failing together.
|
||||
*/
|
||||
declare function batchedSingleLineTests<TOptions extends Readonly<unknown[]>>(test: ValidTestCase<TOptions>): ValidTestCase<TOptions>[];
|
||||
/**
|
||||
* Converts a batch of single line tests into a number of separate test cases.
|
||||
* This makes it easier to write tests which use the same options.
|
||||
*
|
||||
* Why wouldn't you just leave them as one test?
|
||||
* Because it makes the test error messages harder to decipher.
|
||||
* This way each line will fail separately, instead of them all failing together.
|
||||
*
|
||||
* Make sure you have your line numbers correct for error reporting, as it will match
|
||||
* the line numbers up with the split tests!
|
||||
*/
|
||||
declare function batchedSingleLineTests<TMessageIds extends string, TOptions extends Readonly<unknown[]>>(test: InvalidTestCase<TMessageIds, TOptions>): InvalidTestCase<TMessageIds, TOptions>[];
|
||||
export { batchedSingleLineTests };
|
||||
//# sourceMappingURL=batchedSingleLineTests.d.ts.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"batchedSingleLineTests.d.ts","sourceRoot":"","sources":["../../src/eslint-utils/batchedSingleLineTests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE9D;;;;;;;GAOG;AACH,iBAAS,sBAAsB,CAAC,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAClE,IAAI,EAAE,aAAa,CAAC,QAAQ,CAAC,GAC5B,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;AAC7B;;;;;;;;;;GAUG;AACH,iBAAS,sBAAsB,CAC7B,WAAW,SAAS,MAAM,EAC1B,QAAQ,SAAS,QAAQ,CAAC,OAAO,EAAE,CAAC,EAEpC,IAAI,EAAE,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,GAC3C,eAAe,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,CAAC;AAwC5C,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.batchedSingleLineTests = void 0;
|
||||
function batchedSingleLineTests(options) {
|
||||
// eslint counts lines from 1
|
||||
const lineOffset = options.code.startsWith('\n') ? 2 : 1;
|
||||
const output = 'output' in options && options.output
|
||||
? options.output.trim().split('\n')
|
||||
: null;
|
||||
return options.code
|
||||
.trim()
|
||||
.split('\n')
|
||||
.map((code, i) => {
|
||||
const lineNum = i + lineOffset;
|
||||
const errors = 'errors' in options
|
||||
? options.errors.filter(e => e.line === lineNum)
|
||||
: [];
|
||||
const returnVal = Object.assign(Object.assign({}, options), { code, errors: errors.map(e => (Object.assign(Object.assign({}, e), { line: 1 }))) });
|
||||
if (output === null || output === void 0 ? void 0 : output[i]) {
|
||||
return Object.assign(Object.assign({}, returnVal), { output: output[i] });
|
||||
}
|
||||
return returnVal;
|
||||
});
|
||||
}
|
||||
exports.batchedSingleLineTests = batchedSingleLineTests;
|
||||
//# sourceMappingURL=batchedSingleLineTests.js.map
|
||||
|
|
@ -1 +0,0 @@
|
|||
{"version":3,"file":"batchedSingleLineTests.js","sourceRoot":"","sources":["../../src/eslint-utils/batchedSingleLineTests.ts"],"names":[],"mappings":";;;AA8BA,SAAS,sBAAsB,CAI7B,OAAyE;IAEzE,6BAA6B;IAC7B,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,MAAM,MAAM,GACV,QAAQ,IAAI,OAAO,IAAI,OAAO,CAAC,MAAM;QACnC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;QACnC,CAAC,CAAC,IAAI,CAAC;IACX,OAAO,OAAO,CAAC,IAAI;SAChB,IAAI,EAAE;SACN,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACf,MAAM,OAAO,GAAG,CAAC,GAAG,UAAU,CAAC;QAC/B,MAAM,MAAM,GACV,QAAQ,IAAI,OAAO;YACjB,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC;YAChD,CAAC,CAAC,EAAE,CAAC;QACT,MAAM,SAAS,mCACV,OAAO,KACV,IAAI,EACJ,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,iCACnB,CAAC,KACJ,IAAI,EAAE,CAAC,IACP,CAAC,GACJ,CAAC;QACF,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,CAAC,CAAC,EAAE;YACf,uCACK,SAAS,KACZ,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,IACjB;SACH;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,CAAC,CAAC;AACP,CAAC;AAEQ,wDAAsB"}
|
||||
17
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts
generated
vendored
17
node_modules/@typescript-eslint/experimental-utils/dist/eslint-utils/deepMerge.d.ts
generated
vendored
|
|
@ -1,17 +0,0 @@
|
|||
declare type ObjectLike<T = unknown> = Record<string, T>;
|
||||
/**
|
||||
* Check if the variable contains an object strictly rejecting arrays
|
||||
* @param obj an object
|
||||
* @returns `true` if obj is an object
|
||||
*/
|
||||
declare function isObjectNotArray<T extends ObjectLike>(obj: unknown | unknown[]): obj is T;
|
||||
/**
|
||||
* Pure function - doesn't mutate either parameter!
|
||||
* Merges two objects together deeply, overwriting the properties in first with the properties in second
|
||||
* @param first The first object
|
||||
* @param second The second object
|
||||
* @returns a new object
|
||||
*/
|
||||
export declare function deepMerge(first?: ObjectLike, second?: ObjectLike): Record<string, unknown>;
|
||||
export { isObjectNotArray };
|
||||
//# sourceMappingURL=deepMerge.d.ts.map
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue