@jameswyse/oxc-config 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +213 -0
- package/REFERENCE.md +134 -0
- package/dist/format.d.ts +5 -0
- package/dist/format.js +47 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +97 -0
- package/dist/lint.d.ts +33 -0
- package/dist/lint.js +493 -0
- package/dist/rules/companion-has-owner.d.ts +1 -0
- package/dist/rules/companion-has-owner.js +74 -0
- package/dist/rules/electron-no-raw-ipc-renderer-exposure.d.ts +1 -0
- package/dist/rules/electron-no-raw-ipc-renderer-exposure.js +127 -0
- package/dist/rules/electron-no-remote-module.d.ts +1 -0
- package/dist/rules/electron-no-remote-module.js +112 -0
- package/dist/rules/electron-secure-web-preferences.d.ts +1 -0
- package/dist/rules/electron-secure-web-preferences.js +108 -0
- package/dist/rules/explicit-api-states.d.ts +1 -0
- package/dist/rules/explicit-api-states.js +143 -0
- package/dist/rules/import-boundaries.d.ts +1 -0
- package/dist/rules/import-boundaries.js +99 -0
- package/dist/rules/no-ambient-clock.d.ts +1 -0
- package/dist/rules/no-ambient-clock.js +35 -0
- package/dist/rules/no-ambient-random.d.ts +1 -0
- package/dist/rules/no-ambient-random.js +71 -0
- package/dist/rules/no-comments.d.ts +1 -0
- package/dist/rules/no-comments.js +64 -0
- package/dist/rules/no-deep-ternary.d.ts +1 -0
- package/dist/rules/no-deep-ternary.js +32 -0
- package/dist/rules/no-edit-proof-assertions.d.ts +1 -0
- package/dist/rules/no-edit-proof-assertions.js +120 -0
- package/dist/rules/no-env-access.d.ts +1 -0
- package/dist/rules/no-env-access.js +35 -0
- package/dist/rules/no-fixed-test-delay.d.ts +1 -0
- package/dist/rules/no-fixed-test-delay.js +130 -0
- package/dist/rules/no-forwarding-module.d.ts +1 -0
- package/dist/rules/no-forwarding-module.js +158 -0
- package/dist/rules/no-generic-file-suffix.d.ts +1 -0
- package/dist/rules/no-generic-file-suffix.js +74 -0
- package/dist/rules/no-pass-through-function.d.ts +1 -0
- package/dist/rules/no-pass-through-function.js +106 -0
- package/dist/rules/no-swallowed-errors.d.ts +1 -0
- package/dist/rules/no-swallowed-errors.js +168 -0
- package/dist/rules/no-test-timeout-overrides.d.ts +1 -0
- package/dist/rules/no-test-timeout-overrides.js +105 -0
- package/dist/rules/no-vacuous-test-assertions.d.ts +1 -0
- package/dist/rules/no-vacuous-test-assertions.js +71 -0
- package/dist/rules/server-action-guard.d.ts +1 -0
- package/dist/rules/server-action-guard.js +109 -0
- package/dist/rules/statement-spacing.d.ts +1 -0
- package/dist/rules/statement-spacing.js +29 -0
- package/dist/rules/type-guard-name.d.ts +1 -0
- package/dist/rules/type-guard-name.js +59 -0
- package/dist/shared/index.d.ts +26 -0
- package/dist/shared/index.js +260 -0
- package/dist/shared/rule-options.d.ts +2 -0
- package/dist/shared/rule-options.js +8 -0
- package/dist/vendor/anti-slop/effect/rules/no-manual-effect-error-tag.d.ts +1 -0
- package/dist/vendor/anti-slop/effect/rules/no-manual-effect-error-tag.js +35 -0
- package/dist/vendor/anti-slop/effect/rules/no-service-constructor-imports.d.ts +1 -0
- package/dist/vendor/anti-slop/effect/rules/no-service-constructor-imports.js +48 -0
- package/dist/vendor/anti-slop/effect/shared/tagged-values.d.ts +9 -0
- package/dist/vendor/anti-slop/effect/shared/tagged-values.js +65 -0
- package/dist/vendor/anti-slop/rules/no-array-filter-map.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-array-filter-map.js +40 -0
- package/dist/vendor/anti-slop/rules/no-chained-type-assertions.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-chained-type-assertions.js +58 -0
- package/dist/vendor/anti-slop/rules/no-conditional-empty-object-spread.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-conditional-empty-object-spread.js +41 -0
- package/dist/vendor/anti-slop/rules/no-known-value-widening.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-known-value-widening.js +333 -0
- package/dist/vendor/anti-slop/rules/no-module-mocking.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-module-mocking.js +74 -0
- package/dist/vendor/anti-slop/rules/no-object-parameters.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-object-parameters.js +59 -0
- package/dist/vendor/anti-slop/rules/no-reduce-accumulator-copy.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-reduce-accumulator-copy.js +124 -0
- package/dist/vendor/anti-slop/rules/no-reflect-apply.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-reflect-apply.js +26 -0
- package/dist/vendor/anti-slop/rules/no-reflect-get.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-reflect-get.js +26 -0
- package/dist/vendor/anti-slop/rules/no-runtime-typeof.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-runtime-typeof.js +63 -0
- package/dist/vendor/anti-slop/rules/no-shape-in-symbol-names.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-shape-in-symbol-names.js +37 -0
- package/dist/vendor/anti-slop/rules/no-unknown-returns.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-unknown-returns.js +61 -0
- package/dist/vendor/anti-slop/rules/no-unknown-type-aliases.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-unknown-type-aliases.js +38 -0
- package/dist/vendor/anti-slop/rules/no-unsafe-dictionary-type.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-unsafe-dictionary-type.js +143 -0
- package/dist/vendor/anti-slop/rules/no-widen-then-assert.d.ts +1 -0
- package/dist/vendor/anti-slop/rules/no-widen-then-assert.js +288 -0
- package/dist/vendor/anti-slop/shared/array-method.d.ts +10 -0
- package/dist/vendor/anti-slop/shared/array-method.js +95 -0
- package/dist/vendor/anti-slop/shared/dictionary-types.d.ts +23 -0
- package/dist/vendor/anti-slop/shared/dictionary-types.js +408 -0
- package/dist/vendor/anti-slop/shared/function-parameters.d.ts +6 -0
- package/dist/vendor/anti-slop/shared/function-parameters.js +41 -0
- package/dist/vendor/anti-slop/shared/lexical-type-parameters.d.ts +4 -0
- package/dist/vendor/anti-slop/shared/lexical-type-parameters.js +32 -0
- package/dist/vendor/anti-slop/shared/reflect-method.d.ts +3 -0
- package/dist/vendor/anti-slop/shared/reflect-method.js +24 -0
- package/dist/vendor/anti-slop/shared/scope.d.ts +3 -0
- package/dist/vendor/anti-slop/shared/scope.js +12 -0
- package/dist/vendor/anti-slop/shared/type-alias-resolution.d.ts +21 -0
- package/dist/vendor/anti-slop/shared/type-alias-resolution.js +147 -0
- package/dist/vendor/eslint-stylistic/padding-line-ast.d.ts +14 -0
- package/dist/vendor/eslint-stylistic/padding-line-ast.js +19 -0
- package/dist/vendor/eslint-stylistic/padding-line-between-statements.d.ts +91 -0
- package/dist/vendor/eslint-stylistic/padding-line-between-statements.js +493 -0
- package/package.json +89 -0
- package/src/vendor/anti-slop/LICENSE +21 -0
- package/src/vendor/eslint-stylistic/LICENSE +22 -0
- package/tsconfig.base.json +10 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { ESTree, SourceCode } from "@oxlint/plugins";
|
|
2
|
+
type VisitorKeys = SourceCode["visitorKeys"];
|
|
3
|
+
type DeclaredTypeBinding = {
|
|
4
|
+
readonly alias: ESTree.TSTypeAliasDeclaration | null;
|
|
5
|
+
readonly name: string;
|
|
6
|
+
};
|
|
7
|
+
type TypeBinding = DeclaredTypeBinding & {
|
|
8
|
+
readonly scope: ESTree.Node;
|
|
9
|
+
};
|
|
10
|
+
type TypeAliasEnvironment = {
|
|
11
|
+
readonly aliases: readonly ESTree.TSTypeAliasDeclaration[];
|
|
12
|
+
readonly bindingsByName: ReadonlyMap<string, readonly TypeBinding[]>;
|
|
13
|
+
readonly visitorKeys: VisitorKeys;
|
|
14
|
+
};
|
|
15
|
+
type ResolvedTypeMatcher = (type: ESTree.TSType, matches: (child: ESTree.TSType) => boolean) => boolean;
|
|
16
|
+
declare function createTypeAliasEnvironment(program: ESTree.Program, visitorKeys: VisitorKeys): TypeAliasEnvironment;
|
|
17
|
+
declare function visibleTypeAlias(name: string, use: ESTree.Node, environment: TypeAliasEnvironment): ESTree.TSTypeAliasDeclaration | null;
|
|
18
|
+
declare function hasVisibleTypeBinding(name: string, use: ESTree.Node, environment: TypeAliasEnvironment): boolean;
|
|
19
|
+
declare function resolvedTypeMatches(type: ESTree.TSType, environment: TypeAliasEnvironment, matcher: ResolvedTypeMatcher): boolean;
|
|
20
|
+
export type { ResolvedTypeMatcher, TypeAliasEnvironment };
|
|
21
|
+
export { createTypeAliasEnvironment, hasVisibleTypeBinding, resolvedTypeMatches, visibleTypeAlias };
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { childNodes } from "../../../shared/index.js";
|
|
2
|
+
import { lexicalTypeParameterNames } from "./lexical-type-parameters.js";
|
|
3
|
+
const environmentsByProgram = new WeakMap();
|
|
4
|
+
function enclosingTypeScope(node) {
|
|
5
|
+
let current = node.parent;
|
|
6
|
+
while (current !== null) {
|
|
7
|
+
if (current.type === "Program" ||
|
|
8
|
+
current.type === "BlockStatement" ||
|
|
9
|
+
current.type === "TSModuleBlock" ||
|
|
10
|
+
current.type === "StaticBlock" ||
|
|
11
|
+
current.type === "SwitchStatement") {
|
|
12
|
+
return current;
|
|
13
|
+
}
|
|
14
|
+
current = current.parent;
|
|
15
|
+
}
|
|
16
|
+
return node;
|
|
17
|
+
}
|
|
18
|
+
function declaredTypeBinding(node) {
|
|
19
|
+
if (node.type === "TSTypeAliasDeclaration") {
|
|
20
|
+
return { alias: node, name: node.id.name };
|
|
21
|
+
}
|
|
22
|
+
if (node.type === "TSInterfaceDeclaration" ||
|
|
23
|
+
node.type === "TSEnumDeclaration" ||
|
|
24
|
+
node.type === "ClassDeclaration" ||
|
|
25
|
+
node.type === "ClassExpression") {
|
|
26
|
+
return node.id === null ? null : { alias: null, name: node.id.name };
|
|
27
|
+
}
|
|
28
|
+
if (node.type === "ImportSpecifier" ||
|
|
29
|
+
node.type === "ImportDefaultSpecifier" ||
|
|
30
|
+
node.type === "ImportNamespaceSpecifier") {
|
|
31
|
+
return { alias: null, name: node.local.name };
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
function collectTypeBindings(node, visitorKeys, bindingsByName, aliases) {
|
|
36
|
+
const declared = declaredTypeBinding(node);
|
|
37
|
+
if (declared !== null) {
|
|
38
|
+
const bindings = bindingsByName.get(declared.name) ?? [];
|
|
39
|
+
bindings.push({ ...declared, scope: enclosingTypeScope(node) });
|
|
40
|
+
bindingsByName.set(declared.name, bindings);
|
|
41
|
+
if (declared.alias !== null) {
|
|
42
|
+
aliases.push(declared.alias);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
for (const child of childNodes(node, visitorKeys)) {
|
|
46
|
+
collectTypeBindings(child, visitorKeys, bindingsByName, aliases);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function createTypeAliasEnvironment(program, visitorKeys) {
|
|
50
|
+
const cached = environmentsByProgram.get(program);
|
|
51
|
+
if (cached !== void 0) {
|
|
52
|
+
return cached;
|
|
53
|
+
}
|
|
54
|
+
const bindingsByName = new Map();
|
|
55
|
+
const aliases = [];
|
|
56
|
+
collectTypeBindings(program, visitorKeys, bindingsByName, aliases);
|
|
57
|
+
const environment = { aliases, bindingsByName, visitorKeys };
|
|
58
|
+
environmentsByProgram.set(program, environment);
|
|
59
|
+
return environment;
|
|
60
|
+
}
|
|
61
|
+
function ancestorDistance(ancestor, node) {
|
|
62
|
+
let current = node;
|
|
63
|
+
let distance = 0;
|
|
64
|
+
while (current !== null) {
|
|
65
|
+
if (current === ancestor) {
|
|
66
|
+
return distance;
|
|
67
|
+
}
|
|
68
|
+
current = current.parent;
|
|
69
|
+
distance += 1;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
function nearestTypeBindings(name, use, environment) {
|
|
74
|
+
const candidates = environment.bindingsByName.get(name) ?? [];
|
|
75
|
+
let nearestDistance = Number.POSITIVE_INFINITY;
|
|
76
|
+
let nearest = [];
|
|
77
|
+
for (const candidate of candidates) {
|
|
78
|
+
const distance = ancestorDistance(candidate.scope, use);
|
|
79
|
+
if (distance === null || distance > nearestDistance) {
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
if (distance === nearestDistance) {
|
|
83
|
+
nearest.push(candidate);
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
nearestDistance = distance;
|
|
87
|
+
nearest = [candidate];
|
|
88
|
+
}
|
|
89
|
+
return nearest;
|
|
90
|
+
}
|
|
91
|
+
function visibleTypeAlias(name, use, environment) {
|
|
92
|
+
if (lexicalTypeParameterNames(use, environment.visitorKeys).has(name)) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
const bindings = nearestTypeBindings(name, use, environment);
|
|
96
|
+
return bindings.length === 1 ? (bindings[0]?.alias ?? null) : null;
|
|
97
|
+
}
|
|
98
|
+
function hasVisibleTypeBinding(name, use, environment) {
|
|
99
|
+
return (lexicalTypeParameterNames(use, environment.visitorKeys).has(name) ||
|
|
100
|
+
nearestTypeBindings(name, use, environment).length > 0);
|
|
101
|
+
}
|
|
102
|
+
function typeReferenceName(type) {
|
|
103
|
+
return type.typeName.type === "Identifier" ? type.typeName.name : null;
|
|
104
|
+
}
|
|
105
|
+
function aliasSubstitutions(alias, reference, base) {
|
|
106
|
+
const parameters = alias.typeParameters?.params ?? [];
|
|
107
|
+
const arguments_ = reference.typeArguments?.params ?? [];
|
|
108
|
+
const next = new Map(base);
|
|
109
|
+
for (const [index, parameter] of parameters.entries()) {
|
|
110
|
+
const explicitArgument = arguments_[index];
|
|
111
|
+
const argument = explicitArgument ?? parameter.default;
|
|
112
|
+
if (argument === null) {
|
|
113
|
+
return null;
|
|
114
|
+
}
|
|
115
|
+
const argumentSubstitutions = explicitArgument === void 0 ? next : base;
|
|
116
|
+
next.set(parameter.name.name, {
|
|
117
|
+
type: argument,
|
|
118
|
+
substitutions: new Map(argumentSubstitutions),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return next;
|
|
122
|
+
}
|
|
123
|
+
function resolvedTypeMatches(type, environment, matcher) {
|
|
124
|
+
const evaluate = (current, substitutions, resolvingAliases) => {
|
|
125
|
+
if (current.type === "TSTypeReference") {
|
|
126
|
+
const name = typeReferenceName(current);
|
|
127
|
+
if (name !== null) {
|
|
128
|
+
const substitution = substitutions.get(name);
|
|
129
|
+
if (substitution !== void 0 && !current.typeArguments?.params.length) {
|
|
130
|
+
return evaluate(substitution.type, substitution.substitutions, resolvingAliases);
|
|
131
|
+
}
|
|
132
|
+
const alias = visibleTypeAlias(name, current, environment);
|
|
133
|
+
if (alias !== null && !resolvingAliases.has(alias)) {
|
|
134
|
+
const nextSubstitutions = aliasSubstitutions(alias, current, substitutions);
|
|
135
|
+
if (nextSubstitutions !== null) {
|
|
136
|
+
const nextResolving = new Set(resolvingAliases);
|
|
137
|
+
nextResolving.add(alias);
|
|
138
|
+
return evaluate(alias.typeAnnotation, nextSubstitutions, nextResolving);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return matcher(current, (child) => evaluate(child, substitutions, resolvingAliases));
|
|
144
|
+
};
|
|
145
|
+
return evaluate(type, new Map(), new Set());
|
|
146
|
+
}
|
|
147
|
+
export { createTypeAliasEnvironment, hasVisibleTypeBinding, resolvedTypeMatches, visibleTypeAlias };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Comment, ESTree, SourceCode, Span, Token } from "@oxlint/plugins";
|
|
2
|
+
type TokenOrComment = Token | Comment;
|
|
3
|
+
declare const LINEBREAKS: Set<string>;
|
|
4
|
+
declare const isClosingBraceToken: (token: TokenOrComment) => boolean;
|
|
5
|
+
declare const isSemicolonToken: (token: TokenOrComment) => boolean;
|
|
6
|
+
declare const isNotSemicolonToken: (token: TokenOrComment) => boolean;
|
|
7
|
+
declare const isTokenOnSameLine: (left: Pick<Span, "loc">, right: Pick<Span, "loc">) => boolean;
|
|
8
|
+
declare const isFunction: (node: ESTree.Node) => boolean;
|
|
9
|
+
declare const isSingleLine: (node: ESTree.Node) => boolean;
|
|
10
|
+
declare const skipChainExpression: (node: ESTree.Node) => ESTree.Node;
|
|
11
|
+
declare const isTopLevelExpressionStatement: (node: ESTree.Node) => node is ESTree.ExpressionStatement;
|
|
12
|
+
declare function isParenthesized(node: ESTree.Node, sourceCode: SourceCode): boolean;
|
|
13
|
+
export type { TokenOrComment };
|
|
14
|
+
export { LINEBREAKS, isClosingBraceToken, isFunction, isNotSemicolonToken, isParenthesized, isSemicolonToken, isSingleLine, isTokenOnSameLine, isTopLevelExpressionStatement, skipChainExpression, };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]);
|
|
2
|
+
const isClosingBraceToken = (token) => token.type === "Punctuator" && token.value === "}";
|
|
3
|
+
const isSemicolonToken = (token) => token.type === "Punctuator" && token.value === ";";
|
|
4
|
+
const isNotSemicolonToken = (token) => !isSemicolonToken(token);
|
|
5
|
+
const isTokenOnSameLine = (left, right) => left.loc.end.line === right.loc.start.line;
|
|
6
|
+
const isFunction = (node) => node.type === "FunctionDeclaration" ||
|
|
7
|
+
node.type === "FunctionExpression" ||
|
|
8
|
+
node.type === "ArrowFunctionExpression";
|
|
9
|
+
const isSingleLine = (node) => node.loc.start.line === node.loc.end.line;
|
|
10
|
+
const skipChainExpression = (node) => node.type === "ChainExpression" ? node.expression : node;
|
|
11
|
+
const isTopLevelExpressionStatement = (node) => node.type === "ExpressionStatement" &&
|
|
12
|
+
(node.parent.type === "Program" ||
|
|
13
|
+
(node.parent.type === "BlockStatement" && isFunction(node.parent.parent)));
|
|
14
|
+
function isParenthesized(node, sourceCode) {
|
|
15
|
+
const before = sourceCode.getTokenBefore(node);
|
|
16
|
+
const after = sourceCode.getTokenAfter(node);
|
|
17
|
+
return before?.value === "(" && after?.value === ")";
|
|
18
|
+
}
|
|
19
|
+
export { LINEBREAKS, isClosingBraceToken, isFunction, isNotSemicolonToken, isParenthesized, isSemicolonToken, isSingleLine, isTokenOnSameLine, isTopLevelExpressionStatement, skipChainExpression, };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { CreateRule, ESTree, SourceCode } from "@oxlint/plugins";
|
|
2
|
+
type NodeTestObject = {
|
|
3
|
+
readonly test: (node: ESTree.Node, sourceCode: SourceCode) => boolean;
|
|
4
|
+
};
|
|
5
|
+
type PaddingType = "any" | "never" | "always";
|
|
6
|
+
type SelectorOption = {
|
|
7
|
+
readonly selector: string;
|
|
8
|
+
readonly lineMode?: "any" | "singleline" | "multiline";
|
|
9
|
+
};
|
|
10
|
+
type StatementMatcher = StatementType | SelectorOption;
|
|
11
|
+
type StatementOption = StatementMatcher | readonly StatementMatcher[];
|
|
12
|
+
type PaddingLineOption = {
|
|
13
|
+
readonly blankLine: PaddingType;
|
|
14
|
+
readonly prev: StatementOption;
|
|
15
|
+
readonly next: StatementOption;
|
|
16
|
+
};
|
|
17
|
+
declare function isIIFEStatement(node: ESTree.Node): boolean;
|
|
18
|
+
declare function isCJSRequire(node: ESTree.Node): boolean;
|
|
19
|
+
declare function isBlockLikeStatement(node: ESTree.Node, sourceCode: SourceCode): boolean;
|
|
20
|
+
declare function isDirectivePrologue(node: ESTree.Node, sourceCode: SourceCode): boolean;
|
|
21
|
+
declare function isCJSExport(node: ESTree.Node): boolean;
|
|
22
|
+
declare function isExpression(node: ESTree.Node, sourceCode: SourceCode): boolean;
|
|
23
|
+
declare function hasCJSExportText(node: ESTree.Node, sourceCode: SourceCode): boolean;
|
|
24
|
+
declare function hasCJSImportText(node: ESTree.Node, sourceCode: SourceCode): boolean;
|
|
25
|
+
declare const MaybeMultilineStatementType: {
|
|
26
|
+
"block-like": {
|
|
27
|
+
test: typeof isBlockLikeStatement;
|
|
28
|
+
};
|
|
29
|
+
expression: {
|
|
30
|
+
test: typeof isExpression;
|
|
31
|
+
};
|
|
32
|
+
return: NodeTestObject;
|
|
33
|
+
export: NodeTestObject;
|
|
34
|
+
var: NodeTestObject;
|
|
35
|
+
let: NodeTestObject;
|
|
36
|
+
const: NodeTestObject;
|
|
37
|
+
using: {
|
|
38
|
+
test: (node: ESTree.Node) => boolean;
|
|
39
|
+
};
|
|
40
|
+
type: NodeTestObject;
|
|
41
|
+
};
|
|
42
|
+
declare const BaseStatementTypes: {
|
|
43
|
+
"*": {
|
|
44
|
+
test: () => true;
|
|
45
|
+
};
|
|
46
|
+
exports: {
|
|
47
|
+
test: typeof isCJSExport;
|
|
48
|
+
};
|
|
49
|
+
require: {
|
|
50
|
+
test: typeof isCJSRequire;
|
|
51
|
+
};
|
|
52
|
+
directive: {
|
|
53
|
+
test: typeof isDirectivePrologue;
|
|
54
|
+
};
|
|
55
|
+
iife: {
|
|
56
|
+
test: typeof isIIFEStatement;
|
|
57
|
+
};
|
|
58
|
+
block: NodeTestObject;
|
|
59
|
+
empty: NodeTestObject;
|
|
60
|
+
function: NodeTestObject;
|
|
61
|
+
"ts-method": NodeTestObject;
|
|
62
|
+
break: NodeTestObject;
|
|
63
|
+
case: NodeTestObject;
|
|
64
|
+
class: NodeTestObject;
|
|
65
|
+
continue: NodeTestObject;
|
|
66
|
+
debugger: NodeTestObject;
|
|
67
|
+
default: NodeTestObject;
|
|
68
|
+
do: NodeTestObject;
|
|
69
|
+
for: NodeTestObject;
|
|
70
|
+
if: NodeTestObject;
|
|
71
|
+
import: NodeTestObject;
|
|
72
|
+
switch: NodeTestObject;
|
|
73
|
+
throw: NodeTestObject;
|
|
74
|
+
try: NodeTestObject;
|
|
75
|
+
while: NodeTestObject;
|
|
76
|
+
with: NodeTestObject;
|
|
77
|
+
"cjs-export": {
|
|
78
|
+
test: typeof hasCJSExportText;
|
|
79
|
+
};
|
|
80
|
+
"cjs-import": {
|
|
81
|
+
test: typeof hasCJSImportText;
|
|
82
|
+
};
|
|
83
|
+
enum: NodeTestObject;
|
|
84
|
+
interface: NodeTestObject;
|
|
85
|
+
"function-overload": NodeTestObject;
|
|
86
|
+
};
|
|
87
|
+
type MaybeMultilineStatementKey = keyof typeof MaybeMultilineStatementType;
|
|
88
|
+
type StatementType = keyof typeof BaseStatementTypes | MaybeMultilineStatementKey | `singleline-${MaybeMultilineStatementKey}` | `multiline-${MaybeMultilineStatementKey}`;
|
|
89
|
+
declare function createPaddingLineRule(options: readonly PaddingLineOption[]): CreateRule;
|
|
90
|
+
export type { PaddingLineOption, SelectorOption, StatementOption };
|
|
91
|
+
export { createPaddingLineRule as default };
|