oxlint-plugin-arch 0.11.0 → 0.12.1
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/CHANGELOG.md +241 -0
- package/README.md +52 -218
- package/dist/index.js +5205 -4073
- package/dist/preset/groups/backend.d.ts +2 -0
- package/dist/preset/groups/basics.d.ts +2 -0
- package/dist/preset/groups/comments.d.ts +2 -0
- package/dist/preset/groups/console.d.ts +2 -0
- package/dist/preset/groups/deny.d.ts +2 -0
- package/dist/preset/groups/expo.d.ts +2 -0
- package/dist/preset/groups/externals.d.ts +2 -0
- package/dist/preset/groups/forms.d.ts +2 -0
- package/dist/preset/groups/imports.d.ts +2 -0
- package/dist/preset/groups/layout.d.ts +2 -0
- package/dist/preset/groups/limits.d.ts +2 -0
- package/dist/preset/groups/naming.d.ts +2 -0
- package/dist/preset/groups/next.d.ts +2 -0
- package/dist/preset/groups/orpc.d.ts +2 -0
- package/dist/preset/groups/react.d.ts +2 -0
- package/dist/preset/groups/schemas.d.ts +2 -0
- package/dist/preset/groups/shadcn.d.ts +2 -0
- package/dist/preset/groups/sql.d.ts +2 -0
- package/dist/preset/groups/style.d.ts +2 -0
- package/dist/preset/groups/tailwind.d.ts +2 -0
- package/dist/preset/groups/tanstack.d.ts +2 -0
- package/dist/preset/groups/tests.d.ts +2 -0
- package/dist/preset/groups/types.d.ts +2 -0
- package/dist/preset/preset-detect.d.ts +3 -0
- package/dist/preset/preset-folders.d.ts +2 -0
- package/dist/preset/preset-recipes.d.ts +82 -0
- package/dist/preset/preset-stylesheet.d.ts +1 -0
- package/dist/preset/preset-units.d.ts +2 -0
- package/dist/preset/preset.constants.d.ts +79 -0
- package/dist/preset/preset.d.ts +89 -0
- package/dist/preset/preset.js +2299 -0
- package/dist/preset/preset.utils.d.ts +14 -0
- package/dist/rules/backend/backend-orpc-output.d.ts +1 -0
- package/dist/rules/backend/backend-registry.d.ts +1 -0
- package/dist/rules/backend/backend-service-functions.d.ts +1 -0
- package/dist/rules/backend/backend-sql-like.d.ts +1 -0
- package/dist/rules/boundaries/boundaries-deny.d.ts +1 -0
- package/dist/rules/boundaries/boundaries-imports.d.ts +1 -0
- package/dist/rules/boundaries/boundaries-next.d.ts +1 -0
- package/dist/rules/boundaries/boundaries-rpc-database.d.ts +1 -0
- package/dist/rules/boundaries/boundaries-tanstack.d.ts +1 -0
- package/dist/rules/boundaries/boundaries-token-owner.d.ts +1 -0
- package/dist/rules/code/code-constructor.d.ts +1 -0
- package/dist/rules/code/code-double-negation.d.ts +1 -0
- package/dist/rules/code/code-literal-in.d.ts +1 -0
- package/dist/rules/code/code-mutable-state.d.ts +1 -0
- package/dist/rules/code/code-object-params.d.ts +1 -0
- package/dist/rules/code/code-paired-call.d.ts +1 -0
- package/dist/rules/code/code-promise-mutation.d.ts +1 -0
- package/dist/rules/code/code-switch.d.ts +1 -0
- package/dist/rules/code/code-trivial-functions.d.ts +1 -0
- package/dist/rules/comments/comments-code.d.ts +1 -0
- package/dist/rules/comments/comments-directives.d.ts +1 -0
- package/dist/rules/copy/copy-dashes.d.ts +1 -0
- package/dist/rules/files/files-components-only.d.ts +1 -0
- package/dist/rules/files/files-constants-only.d.ts +1 -0
- package/dist/rules/files/files-domain-constants.d.ts +1 -0
- package/dist/rules/files/files-exports.d.ts +1 -0
- package/dist/rules/files/files-externals.d.ts +1 -0
- package/dist/rules/files/files-factory-keys.d.ts +1 -0
- package/dist/rules/files/files-helpers.d.ts +1 -0
- package/dist/rules/files/files-no-functions.d.ts +1 -0
- package/dist/rules/files/files-restricted.d.ts +1 -0
- package/dist/rules/files/files-route.d.ts +1 -0
- package/dist/rules/files/files-types-only.d.ts +1 -0
- package/dist/rules/layout/layout-call-arguments.d.ts +1 -0
- package/dist/rules/layout/layout-call-array.d.ts +1 -0
- package/dist/rules/layout/layout-chain.d.ts +1 -0
- package/dist/rules/layout/layout-jsx-attributes.d.ts +1 -0
- package/dist/rules/layout/layout-key-value.d.ts +1 -0
- package/dist/rules/layout/layout-object.d.ts +1 -0
- package/dist/rules/layout/layout-padding.d.ts +1 -0
- package/dist/rules/layout/layout-ternary.d.ts +1 -0
- package/dist/rules/naming/naming-declarations.d.ts +1 -0
- package/dist/rules/naming/naming-exports.d.ts +1 -0
- package/dist/rules/naming/naming-file.d.ts +1 -0
- package/dist/rules/naming/naming-folder.d.ts +1 -0
- package/dist/rules/naming/naming-types.d.ts +1 -0
- package/dist/rules/react/react-dynamic-classes.d.ts +1 -0
- package/dist/rules/react/react-empty-effect.d.ts +1 -0
- package/dist/rules/react/react-memo.d.ts +1 -0
- package/dist/rules/react/react-props.d.ts +1 -0
- package/dist/rules/schemas/schemas-inline.d.ts +1 -0
- package/dist/rules/schemas/schemas-local.d.ts +1 -0
- package/dist/rules/schemas/schemas-rederive.d.ts +1 -0
- package/dist/rules/schemas/schemas-single-use.d.ts +1 -0
- package/dist/rules/tests/tests-assertions.d.ts +1 -0
- package/dist/rules/tests/tests-concurrent-db.d.ts +1 -0
- package/dist/rules/tests/tests-modifiers.d.ts +1 -0
- package/dist/rules/tests/tests-titles.d.ts +1 -0
- package/dist/rules/types/types-declarations.d.ts +1 -0
- package/dist/rules/types/types-imported-alias.d.ts +1 -0
- package/dist/rules/types/types-inline.d.ts +1 -0
- package/dist/rules/types/types-local-alias.d.ts +1 -0
- package/dist/rules/types/types-namespace-import.d.ts +1 -0
- package/dist/rules/types/types-service.d.ts +1 -0
- package/dist/rules/types/types-unknown.d.ts +1 -0
- package/dist/types/ast.types.d.ts +2 -0
- package/dist/types/backend.types.d.ts +24 -0
- package/dist/types/boundaries.types.d.ts +72 -0
- package/dist/types/code.types.d.ts +59 -0
- package/dist/types/comments.types.d.ts +12 -0
- package/dist/types/copy.types.d.ts +4 -0
- package/dist/types/declarations.types.d.ts +20 -0
- package/dist/types/dillon-anti-slop.types.d.ts +55 -0
- package/dist/types/exports.types.d.ts +11 -0
- package/dist/types/files.types.d.ts +85 -0
- package/dist/types/layout.types.d.ts +55 -0
- package/dist/types/naming.types.d.ts +52 -0
- package/dist/types/options.types.d.ts +4 -0
- package/dist/types/preset.types.d.ts +248 -129
- package/dist/types/react.types.d.ts +14 -0
- package/dist/types/schemas.types.d.ts +20 -0
- package/dist/types/source.types.d.ts +1 -0
- package/dist/types/tests.types.d.ts +39 -0
- package/dist/types/types.types.d.ts +20 -0
- package/dist/utils/ast.utils.d.ts +19 -0
- package/dist/utils/boundaries.utils.d.ts +85 -0
- package/dist/utils/declarations.utils.d.ts +21 -0
- package/dist/utils/exports.utils.d.ts +6 -0
- package/dist/utils/naming.utils.d.ts +11 -0
- package/dist/utils/options.utils.d.ts +11 -0
- package/dist/utils/react.utils.d.ts +3 -0
- package/dist/utils/schemas.utils.d.ts +36 -0
- package/dist/utils/source.utils.d.ts +18 -0
- package/dist/vendor/dillon-anti-slop/index.js +1770 -0
- package/dist/vendor/dillon-anti-slop/rules/no-known-value-widening.d.ts +2 -0
- package/dist/vendor/dillon-anti-slop/rules/no-module-mocking.d.ts +2 -0
- package/dist/vendor/dillon-anti-slop/shared/dictionary-types.d.ts +5 -0
- package/dist/vendor/dillon-anti-slop/shared/expressions.d.ts +5 -0
- package/dist/vendor/dillon-anti-slop/shared/lexical-type-parameters.d.ts +2 -0
- package/dist/vendor/dillon-anti-slop/shared/reflect-method.d.ts +1 -0
- package/dist/vendor/dillon-anti-slop/shared/resolve-variable.d.ts +2 -0
- package/dist/vendor/dillon-anti-slop/shared/signatures.d.ts +15 -0
- package/dist/vendor/dillon-anti-slop/shared/type-aliases.d.ts +4 -0
- package/dist/vendor/dillon-anti-slop/shared/type-environment.d.ts +9 -0
- package/dist/vendor/dillon-anti-slop/shared/type-reference-name.d.ts +2 -0
- package/dist/vendor/dillon-anti-slop/shared/widening-targets.d.ts +3 -0
- package/package.json +51 -43
- package/src/{rules → vendor}/dillon-anti-slop/UPSTREAM.md +9 -6
- package/dist/configs/boundaries.d.ts +0 -2
- package/dist/configs/modules.d.ts +0 -2
- package/dist/configs/plugins.d.ts +0 -3
- package/dist/configs/react.d.ts +0 -2
- package/dist/configs/source.d.ts +0 -2
- package/dist/configs/tests.d.ts +0 -2
- package/dist/configs/types.d.ts +0 -2
- package/dist/constants/preset.constants.d.ts +0 -38
- package/dist/constants/test.constants.d.ts +0 -1
- package/dist/presets/index.d.ts +0 -4
- package/dist/presets/index.js +0 -1736
- package/dist/presets/next-react-modules-preset.d.ts +0 -4
- package/dist/presets/next-react-modules-preset.js +0 -1729
- package/dist/presets/react-modules-preset.d.ts +0 -4
- package/dist/presets/react-modules-preset.js +0 -1724
- package/dist/presets/tanstack-start-react-modules-preset.d.ts +0 -4
- package/dist/presets/tanstack-start-react-modules-preset.js +0 -1729
- package/dist/rules/dillon-anti-slop/index.js +0 -2719
- package/dist/rules/dillon-anti-slop/rules/no-known-value-widening.d.ts +0 -1
- package/dist/rules/dillon-anti-slop/rules/no-module-mocking.d.ts +0 -8
- package/dist/rules/dillon-anti-slop/shared/dictionary-types.d.ts +0 -19
- package/dist/rules/dillon-anti-slop/shared/lexical-type-parameters.d.ts +0 -4
- package/dist/rules/dillon-anti-slop/shared/reflect-method.d.ts +0 -2
- package/dist/rules/module-policy/domain-constants.d.ts +0 -2
- package/dist/rules/module-policy/import-boundaries.d.ts +0 -2
- package/dist/rules/module-policy/index.js +0 -2266
- package/dist/rules/module-policy/memoization.d.ts +0 -2
- package/dist/rules/module-policy/next-runtime.d.ts +0 -7
- package/dist/rules/module-policy/no-unknown.d.ts +0 -6
- package/dist/rules/module-policy/reasoned-directives.d.ts +0 -2
- package/dist/rules/module-policy/service-functions.d.ts +0 -2
- package/dist/rules/module-policy/service-types.d.ts +0 -2
- package/dist/rules/module-policy/tanstack-runtime.d.ts +0 -2
- package/dist/rules/module-policy/test-assertions.d.ts +0 -2
- package/dist/rules/module-policy/test-modifiers.d.ts +0 -2
- package/dist/services/preset-compose.d.ts +0 -3
- package/dist/services/preset-context.d.ts +0 -2
- package/dist/types/module-policy.types.d.ts +0 -39
- package/dist/types/test-analysis.types.d.ts +0 -11
- package/dist/utils/helpers/ast.d.ts +0 -12
- package/dist/utils/helpers/boundaries.d.ts +0 -3
- package/dist/utils/helpers/comments.d.ts +0 -6
- package/dist/utils/helpers/declarations.d.ts +0 -35
- package/dist/utils/helpers/exports.d.ts +0 -18
- package/dist/utils/helpers/factories.d.ts +0 -9
- package/dist/utils/helpers/guards.d.ts +0 -11
- package/dist/utils/helpers/index.d.ts +0 -18
- package/dist/utils/helpers/layout.d.ts +0 -15
- package/dist/utils/helpers/mocking.d.ts +0 -2
- package/dist/utils/helpers/naming.d.ts +0 -13
- package/dist/utils/helpers/options.d.ts +0 -22
- package/dist/utils/helpers/orpc.d.ts +0 -3
- package/dist/utils/helpers/preset.d.ts +0 -9
- package/dist/utils/helpers/react-components.d.ts +0 -13
- package/dist/utils/helpers/routes.d.ts +0 -5
- package/dist/utils/helpers/runtime.d.ts +0 -14
- package/dist/utils/helpers/sanitizers.d.ts +0 -3
- package/dist/utils/helpers/schemas.d.ts +0 -10
- package/dist/utils/helpers/syntax.d.ts +0 -1
- package/dist/utils/helpers/test-tables.d.ts +0 -8
- package/dist/utils/helpers/trivial.d.ts +0 -6
- package/dist/utils/index.d.ts +0 -1
- /package/dist/{rules/module-policy/index.d.ts → index.d.ts} +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/index.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-chained-type-assertions.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-conditional-empty-object-spread.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-object-parameters.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-reflect-apply.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-reflect-get.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-runtime-typeof.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-shape-in-symbol-names.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-unknown-parameters.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-unknown-returns.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-unknown-type-aliases.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-unsafe-dictionary-type.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/no-widen-then-assert.d.ts +0 -0
- /package/dist/{rules → vendor}/dillon-anti-slop/rules/require-safety-comment-for-type-assertion.d.ts +0 -0
- /package/src/{rules → vendor}/dillon-anti-slop/LICENSE +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { OptionsPattern } from './options.types.ts';
|
|
2
|
+
import type { SourceIndent } from './source.types.ts';
|
|
3
|
+
import type { ESTree } from '@oxlint/plugins';
|
|
4
|
+
export interface LayoutEdit {
|
|
5
|
+
range: [number, number];
|
|
6
|
+
text: string;
|
|
7
|
+
}
|
|
8
|
+
export interface LayoutCallArgumentsOptions {
|
|
9
|
+
min?: number;
|
|
10
|
+
indent?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface LayoutCallArrayOptions {
|
|
13
|
+
callees?: string[];
|
|
14
|
+
min?: number;
|
|
15
|
+
indent?: SourceIndent;
|
|
16
|
+
}
|
|
17
|
+
export interface LayoutChainGroup {
|
|
18
|
+
min: number;
|
|
19
|
+
methods?: string[];
|
|
20
|
+
only?: string[];
|
|
21
|
+
root?: OptionsPattern;
|
|
22
|
+
}
|
|
23
|
+
export interface LayoutChainOptions {
|
|
24
|
+
groups: LayoutChainGroup[];
|
|
25
|
+
indent?: SourceIndent;
|
|
26
|
+
}
|
|
27
|
+
export interface LayoutChainCompiledGroup {
|
|
28
|
+
min: number;
|
|
29
|
+
methods?: Set<string>;
|
|
30
|
+
only?: Set<string>;
|
|
31
|
+
rootPatterns: RegExp[];
|
|
32
|
+
}
|
|
33
|
+
export interface LayoutChainLink {
|
|
34
|
+
member: ESTree.MemberExpression;
|
|
35
|
+
methodName: string | undefined;
|
|
36
|
+
}
|
|
37
|
+
export interface LayoutJsxAttributesOptions {
|
|
38
|
+
min?: number;
|
|
39
|
+
indent?: SourceIndent;
|
|
40
|
+
}
|
|
41
|
+
export interface LayoutObjectOptions {
|
|
42
|
+
min?: number;
|
|
43
|
+
scope?: LayoutObjectScope;
|
|
44
|
+
indent?: SourceIndent;
|
|
45
|
+
}
|
|
46
|
+
export type LayoutObjectScope = 'call-args' | 'all';
|
|
47
|
+
export interface LayoutPaddingOptions {
|
|
48
|
+
min?: number;
|
|
49
|
+
multiline?: boolean;
|
|
50
|
+
}
|
|
51
|
+
export type LayoutPaddingKind = 'variable' | 'block' | 'control' | 'return' | 'other';
|
|
52
|
+
export interface LayoutTernaryOptions {
|
|
53
|
+
max?: number;
|
|
54
|
+
indent?: number;
|
|
55
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { DeclarationsKind } from './declarations.types.ts';
|
|
2
|
+
import type { OptionsPattern } from './options.types.ts';
|
|
3
|
+
export type NamingStemMode = 'before-first-dot' | 'full-basename';
|
|
4
|
+
export interface NamingExportsStem {
|
|
5
|
+
stem?: NamingStemMode;
|
|
6
|
+
roles?: string[];
|
|
7
|
+
separators?: string[];
|
|
8
|
+
normalize?: 'remove-separators' | 'none';
|
|
9
|
+
singularize?: 'none' | 'trailing-s';
|
|
10
|
+
}
|
|
11
|
+
export interface NamingDeclarationsOptions extends NamingExportsStem {
|
|
12
|
+
kinds?: DeclarationsKind[];
|
|
13
|
+
pattern?: OptionsPattern;
|
|
14
|
+
flags?: string;
|
|
15
|
+
allow?: OptionsPattern;
|
|
16
|
+
}
|
|
17
|
+
interface NamingExportsBase {
|
|
18
|
+
scope?: 'exports' | 'functions' | 'declarations';
|
|
19
|
+
types?: boolean;
|
|
20
|
+
services?: boolean;
|
|
21
|
+
allow?: OptionsPattern;
|
|
22
|
+
}
|
|
23
|
+
export interface NamingExportsPrefixOptions extends NamingExportsBase, NamingExportsStem {
|
|
24
|
+
mode?: 'prefix';
|
|
25
|
+
}
|
|
26
|
+
export interface NamingExportsPatternOptions extends NamingExportsBase {
|
|
27
|
+
mode: 'pattern';
|
|
28
|
+
pattern: OptionsPattern;
|
|
29
|
+
flags?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface NamingExportsTemplateOptions extends NamingExportsBase {
|
|
32
|
+
mode: 'template';
|
|
33
|
+
file: string;
|
|
34
|
+
export: string;
|
|
35
|
+
match?: 'all' | 'some';
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
camelCase?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export type NamingExportsOptions = NamingExportsPrefixOptions | NamingExportsPatternOptions | NamingExportsTemplateOptions;
|
|
40
|
+
export interface NamingFileOptions {
|
|
41
|
+
pattern: OptionsPattern;
|
|
42
|
+
message: string;
|
|
43
|
+
flags?: string;
|
|
44
|
+
unique?: string;
|
|
45
|
+
}
|
|
46
|
+
export interface NamingFolderOptions {
|
|
47
|
+
singularize?: 'none' | 'trailing-s';
|
|
48
|
+
separators?: string[];
|
|
49
|
+
prefixes?: string[];
|
|
50
|
+
after?: string;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
@@ -1,181 +1,293 @@
|
|
|
1
1
|
import type { OxlintConfig, OxlintOverride } from 'oxlint';
|
|
2
|
-
export type
|
|
3
|
-
export type
|
|
4
|
-
export type
|
|
5
|
-
export type
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
export type PresetArchitecture = Record<string, PresetRole | PresetArchitectureEntry>;
|
|
16
|
-
export interface PresetResolvedRoot {
|
|
17
|
-
role: PresetRole;
|
|
18
|
-
layout: Record<string, PresetFolderLayout>;
|
|
19
|
-
framework?: PresetFramework;
|
|
20
|
-
sourceDir?: string;
|
|
2
|
+
export type PresetLevel = 'error' | 'warn';
|
|
3
|
+
export type PresetSwitch = boolean | 'warn';
|
|
4
|
+
export type PresetLayoutMode = 'flat' | 'domain';
|
|
5
|
+
export type PresetOperations = 'flat' | 'folders';
|
|
6
|
+
export interface PresetLayoutOptions {
|
|
7
|
+
services?: PresetLayoutMode | false;
|
|
8
|
+
hooks?: PresetLayoutMode | false;
|
|
9
|
+
components?: PresetLayoutMode | false;
|
|
10
|
+
suffixes?: string[];
|
|
11
|
+
strict?: boolean;
|
|
12
|
+
operations?: PresetOperations;
|
|
13
|
+
service?: string[];
|
|
21
14
|
}
|
|
22
|
-
export interface
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
export interface PresetLimitsOptions {
|
|
16
|
+
lines?: number;
|
|
17
|
+
types?: number;
|
|
18
|
+
complexity?: number;
|
|
26
19
|
}
|
|
27
|
-
export interface
|
|
28
|
-
root?: string;
|
|
29
|
-
/** Default framework for web roots that do not set their own; `tanstack-start` when omitted. */
|
|
30
|
-
framework?: PresetFramework;
|
|
31
|
-
architecture?: PresetArchitecture;
|
|
32
|
-
severity?: 'error' | 'warn';
|
|
33
|
-
/** Per-rule levels applied after `severity`, for rules the preset enables. */
|
|
34
|
-
ruleSeverities?: Record<string, 'error' | 'warn' | 'off'>;
|
|
35
|
-
formatting?: PresetFormattingOptions;
|
|
36
|
-
limits?: PresetLimitsOptions;
|
|
37
|
-
modules?: PresetModulesOptions;
|
|
38
|
-
imports?: PresetImportsOptions;
|
|
39
|
-
orpc?: PresetOrpcOptions;
|
|
40
|
-
sql?: PresetSqlOptions;
|
|
41
|
-
forms?: PresetFormsOptions;
|
|
42
|
-
react?: PresetReactOptions;
|
|
43
|
-
tests?: PresetTestsOptions;
|
|
44
|
-
policies?: PresetPolicyOptions;
|
|
45
|
-
ignorePatterns?: string[];
|
|
46
|
-
ruleExclusions?: Record<string, string[]>;
|
|
47
|
-
cliFiles?: string[];
|
|
48
|
-
tanstackStart?: PresetTanstackStartOptions;
|
|
49
|
-
next?: PresetNextOptions;
|
|
50
|
-
tailwind?: false | PresetTailwindOptions;
|
|
51
|
-
shadcn?: false | PresetShadcnOptions;
|
|
52
|
-
}
|
|
53
|
-
export interface PresetPolicyOptions extends Partial<Record<PresetPolicyName, PresetPolicy>> {
|
|
54
|
-
}
|
|
55
|
-
export interface PresetFormattingOptions {
|
|
56
|
-
semi?: 'always' | 'never';
|
|
20
|
+
export interface PresetStyleOptions {
|
|
57
21
|
quotes?: 'single' | 'double';
|
|
22
|
+
semicolons?: boolean;
|
|
23
|
+
multiline?: boolean;
|
|
24
|
+
padding?: boolean;
|
|
25
|
+
dashes?: boolean;
|
|
58
26
|
}
|
|
59
|
-
export interface
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
export interface PresetModulesOptions {
|
|
66
|
-
customFileRoles?: string[];
|
|
67
|
-
migrationFiles?: string[];
|
|
68
|
-
/** Type files allowed outside `types/`; they follow the backend `types/` contract. */
|
|
69
|
-
colocatedTypeFiles?: string[];
|
|
27
|
+
export interface PresetBasicsOptions {
|
|
28
|
+
trivial?: boolean;
|
|
29
|
+
state?: boolean;
|
|
30
|
+
switch?: boolean;
|
|
31
|
+
negation?: boolean;
|
|
70
32
|
}
|
|
71
|
-
export interface
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
mocking?: PresetTestMockingPreset | PresetTestMockingOptions;
|
|
77
|
-
}
|
|
78
|
-
export type PresetTestMockingPreset = 'modules' | 'strict';
|
|
79
|
-
export interface PresetTestMockingApi {
|
|
80
|
-
api: string;
|
|
81
|
-
message?: string;
|
|
33
|
+
export interface PresetNamingOptions {
|
|
34
|
+
files?: boolean | string;
|
|
35
|
+
exports?: boolean | string;
|
|
36
|
+
folders?: boolean;
|
|
37
|
+
unique?: string;
|
|
82
38
|
}
|
|
83
|
-
export interface
|
|
84
|
-
|
|
85
|
-
/** API patterns allowed in these files; `*` allows every API. */
|
|
86
|
-
apis: string[];
|
|
39
|
+
export interface PresetCommentsOptions {
|
|
40
|
+
directives?: boolean;
|
|
87
41
|
}
|
|
88
|
-
export interface
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
/** Per-file exceptions, added after the preset's own. */
|
|
93
|
-
allow?: PresetTestMockingException[];
|
|
42
|
+
export interface PresetTypesOptions {
|
|
43
|
+
placement?: boolean;
|
|
44
|
+
safety?: boolean;
|
|
45
|
+
colocated?: string[];
|
|
94
46
|
}
|
|
95
47
|
export interface PresetImportsOptions {
|
|
96
|
-
|
|
48
|
+
sort?: boolean;
|
|
49
|
+
boundaries?: boolean;
|
|
97
50
|
aliases?: Record<string, string>;
|
|
98
|
-
|
|
51
|
+
internal?: string[];
|
|
99
52
|
}
|
|
100
|
-
export interface
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
clientOwnerFile?: string;
|
|
53
|
+
export interface PresetMockingApi {
|
|
54
|
+
api: string;
|
|
55
|
+
message?: string;
|
|
104
56
|
}
|
|
105
|
-
export interface
|
|
106
|
-
|
|
57
|
+
export interface PresetMockingException {
|
|
58
|
+
files: string[];
|
|
59
|
+
apis: string[];
|
|
107
60
|
}
|
|
108
|
-
export
|
|
109
|
-
|
|
61
|
+
export type PresetMockingPreset = 'modules' | 'strict';
|
|
62
|
+
export interface PresetMockingOptions {
|
|
63
|
+
preset?: PresetMockingPreset;
|
|
64
|
+
deny?: (string | PresetMockingApi)[];
|
|
65
|
+
allow?: PresetMockingException[];
|
|
66
|
+
}
|
|
67
|
+
export interface PresetTestsOptions {
|
|
68
|
+
assertions?: string[];
|
|
69
|
+
functions?: string[];
|
|
70
|
+
mocking?: PresetMockingPreset | PresetMockingOptions;
|
|
71
|
+
titles?: boolean;
|
|
72
|
+
fixtures?: boolean;
|
|
110
73
|
}
|
|
111
74
|
export interface PresetReactOptions {
|
|
75
|
+
a11y?: boolean;
|
|
76
|
+
effects?: boolean;
|
|
77
|
+
memo?: boolean;
|
|
78
|
+
props?: boolean;
|
|
79
|
+
perf?: boolean;
|
|
112
80
|
compiler?: boolean;
|
|
113
|
-
componentProps?: boolean;
|
|
114
81
|
}
|
|
115
|
-
export interface
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
82
|
+
export interface PresetFrameworkOptions {
|
|
83
|
+
server?: string[];
|
|
84
|
+
client?: string[];
|
|
85
|
+
dynamic?: string[];
|
|
119
86
|
}
|
|
120
|
-
export interface
|
|
121
|
-
|
|
122
|
-
additionalClientOnlyImports?: string[];
|
|
123
|
-
computedImportAllowedFiles?: string[];
|
|
87
|
+
export interface PresetExpoOptions {
|
|
88
|
+
server?: string[];
|
|
124
89
|
}
|
|
125
90
|
export interface PresetTailwindOptions {
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
rootFontSize?: number;
|
|
91
|
+
css?: string;
|
|
92
|
+
rem?: number;
|
|
129
93
|
}
|
|
130
94
|
export interface PresetShadcnOptions {
|
|
131
|
-
/** The components.json `ui` alias: a workspace package name or a tsconfig `paths` alias. It also sets the UI kit files. */
|
|
132
95
|
ui?: string;
|
|
133
|
-
/** Import sources treated as components, like the components.json `components` alias. */
|
|
134
96
|
components?: string[];
|
|
135
97
|
}
|
|
98
|
+
export interface PresetRegistryOptions {
|
|
99
|
+
file?: string;
|
|
100
|
+
skip?: string[];
|
|
101
|
+
object?: string;
|
|
102
|
+
}
|
|
103
|
+
export interface PresetBackendOptions {
|
|
104
|
+
exports?: string[];
|
|
105
|
+
registry?: false | string | PresetRegistryOptions;
|
|
106
|
+
writes?: string[];
|
|
107
|
+
}
|
|
108
|
+
export interface PresetDenyOptions {
|
|
109
|
+
imports?: Record<string, string | false>;
|
|
110
|
+
calls?: Record<string, string | false>;
|
|
111
|
+
}
|
|
112
|
+
export interface PresetExternalsOptions {
|
|
113
|
+
packages?: string[];
|
|
114
|
+
}
|
|
115
|
+
export interface PresetOrpcOptions {
|
|
116
|
+
public?: string[];
|
|
117
|
+
composers?: string[];
|
|
118
|
+
client?: string;
|
|
119
|
+
}
|
|
120
|
+
export interface PresetFormsOptions {
|
|
121
|
+
resolver?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface PresetSqlOptions {
|
|
124
|
+
sanitizers?: string[];
|
|
125
|
+
}
|
|
126
|
+
export interface PresetGroups {
|
|
127
|
+
layout?: PresetSwitch | PresetLayoutOptions;
|
|
128
|
+
limits?: PresetSwitch | PresetLimitsOptions;
|
|
129
|
+
style?: PresetSwitch | PresetStyleOptions;
|
|
130
|
+
basics?: PresetSwitch | PresetBasicsOptions;
|
|
131
|
+
naming?: PresetSwitch | PresetNamingOptions;
|
|
132
|
+
comments?: PresetSwitch | PresetCommentsOptions;
|
|
133
|
+
types?: PresetSwitch | PresetTypesOptions;
|
|
134
|
+
imports?: PresetSwitch | PresetImportsOptions;
|
|
135
|
+
tests?: PresetSwitch | PresetTestsOptions;
|
|
136
|
+
react?: PresetSwitch | PresetReactOptions;
|
|
137
|
+
tanstack?: PresetSwitch | PresetFrameworkOptions;
|
|
138
|
+
next?: PresetSwitch | PresetFrameworkOptions;
|
|
139
|
+
expo?: PresetSwitch | PresetExpoOptions;
|
|
140
|
+
tailwind?: PresetSwitch | PresetTailwindOptions;
|
|
141
|
+
shadcn?: PresetSwitch | PresetShadcnOptions;
|
|
142
|
+
kit?: boolean;
|
|
143
|
+
backend?: PresetSwitch | PresetBackendOptions;
|
|
144
|
+
orpc?: PresetSwitch | PresetOrpcOptions;
|
|
145
|
+
schemas?: PresetSwitch;
|
|
146
|
+
forms?: PresetSwitch | PresetFormsOptions;
|
|
147
|
+
sql?: PresetSwitch | PresetSqlOptions;
|
|
148
|
+
console?: boolean;
|
|
149
|
+
deny?: PresetSwitch | PresetDenyOptions;
|
|
150
|
+
externals?: PresetSwitch | PresetExternalsOptions;
|
|
151
|
+
}
|
|
152
|
+
export type PresetGroupName = keyof PresetGroups;
|
|
153
|
+
export interface PresetFolder extends PresetGroups {
|
|
154
|
+
severity?: PresetLevel;
|
|
155
|
+
source?: string;
|
|
156
|
+
rules?: PresetRules;
|
|
157
|
+
}
|
|
158
|
+
export type PresetFolders = Record<string, boolean | PresetFolder>;
|
|
159
|
+
export interface PresetConfig {
|
|
160
|
+
root?: string;
|
|
161
|
+
folders?: PresetFolders;
|
|
162
|
+
detect?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export type PresetRecipe = PresetGroups;
|
|
136
165
|
export type PresetRules = NonNullable<OxlintConfig['rules']>;
|
|
137
|
-
export type
|
|
138
|
-
export
|
|
139
|
-
|
|
166
|
+
export type PresetJsPlugins = NonNullable<OxlintConfig['jsPlugins']>;
|
|
167
|
+
export type PresetSettings = NonNullable<OxlintConfig['settings']>;
|
|
168
|
+
export interface PresetResolvedGroups {
|
|
169
|
+
layout: PresetLayoutOptions & Required<Pick<PresetLayoutOptions, 'suffixes' | 'strict' | 'operations' | 'service'>>;
|
|
170
|
+
limits: Required<PresetLimitsOptions>;
|
|
171
|
+
style: Required<PresetStyleOptions>;
|
|
172
|
+
basics: Required<PresetBasicsOptions>;
|
|
173
|
+
naming: Required<Omit<PresetNamingOptions, 'unique'>> & Pick<PresetNamingOptions, 'unique'>;
|
|
174
|
+
comments: Required<PresetCommentsOptions>;
|
|
175
|
+
types: Required<PresetTypesOptions>;
|
|
176
|
+
imports: Omit<Required<PresetImportsOptions>, 'internal'> & Pick<PresetImportsOptions, 'internal'>;
|
|
177
|
+
tests: Required<PresetTestsOptions>;
|
|
178
|
+
react: Required<Pick<PresetReactOptions, 'a11y' | 'effects' | 'props' | 'compiler'>> & Pick<PresetReactOptions, 'memo' | 'perf'>;
|
|
179
|
+
tanstack: Required<PresetFrameworkOptions>;
|
|
180
|
+
next: Required<PresetFrameworkOptions>;
|
|
181
|
+
expo: Required<PresetExpoOptions>;
|
|
182
|
+
tailwind: Pick<PresetTailwindOptions, 'css'> & {
|
|
183
|
+
rem: number;
|
|
184
|
+
};
|
|
185
|
+
shadcn: Required<PresetShadcnOptions>;
|
|
186
|
+
kit: PresetEmptyOptions;
|
|
187
|
+
backend: PresetBackendOptions & Required<Pick<PresetBackendOptions, 'writes'>>;
|
|
188
|
+
orpc: PresetOrpcOptions;
|
|
189
|
+
schemas: PresetEmptyOptions;
|
|
190
|
+
forms: Required<PresetFormsOptions>;
|
|
191
|
+
sql: Required<PresetSqlOptions>;
|
|
192
|
+
console: PresetEmptyOptions;
|
|
193
|
+
deny: {
|
|
194
|
+
imports: Record<string, string>;
|
|
195
|
+
calls: Record<string, string>;
|
|
196
|
+
};
|
|
197
|
+
externals: Required<PresetExternalsOptions>;
|
|
198
|
+
}
|
|
199
|
+
export interface PresetEmptyOptions {
|
|
200
|
+
empty?: never;
|
|
201
|
+
}
|
|
202
|
+
export type PresetGroupSettings<K extends PresetGroupName> = PresetResolvedGroups[K] & {
|
|
203
|
+
level: PresetLevel;
|
|
204
|
+
};
|
|
205
|
+
export type PresetEffective = {
|
|
206
|
+
[K in PresetGroupName]?: PresetGroupSettings<K> | null;
|
|
207
|
+
};
|
|
208
|
+
export type PresetGroupDefaults = {
|
|
209
|
+
[K in PresetGroupName]: PresetGroupSettings<K>;
|
|
210
|
+
};
|
|
211
|
+
export type PresetKind = 'web' | 'backend' | 'library' | 'console';
|
|
212
|
+
export type PresetFramework = 'tanstack' | 'next' | 'expo';
|
|
213
|
+
export type PresetKindGroup = PresetFramework | 'backend' | 'console';
|
|
214
|
+
export interface PresetScope {
|
|
215
|
+
key: string;
|
|
216
|
+
parent: PresetScope | null;
|
|
217
|
+
depth: number;
|
|
218
|
+
folder: PresetFolder;
|
|
219
|
+
effective: PresetEffective;
|
|
220
|
+
}
|
|
221
|
+
export interface PresetUnit {
|
|
222
|
+
key: string;
|
|
223
|
+
scope: PresetScope;
|
|
224
|
+
kind: PresetKind;
|
|
225
|
+
framework?: PresetFramework;
|
|
226
|
+
source: string;
|
|
227
|
+
layout: Record<string, PresetLayoutMode>;
|
|
228
|
+
}
|
|
229
|
+
export interface PresetLayoutScope {
|
|
230
|
+
path: string;
|
|
231
|
+
folder: string;
|
|
232
|
+
mode: PresetLayoutMode;
|
|
233
|
+
}
|
|
234
|
+
export interface PresetRuntimeOptions {
|
|
235
|
+
web: string[];
|
|
236
|
+
backend: string[];
|
|
237
|
+
aliases: Record<string, string>;
|
|
238
|
+
backendPackages: string[];
|
|
239
|
+
server: string[];
|
|
240
|
+
client: string[];
|
|
241
|
+
dynamic: string[];
|
|
242
|
+
rpc?: string[];
|
|
140
243
|
}
|
|
141
244
|
export interface PresetImportRestriction {
|
|
142
245
|
group: string[];
|
|
143
246
|
message: string;
|
|
144
247
|
}
|
|
145
|
-
export
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
248
|
+
export type PresetImportTarget = string | null | PresetImportTarget[] | {
|
|
249
|
+
[condition: string]: PresetImportTarget;
|
|
250
|
+
};
|
|
251
|
+
export interface PresetManifest {
|
|
252
|
+
name?: string;
|
|
253
|
+
dependencies?: Record<string, string>;
|
|
254
|
+
devDependencies?: Record<string, string>;
|
|
255
|
+
peerDependencies?: Record<string, string>;
|
|
256
|
+
workspaces?: string[] | {
|
|
257
|
+
packages?: string[];
|
|
258
|
+
};
|
|
259
|
+
imports?: Record<string, PresetImportTarget>;
|
|
260
|
+
exports?: unknown;
|
|
261
|
+
}
|
|
262
|
+
export interface PresetProject {
|
|
263
|
+
root: string;
|
|
264
|
+
scopes: PresetScope[];
|
|
265
|
+
units: PresetUnit[];
|
|
266
|
+
suffixes: string[];
|
|
267
|
+
colocated: string[];
|
|
268
|
+
orpc: Required<PresetOrpcOptions>;
|
|
269
|
+
layouts: PresetLayoutScope[];
|
|
149
270
|
rpcClients: string[];
|
|
271
|
+
operations: string[];
|
|
150
272
|
packages: string[];
|
|
151
273
|
scripts: string[];
|
|
152
|
-
root: string;
|
|
153
|
-
level: 'error' | 'warn';
|
|
154
|
-
css: Record<string, string>;
|
|
155
|
-
baseImports: PresetImportRestriction[];
|
|
156
274
|
web: string[];
|
|
157
|
-
/** Web `src` roots per framework. */
|
|
158
275
|
tanstackWeb: string[];
|
|
159
276
|
nextWeb: string[];
|
|
277
|
+
expoWeb: string[];
|
|
160
278
|
backend: string[];
|
|
161
|
-
/** Server and runner architecture roots, without their source folder. */
|
|
162
279
|
backendRoots: string[];
|
|
163
|
-
/** Source folders of packages roots: `src` of a package, or of each package in a folder of packages. */
|
|
164
280
|
packageSources: string[];
|
|
165
|
-
/** Backend and package source folders, whose services follow the backend contract. */
|
|
166
281
|
serviceRoots: string[];
|
|
167
282
|
app: string[];
|
|
168
283
|
appFiles: string[];
|
|
169
284
|
webFiles: string[];
|
|
170
|
-
/** Web files plus React code in packages: `.tsx` files and the `components` and `hooks` folders. */
|
|
171
285
|
reactFiles: string[];
|
|
172
286
|
backendFiles: string[];
|
|
173
287
|
services: string[];
|
|
174
288
|
utilities: string[];
|
|
175
289
|
types: string[];
|
|
176
|
-
/** UI kit folders resolved from `shadcn.ui`. */
|
|
177
290
|
uiRoots: string[];
|
|
178
|
-
/** UI kit folders inside a web source. */
|
|
179
291
|
webUiRoots: string[];
|
|
180
292
|
ui: string[];
|
|
181
293
|
generated: string[];
|
|
@@ -184,6 +296,13 @@ export interface PresetContext {
|
|
|
184
296
|
components: string[];
|
|
185
297
|
hooks: string[];
|
|
186
298
|
publicEntrypoints: string[];
|
|
299
|
+
baseImports: PresetImportRestriction[];
|
|
300
|
+
css: Record<string, string>;
|
|
301
|
+
registries: string[];
|
|
302
|
+
ignores: string[];
|
|
303
|
+
outputs: string[];
|
|
187
304
|
}
|
|
188
|
-
export type
|
|
189
|
-
export type
|
|
305
|
+
export type PresetBuilder<K extends PresetGroupName> = (project: PresetProject, settings: PresetGroupSettings<K>, scope: PresetScope) => OxlintOverride[];
|
|
306
|
+
export type PresetBuilders = {
|
|
307
|
+
[K in PresetGroupName]?: PresetBuilder<K>;
|
|
308
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AstFunction } from './ast.types.ts';
|
|
2
|
+
import type { DeclarationsCandidate } from './declarations.types.ts';
|
|
3
|
+
import type { ESTree } from '@oxlint/plugins';
|
|
4
|
+
export interface ReactPropsOptions {
|
|
5
|
+
prefix?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ReactPropsComponent {
|
|
8
|
+
candidate: DeclarationsCandidate;
|
|
9
|
+
index: number;
|
|
10
|
+
}
|
|
11
|
+
export interface ReactPropsTarget {
|
|
12
|
+
fn: AstFunction;
|
|
13
|
+
typeArgument?: ESTree.TSType;
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface SchemasElementOptions {
|
|
2
|
+
namespaces: string[];
|
|
3
|
+
methods: string[];
|
|
4
|
+
structural: string[];
|
|
5
|
+
scalars: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SchemasLocalOptions {
|
|
8
|
+
packages: string[];
|
|
9
|
+
namespaces: string[];
|
|
10
|
+
allow?: string[];
|
|
11
|
+
patterns?: string[];
|
|
12
|
+
message?: string;
|
|
13
|
+
importMessage?: string;
|
|
14
|
+
constructionMessage?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface SchemasRederiveOptions {
|
|
17
|
+
from: string[];
|
|
18
|
+
namespaces?: string[];
|
|
19
|
+
operators?: string[];
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type SourceIndent = number | 'tab';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { AstFunction } from './ast.types.ts';
|
|
2
|
+
import type { OptionsPattern } from './options.types.ts';
|
|
3
|
+
import type { ESTree } from '@oxlint/plugins';
|
|
4
|
+
export interface TestsModifiersOptions {
|
|
5
|
+
functions?: string[];
|
|
6
|
+
}
|
|
7
|
+
export interface TestsAssertionsOptions extends TestsModifiersOptions {
|
|
8
|
+
assertions?: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface TestsAssertionsRegistration {
|
|
11
|
+
call: ESTree.CallExpression;
|
|
12
|
+
callback: AstFunction;
|
|
13
|
+
table?: ESTree.Expression;
|
|
14
|
+
}
|
|
15
|
+
export interface TestsAssertionsRow {
|
|
16
|
+
bindings: Map<ESTree.Node, AstFunction>;
|
|
17
|
+
callbacks: AstFunction[];
|
|
18
|
+
}
|
|
19
|
+
export interface TestsAssertionsState {
|
|
20
|
+
tests: string[];
|
|
21
|
+
patterns: RegExp[];
|
|
22
|
+
assertionRoots: Set<string>;
|
|
23
|
+
functions: Map<ESTree.Node, AstFunction>;
|
|
24
|
+
values: Map<ESTree.Node, ESTree.Expression>;
|
|
25
|
+
aliases: Map<ESTree.Node, string>;
|
|
26
|
+
shadowed: Set<ESTree.Node>;
|
|
27
|
+
calls: ESTree.CallExpression[];
|
|
28
|
+
allowed: Set<AstFunction>;
|
|
29
|
+
}
|
|
30
|
+
export interface TestsTitlesOptions {
|
|
31
|
+
callees: string[];
|
|
32
|
+
deny?: OptionsPattern;
|
|
33
|
+
require?: OptionsPattern;
|
|
34
|
+
flags?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface TestsTitlesPattern {
|
|
37
|
+
regex: RegExp;
|
|
38
|
+
pattern: string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { OptionsPattern } from './options.types.ts';
|
|
2
|
+
import type { ESTree } from '@oxlint/plugins';
|
|
3
|
+
export interface TypesDeclarationsOptions {
|
|
4
|
+
allow?: OptionsPattern;
|
|
5
|
+
}
|
|
6
|
+
export type TypesDeclarationNode = ESTree.TSTypeAliasDeclaration | ESTree.TSInterfaceDeclaration;
|
|
7
|
+
export interface TypesImportedBinding {
|
|
8
|
+
name: string;
|
|
9
|
+
source: string;
|
|
10
|
+
}
|
|
11
|
+
export interface TypesInlineOptions {
|
|
12
|
+
parameters?: boolean;
|
|
13
|
+
returns?: boolean;
|
|
14
|
+
functions?: boolean;
|
|
15
|
+
min?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface TypesNamespaceImportOptions {
|
|
18
|
+
max: number;
|
|
19
|
+
names: Record<string, string>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { AstFunction } from '../types/ast.types.ts';
|
|
2
|
+
import type { ESTree } from '@oxlint/plugins';
|
|
3
|
+
export declare function astVisit(node: unknown, ancestors: ESTree.Node[], callback: (node: ESTree.Node, ancestors: ESTree.Node[]) => void): void;
|
|
4
|
+
export declare function astMatchesCallee(name: string | undefined, callees: readonly string[], modifiers: ReadonlySet<string>): boolean;
|
|
5
|
+
export declare function astIsTypeOnlyImport(node: ESTree.ImportDeclaration): boolean;
|
|
6
|
+
export declare function astStaticString(node: ESTree.Node): string | undefined;
|
|
7
|
+
export declare function astContainsJsx(node: unknown): boolean;
|
|
8
|
+
export declare function astNearestFunction(ancestors: readonly ESTree.Node[]): AstFunction | undefined;
|
|
9
|
+
export declare function astReturnExpressions(node: AstFunction): ESTree.Expression[];
|
|
10
|
+
export declare function astSingleExpression(node: AstFunction): ESTree.Expression | null;
|
|
11
|
+
export declare function astUnwrap(expression: ESTree.Expression): ESTree.Expression;
|
|
12
|
+
export declare function astIsForwarder(node: AstFunction, expression: ESTree.Expression): boolean;
|
|
13
|
+
export declare function astModuleName(node: ESTree.ModuleExportName): string;
|
|
14
|
+
export declare function astBindings(pattern: ESTree.BindingPattern | ESTree.BindingRestElement): ESTree.BindingIdentifier[];
|
|
15
|
+
export declare function astDeclaration(statement: ESTree.Program['body'][number]): ESTree.ArrayExpression | ESTree.ArrowFunctionExpression | ESTree.AssignmentExpression | ESTree.AwaitExpression | ESTree.BigIntLiteral | ESTree.BinaryExpression | ESTree.BlockStatement | ESTree.BooleanLiteral | ESTree.BreakStatement | ESTree.CallExpression | ESTree.ChainExpression | ESTree.Class | ESTree.ComputedMemberExpression | ESTree.ConditionalExpression | ESTree.ContinueStatement | ESTree.DebuggerStatement | ESTree.DoWhileStatement | ESTree.EmptyStatement | ESTree.ExportAllDeclaration | ESTree.ExpressionStatement | ESTree.ForInStatement | ESTree.ForOfStatement | ESTree.ForStatement | ESTree.Function | ESTree.IdentifierReference | ESTree.IfStatement | ESTree.ImportDeclaration | ESTree.ImportExpression | ESTree.JSXElement | ESTree.JSXFragment | ESTree.LabeledStatement | ESTree.LogicalExpression | ESTree.MetaProperty | ESTree.NewExpression | ESTree.NullLiteral | ESTree.NumericLiteral | ESTree.ObjectExpression | ESTree.ParenthesizedExpression | ESTree.PrivateFieldExpression | ESTree.PrivateInExpression | ESTree.RegExpLiteral | ESTree.ReturnStatement | ESTree.SequenceExpression | ESTree.StaticMemberExpression | ESTree.StringLiteral | ESTree.Super | ESTree.SwitchStatement | ESTree.TSAsExpression | ESTree.TSEnumDeclaration | ESTree.TSExportAssignment | ESTree.TSGlobalDeclaration | ESTree.TSImportEqualsDeclaration | ESTree.TSInstantiationExpression | ESTree.TSInterfaceDeclaration | ESTree.TSModuleDeclaration | ESTree.TSNamespaceExportDeclaration | ESTree.TSNonNullExpression | ESTree.TSSatisfiesExpression | ESTree.TSTypeAliasDeclaration | ESTree.TSTypeAssertion | ESTree.TaggedTemplateExpression | ESTree.TemplateLiteral | ESTree.ThisExpression | ESTree.ThrowStatement | ESTree.TryStatement | ESTree.UnaryExpression | ESTree.UpdateExpression | ESTree.V8IntrinsicExpression | ESTree.VariableDeclaration | ESTree.WhileStatement | ESTree.WithStatement | ESTree.YieldExpression | null;
|
|
16
|
+
export declare function astMemberName(node: ESTree.MemberExpression): string | undefined;
|
|
17
|
+
export declare function astDottedName(node: ESTree.Node): string | undefined;
|
|
18
|
+
export declare function astCallName(node: ESTree.CallExpression): string | undefined;
|
|
19
|
+
export declare function astSelectorRule(selector: string, message: string): import("@oxlint/plugins").Rule;
|