@siim-m/config 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +57 -2
- package/dist/anti-slop/LICENSE +21 -0
- package/dist/anti-slop/effect/baseline.d.ts +18 -0
- package/dist/anti-slop/effect/baseline.js +41 -0
- package/dist/anti-slop/effect/index.d.ts +3 -0
- package/dist/anti-slop/effect/index.js +16 -0
- package/dist/anti-slop/effect/rules/no-manual-effect-error-tag.d.ts +1 -0
- package/dist/anti-slop/effect/rules/no-manual-effect-error-tag.js +39 -0
- package/dist/anti-slop/effect/rules/no-service-constructor-imports.d.ts +2 -0
- package/dist/anti-slop/effect/rules/no-service-constructor-imports.js +44 -0
- package/dist/anti-slop/effect/rules/no-service-parameters.d.ts +2 -0
- package/dist/anti-slop/effect/rules/no-service-parameters.js +181 -0
- package/dist/anti-slop/effect/rules/prefer-effect-match.d.ts +1 -0
- package/dist/anti-slop/effect/rules/prefer-effect-match.js +48 -0
- package/dist/anti-slop/effect/shared/tagged-values.d.ts +8 -0
- package/dist/anti-slop/effect/shared/tagged-values.js +68 -0
- package/dist/anti-slop/index.d.ts +3 -0
- package/dist/anti-slop/index.js +42 -0
- package/dist/anti-slop/rules/no-chained-type-assertions.d.ts +2 -0
- package/dist/anti-slop/rules/no-chained-type-assertions.js +60 -0
- package/dist/anti-slop/rules/no-conditional-empty-object-spread.d.ts +2 -0
- package/dist/anti-slop/rules/no-conditional-empty-object-spread.js +40 -0
- package/dist/anti-slop/rules/no-known-value-widening.d.ts +2 -0
- package/dist/anti-slop/rules/no-known-value-widening.js +300 -0
- package/dist/anti-slop/rules/no-module-mocking.d.ts +2 -0
- package/dist/anti-slop/rules/no-module-mocking.js +69 -0
- package/dist/anti-slop/rules/no-object-parameters.d.ts +2 -0
- package/dist/anti-slop/rules/no-object-parameters.js +56 -0
- package/dist/anti-slop/rules/no-reduce-accumulator-copy.d.ts +2 -0
- package/dist/anti-slop/rules/no-reduce-accumulator-copy.js +99 -0
- package/dist/anti-slop/rules/no-reflect-apply.d.ts +2 -0
- package/dist/anti-slop/rules/no-reflect-apply.js +25 -0
- package/dist/anti-slop/rules/no-reflect-get.d.ts +2 -0
- package/dist/anti-slop/rules/no-reflect-get.js +25 -0
- package/dist/anti-slop/rules/no-runtime-typeof.d.ts +2 -0
- package/dist/anti-slop/rules/no-runtime-typeof.js +64 -0
- package/dist/anti-slop/rules/no-unknown-parameters.d.ts +2 -0
- package/dist/anti-slop/rules/no-unknown-parameters.js +51 -0
- package/dist/anti-slop/rules/no-unknown-returns.d.ts +2 -0
- package/dist/anti-slop/rules/no-unknown-returns.js +58 -0
- package/dist/anti-slop/rules/no-unknown-type-aliases.d.ts +2 -0
- package/dist/anti-slop/rules/no-unknown-type-aliases.js +40 -0
- package/dist/anti-slop/rules/no-unsafe-dictionary-type.d.ts +2 -0
- package/dist/anti-slop/rules/no-unsafe-dictionary-type.js +134 -0
- package/dist/anti-slop/rules/no-widen-then-assert.d.ts +2 -0
- package/dist/anti-slop/rules/no-widen-then-assert.js +270 -0
- package/dist/anti-slop/rules/require-pascal-case-namespace-imports.d.ts +8 -0
- package/dist/anti-slop/rules/require-pascal-case-namespace-imports.js +36 -0
- package/dist/anti-slop/rules/require-readable-spacing.d.ts +3 -0
- package/dist/anti-slop/rules/require-readable-spacing.js +65 -0
- package/dist/anti-slop/rules/require-safety-comment-for-type-assertion.d.ts +2 -0
- package/dist/anti-slop/rules/require-safety-comment-for-type-assertion.js +100 -0
- package/dist/anti-slop/shared/array-method.d.ts +12 -0
- package/dist/anti-slop/shared/array-method.js +84 -0
- package/dist/anti-slop/shared/dictionary-types.d.ts +20 -0
- package/dist/anti-slop/shared/dictionary-types.js +377 -0
- package/dist/anti-slop/shared/function-parameters.d.ts +8 -0
- package/dist/anti-slop/shared/function-parameters.js +40 -0
- package/dist/anti-slop/shared/lexical-type-parameters.d.ts +5 -0
- package/dist/anti-slop/shared/lexical-type-parameters.js +47 -0
- package/dist/anti-slop/shared/reflect-method.d.ts +3 -0
- package/dist/anti-slop/shared/reflect-method.js +20 -0
- package/dist/anti-slop/shared/scope.d.ts +3 -0
- package/dist/anti-slop/shared/scope.js +11 -0
- package/dist/anti-slop/shared/type-alias-resolution.d.ts +23 -0
- package/dist/anti-slop/shared/type-alias-resolution.js +162 -0
- package/dist/anti-slop/vendor/eslint-stylistic/LICENSE +22 -0
- package/dist/anti-slop/vendor/eslint-stylistic/padding-line-ast.d.ts +27 -0
- package/dist/anti-slop/vendor/eslint-stylistic/padding-line-ast.js +28 -0
- package/dist/anti-slop/vendor/eslint-stylistic/padding-line-between-statements.d.ts +37 -0
- package/dist/anti-slop/vendor/eslint-stylistic/padding-line-between-statements.js +703 -0
- package/dist/anti-slop/vendor/eslint-stylistic/padding-line-options.d.ts +87 -0
- package/dist/anti-slop-react/LICENSE +21 -0
- package/dist/anti-slop-react/index.d.ts +3 -0
- package/dist/anti-slop-react/index.js +14 -0
- package/dist/anti-slop-react/rules/no-hookless-use-function.d.ts +8 -0
- package/dist/anti-slop-react/rules/no-hookless-use-function.js +67 -0
- package/dist/anti-slop-react/rules/no-manual-memo.d.ts +7 -0
- package/dist/anti-slop-react/rules/no-manual-memo.js +58 -0
- package/dist/anti-slop-react/rules/require-sync-comment-for-effect.d.ts +8 -0
- package/dist/anti-slop-react/rules/require-sync-comment-for-effect.js +64 -0
- package/dist/oxfmt.d.ts +27 -0
- package/dist/oxfmt.js +19 -0
- package/dist/oxlint-react.d.ts +62 -0
- package/dist/oxlint-react.js +62 -0
- package/dist/oxlint.d.ts +44 -0
- package/dist/oxlint.js +44 -0
- package/package.json +63 -4
- package/reset.d.ts +4 -0
- package/tsconfig.base.json +148 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import { lexicalTypeParameterNames } from "./lexical-type-parameters.js";
|
|
2
|
+
const environmentsByProgram = new WeakMap();
|
|
3
|
+
function isNode(value) {
|
|
4
|
+
return (typeof value === "object" &&
|
|
5
|
+
value !== null &&
|
|
6
|
+
"type" in value &&
|
|
7
|
+
typeof value.type === "string");
|
|
8
|
+
}
|
|
9
|
+
function enclosingTypeScope(node) {
|
|
10
|
+
let current = node.parent;
|
|
11
|
+
while (current !== null) {
|
|
12
|
+
if (current.type === "Program" ||
|
|
13
|
+
current.type === "BlockStatement" ||
|
|
14
|
+
current.type === "TSModuleBlock" ||
|
|
15
|
+
current.type === "StaticBlock" ||
|
|
16
|
+
current.type === "SwitchStatement") {
|
|
17
|
+
return current;
|
|
18
|
+
}
|
|
19
|
+
current = current.parent;
|
|
20
|
+
}
|
|
21
|
+
return node;
|
|
22
|
+
}
|
|
23
|
+
function declaredTypeBinding(node) {
|
|
24
|
+
if (node.type === "TSTypeAliasDeclaration") {
|
|
25
|
+
return { alias: node, name: node.id.name };
|
|
26
|
+
}
|
|
27
|
+
if (node.type === "TSInterfaceDeclaration" ||
|
|
28
|
+
node.type === "TSEnumDeclaration" ||
|
|
29
|
+
node.type === "ClassDeclaration" ||
|
|
30
|
+
node.type === "ClassExpression") {
|
|
31
|
+
return node.id === null ? null : { alias: null, name: node.id.name };
|
|
32
|
+
}
|
|
33
|
+
if (node.type === "ImportSpecifier" ||
|
|
34
|
+
node.type === "ImportDefaultSpecifier" ||
|
|
35
|
+
node.type === "ImportNamespaceSpecifier") {
|
|
36
|
+
return { alias: null, name: node.local.name };
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
function collectTypeBindings(node, visitorKeys, bindingsByName, aliases) {
|
|
41
|
+
const declared = declaredTypeBinding(node);
|
|
42
|
+
if (declared !== null) {
|
|
43
|
+
const bindings = bindingsByName.get(declared.name) ?? [];
|
|
44
|
+
bindings.push({ ...declared, scope: enclosingTypeScope(node) });
|
|
45
|
+
bindingsByName.set(declared.name, bindings);
|
|
46
|
+
if (declared.alias !== null)
|
|
47
|
+
aliases.push(declared.alias);
|
|
48
|
+
}
|
|
49
|
+
// SAFETY: Oxlint's visitor keys identify only ESTree child-node properties.
|
|
50
|
+
const fields = node;
|
|
51
|
+
for (const key of visitorKeys[node.type] ?? []) {
|
|
52
|
+
const value = fields[key];
|
|
53
|
+
if (isNode(value)) {
|
|
54
|
+
collectTypeBindings(value, visitorKeys, bindingsByName, aliases);
|
|
55
|
+
continue;
|
|
56
|
+
}
|
|
57
|
+
if (!Array.isArray(value))
|
|
58
|
+
continue;
|
|
59
|
+
for (const child of value) {
|
|
60
|
+
if (isNode(child)) {
|
|
61
|
+
collectTypeBindings(child, visitorKeys, bindingsByName, aliases);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
/** Collect every lexical type alias and competing type binding in a program. */
|
|
67
|
+
export function createTypeAliasEnvironment(program, visitorKeys) {
|
|
68
|
+
const cached = environmentsByProgram.get(program);
|
|
69
|
+
if (cached !== undefined)
|
|
70
|
+
return cached;
|
|
71
|
+
const bindingsByName = new Map();
|
|
72
|
+
const aliases = [];
|
|
73
|
+
collectTypeBindings(program, visitorKeys, bindingsByName, aliases);
|
|
74
|
+
const environment = { aliases, bindingsByName, visitorKeys };
|
|
75
|
+
environmentsByProgram.set(program, environment);
|
|
76
|
+
return environment;
|
|
77
|
+
}
|
|
78
|
+
function ancestorDistance(ancestor, node) {
|
|
79
|
+
let current = node;
|
|
80
|
+
let distance = 0;
|
|
81
|
+
while (current !== null) {
|
|
82
|
+
if (current === ancestor)
|
|
83
|
+
return distance;
|
|
84
|
+
current = current.parent;
|
|
85
|
+
distance += 1;
|
|
86
|
+
}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
function nearestTypeBindings(name, use, environment) {
|
|
90
|
+
const candidates = environment.bindingsByName.get(name) ?? [];
|
|
91
|
+
let nearestDistance = Number.POSITIVE_INFINITY;
|
|
92
|
+
let nearest = [];
|
|
93
|
+
for (const candidate of candidates) {
|
|
94
|
+
const distance = ancestorDistance(candidate.scope, use);
|
|
95
|
+
if (distance === null || distance > nearestDistance)
|
|
96
|
+
continue;
|
|
97
|
+
if (distance === nearestDistance) {
|
|
98
|
+
nearest.push(candidate);
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
nearestDistance = distance;
|
|
102
|
+
nearest = [candidate];
|
|
103
|
+
}
|
|
104
|
+
return nearest;
|
|
105
|
+
}
|
|
106
|
+
/** Resolve the nearest visible alias with this name, respecting lexical shadowing. */
|
|
107
|
+
export function visibleTypeAlias(name, use, environment) {
|
|
108
|
+
if (lexicalTypeParameterNames(use, environment.visitorKeys).has(name))
|
|
109
|
+
return null;
|
|
110
|
+
const bindings = nearestTypeBindings(name, use, environment);
|
|
111
|
+
return bindings.length === 1 ? (bindings[0]?.alias ?? null) : null;
|
|
112
|
+
}
|
|
113
|
+
/** Return whether a local declaration shadows a built-in type at this use. */
|
|
114
|
+
export function hasVisibleTypeBinding(name, use, environment) {
|
|
115
|
+
return (lexicalTypeParameterNames(use, environment.visitorKeys).has(name) ||
|
|
116
|
+
nearestTypeBindings(name, use, environment).length > 0);
|
|
117
|
+
}
|
|
118
|
+
function typeReferenceName(type) {
|
|
119
|
+
return type.typeName.type === "Identifier" ? type.typeName.name : null;
|
|
120
|
+
}
|
|
121
|
+
function aliasSubstitutions(alias, reference, base) {
|
|
122
|
+
const parameters = alias.typeParameters?.params ?? [];
|
|
123
|
+
const arguments_ = reference.typeArguments?.params ?? [];
|
|
124
|
+
const next = new Map(base);
|
|
125
|
+
for (const [index, parameter] of parameters.entries()) {
|
|
126
|
+
const explicitArgument = arguments_[index];
|
|
127
|
+
const argument = explicitArgument ?? parameter.default;
|
|
128
|
+
if (argument === null || argument === undefined)
|
|
129
|
+
return null;
|
|
130
|
+
const argumentSubstitutions = explicitArgument === undefined ? next : base;
|
|
131
|
+
next.set(parameter.name.name, {
|
|
132
|
+
type: argument,
|
|
133
|
+
substitutions: new Map(argumentSubstitutions),
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return next;
|
|
137
|
+
}
|
|
138
|
+
/** Match a type after resolving visible aliases and substituting their type parameters. */
|
|
139
|
+
export function resolvedTypeMatches(type, environment, matcher) {
|
|
140
|
+
const evaluate = (current, substitutions, resolvingAliases) => {
|
|
141
|
+
if (current.type === "TSTypeReference") {
|
|
142
|
+
const name = typeReferenceName(current);
|
|
143
|
+
if (name !== null) {
|
|
144
|
+
const substitution = substitutions.get(name);
|
|
145
|
+
if (substitution !== undefined && !current.typeArguments?.params.length) {
|
|
146
|
+
return evaluate(substitution.type, substitution.substitutions, resolvingAliases);
|
|
147
|
+
}
|
|
148
|
+
const alias = visibleTypeAlias(name, current, environment);
|
|
149
|
+
if (alias !== null && !resolvingAliases.has(alias)) {
|
|
150
|
+
const nextSubstitutions = aliasSubstitutions(alias, current, substitutions);
|
|
151
|
+
if (nextSubstitutions !== null) {
|
|
152
|
+
const nextResolving = new Set(resolvingAliases);
|
|
153
|
+
nextResolving.add(alias);
|
|
154
|
+
return evaluate(alias.typeAnnotation, nextSubstitutions, nextResolving);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return matcher(current, (child) => evaluate(child, substitutions, resolvingAliases));
|
|
160
|
+
};
|
|
161
|
+
return evaluate(type, new Map(), new Set());
|
|
162
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>
|
|
4
|
+
Copyright (c) 2023-PRESENT ESLint Stylistic contributors
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { ESTree, SourceCode, Token as SyntaxToken, Comment, Location } from "@oxlint/plugins";
|
|
2
|
+
type Token = SyntaxToken | Comment;
|
|
3
|
+
/** Line terminators recognized by the upstream padding matcher. */
|
|
4
|
+
export declare const LINEBREAKS: Set<string>;
|
|
5
|
+
/** Test a closing brace without treating comment text as punctuation. */
|
|
6
|
+
export declare const isClosingBraceToken: (token: Token) => boolean;
|
|
7
|
+
/** Test a semicolon without treating comment text as punctuation. */
|
|
8
|
+
export declare const isSemicolonToken: (token: Token) => boolean;
|
|
9
|
+
/** Filter the optional final semicolon when identifying block-like statements. */
|
|
10
|
+
export declare const isNotSemicolonToken: (token: Token) => boolean;
|
|
11
|
+
/** Compare token/node boundaries, including attached comments. */
|
|
12
|
+
export declare const isTokenOnSameLine: (left: {
|
|
13
|
+
loc: Location;
|
|
14
|
+
}, right: {
|
|
15
|
+
loc: Location;
|
|
16
|
+
}) => boolean;
|
|
17
|
+
/** Recognize declarations and expressions used by the upstream IIFE matcher. */
|
|
18
|
+
export declare const isFunction: (node: ESTree.Node) => boolean;
|
|
19
|
+
/** Preserve the upstream multiline statement heuristic. */
|
|
20
|
+
export declare const isSingleLine: (node: ESTree.Node) => boolean;
|
|
21
|
+
/** Unwrap optional chaining before checking IIFE syntax. */
|
|
22
|
+
export declare const skipChainExpression: (node: ESTree.Node) => ESTree.Node;
|
|
23
|
+
/** Only a program or function-body expression can begin a directive prologue. */
|
|
24
|
+
export declare const isTopLevelExpressionStatement: (node: ESTree.Node) => node is ESTree.ExpressionStatement;
|
|
25
|
+
/** A single wrapping pair suffices to exclude a string from directive syntax. */
|
|
26
|
+
export declare function isParenthesized(node: ESTree.Node, sourceCode: SourceCode): boolean;
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Line terminators recognized by the upstream padding matcher. */
|
|
2
|
+
export const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]);
|
|
3
|
+
/** Test a closing brace without treating comment text as punctuation. */
|
|
4
|
+
export const isClosingBraceToken = (token) => token.type === "Punctuator" && token.value === "}";
|
|
5
|
+
/** Test a semicolon without treating comment text as punctuation. */
|
|
6
|
+
export const isSemicolonToken = (token) => token.type === "Punctuator" && token.value === ";";
|
|
7
|
+
/** Filter the optional final semicolon when identifying block-like statements. */
|
|
8
|
+
export const isNotSemicolonToken = (token) => !isSemicolonToken(token);
|
|
9
|
+
/** Compare token/node boundaries, including attached comments. */
|
|
10
|
+
export const isTokenOnSameLine = (left, right) => left.loc.end.line === right.loc.start.line;
|
|
11
|
+
/** Recognize declarations and expressions used by the upstream IIFE matcher. */
|
|
12
|
+
export const isFunction = (node) => node.type === "FunctionDeclaration" ||
|
|
13
|
+
node.type === "FunctionExpression" ||
|
|
14
|
+
node.type === "ArrowFunctionExpression";
|
|
15
|
+
/** Preserve the upstream multiline statement heuristic. */
|
|
16
|
+
export const isSingleLine = (node) => node.loc.start.line === node.loc.end.line;
|
|
17
|
+
/** Unwrap optional chaining before checking IIFE syntax. */
|
|
18
|
+
export const skipChainExpression = (node) => node.type === "ChainExpression" ? node.expression : node;
|
|
19
|
+
/** Only a program or function-body expression can begin a directive prologue. */
|
|
20
|
+
export const isTopLevelExpressionStatement = (node) => node.type === "ExpressionStatement" &&
|
|
21
|
+
(node.parent.type === "Program" ||
|
|
22
|
+
(node.parent.type === "BlockStatement" && isFunction(node.parent.parent)));
|
|
23
|
+
/** A single wrapping pair suffices to exclude a string from directive syntax. */
|
|
24
|
+
export function isParenthesized(node, sourceCode) {
|
|
25
|
+
const before = sourceCode.getTokenBefore(node);
|
|
26
|
+
const after = sourceCode.getTokenAfter(node);
|
|
27
|
+
return before?.value === "(" && after?.value === ")";
|
|
28
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ESTree, SourceCode, CreateRule } from '@oxlint/plugins';
|
|
2
|
+
type ASTNode = ESTree.Node;
|
|
3
|
+
import type { PaddingType, StatementMatcher } from './padding-line-options.d.ts';
|
|
4
|
+
/**
|
|
5
|
+
* This rule is a replica of padding-line-between-statements.
|
|
6
|
+
*
|
|
7
|
+
* Ideally we would want to extend the rule support typescript specific support.
|
|
8
|
+
* But since not all the state is exposed by the eslint and eslint has frozen stylistic rules,
|
|
9
|
+
* (see - https://eslint.org/blog/2020/05/changes-to-rules-policies for details.)
|
|
10
|
+
* we are forced to re-implement the rule here.
|
|
11
|
+
*
|
|
12
|
+
* We have tried to keep the implementation as close as possible to the eslint implementation, to make
|
|
13
|
+
* patching easier for future contributors.
|
|
14
|
+
*
|
|
15
|
+
* Reference rule - https://github.com/eslint/eslint/blob/main/lib/rules/padding-line-between-statements.js
|
|
16
|
+
*/
|
|
17
|
+
type NodeTest = (node: ASTNode, sourceCode: SourceCode) => boolean;
|
|
18
|
+
export interface NodeTestObject {
|
|
19
|
+
test: NodeTest;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* A policy entry may name a caller-defined statement type (registered through
|
|
23
|
+
* `createPaddingLineRule`) anywhere the upstream statement types are accepted.
|
|
24
|
+
*/
|
|
25
|
+
export type PolicyStatementOption<Extra extends string = never> = StatementMatcher | Extra | [StatementMatcher | Extra, ...(StatementMatcher | Extra)[]];
|
|
26
|
+
export type PolicyOptions<Extra extends string = never> = {
|
|
27
|
+
blankLine: PaddingType;
|
|
28
|
+
prev: PolicyStatementOption<Extra>;
|
|
29
|
+
next: PolicyStatementOption<Extra>;
|
|
30
|
+
}[];
|
|
31
|
+
/**
|
|
32
|
+
* Build the vendored padding rule with caller-owned, typed policy options.
|
|
33
|
+
* `statementTypes` registers caller-defined statement types, looked up before
|
|
34
|
+
* the upstream table, for syntax the upstream matchers do not distinguish.
|
|
35
|
+
*/
|
|
36
|
+
export default function createPaddingLineRule<Extra extends string = never>(options: PolicyOptions<NoInfer<Extra>>, statementTypes?: Record<Extra, NodeTestObject>): CreateRule;
|
|
37
|
+
export {};
|