oxlint-plugin-arch 0.12.6 → 0.13.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/CHANGELOG.md +90 -0
- package/README.md +3 -3
- package/dist/index.js +396 -149
- package/dist/preset/preset-effect.d.ts +3 -0
- package/dist/preset/preset-recipes.d.ts +10 -0
- package/dist/preset/preset.constants.d.ts +17 -2
- package/dist/preset/preset.d.ts +11 -1
- package/dist/preset/preset.js +681 -221
- package/dist/preset/preset.utils.d.ts +5 -0
- package/dist/rules/code/code-delegate.d.ts +1 -0
- package/dist/rules/react/react-query-props.d.ts +1 -0
- package/dist/types/backend.types.d.ts +2 -3
- package/dist/types/code.types.d.ts +6 -0
- package/dist/types/files.types.d.ts +3 -2
- package/dist/types/preset.types.d.ts +26 -24
- package/dist/types/react.types.d.ts +4 -0
- package/dist/types/types.types.d.ts +4 -0
- package/dist/vendor/dillon-anti-slop/index.js +1 -1
- package/package.json +15 -1
|
@@ -2,6 +2,7 @@ import type * as PresetTypes from '../types/preset.types.ts';
|
|
|
2
2
|
import type { OxlintOverride } from 'oxlint';
|
|
3
3
|
export declare class PresetError extends Error {
|
|
4
4
|
}
|
|
5
|
+
export declare function presetEffectStyle(): PresetTypes.PresetEffectStyle;
|
|
5
6
|
export declare function presetEffectPackages(): PresetTypes.PresetEffectPackages;
|
|
6
7
|
export declare function presetScopes(roots: string[], suffix?: string): string[];
|
|
7
8
|
export declare function presetServiceScopes(folders: Record<string, string>, sources: string[], suffix?: string): string[];
|
|
@@ -9,9 +10,13 @@ export declare function presetOverride(files: string[], rules: PresetTypes.Prese
|
|
|
9
10
|
export declare function presetSeverity(rules: PresetTypes.PresetRules, level: PresetTypes.PresetLevel): PresetTypes.PresetRules;
|
|
10
11
|
export declare function presetPackageName(root: string, directory: string): string | undefined;
|
|
11
12
|
export declare function presetIntersect(glob: string, scope: string): string[];
|
|
13
|
+
export declare function presetGlobEscape(path: string): string;
|
|
12
14
|
export declare function presetAliases(root: string, aliases: Record<string, string> | undefined): Record<string, string>;
|
|
13
15
|
export declare function presetRuntime(project: PresetTypes.PresetProject, settings: Required<PresetTypes.PresetFrameworkOptions>, framework: PresetTypes.PresetFramework, rule: string): OxlintOverride[];
|
|
14
16
|
export declare function presetManifest(root: string, directory: string): PresetTypes.PresetManifest;
|
|
15
17
|
export declare function presetIsDirectory(path: string): boolean;
|
|
16
18
|
export declare function presetServicesFolder(root: string, source: string, configured?: string, fallback?: boolean): string;
|
|
17
19
|
export declare function presetIsFile(path: string): boolean;
|
|
20
|
+
export declare function presetSource(root: string, directory: string, configured?: string): string;
|
|
21
|
+
export declare function presetFilled(conventions: PresetTypes.PresetFolders, exists: (path: string) => boolean): PresetTypes.PresetFolders;
|
|
22
|
+
export declare function presetMerge(base: boolean | PresetTypes.PresetFolder | undefined, top: boolean | PresetTypes.PresetFolder): boolean | PresetTypes.PresetFolder;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const codeDelegate: import("@oxlint/plugins").Rule;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const reactQueryProps: import("@oxlint/plugins").Rule;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export interface BackendOrpcOutputOptions {
|
|
2
|
-
composers: string[];
|
|
3
2
|
handler?: string;
|
|
4
3
|
output?: string;
|
|
5
4
|
}
|
|
@@ -11,8 +10,8 @@ export interface BackendServiceFunctionsOptions {
|
|
|
11
10
|
message?: string;
|
|
12
11
|
}
|
|
13
12
|
export interface BackendSqlLikeOptions {
|
|
14
|
-
methods
|
|
15
|
-
sanitizers
|
|
13
|
+
methods?: string[];
|
|
14
|
+
sanitizers?: string[];
|
|
16
15
|
bindings?: boolean;
|
|
17
16
|
operators?: string[];
|
|
18
17
|
}
|
|
@@ -12,6 +12,11 @@ export interface CodeConstructorOptions {
|
|
|
12
12
|
calls?: boolean;
|
|
13
13
|
message?: string;
|
|
14
14
|
}
|
|
15
|
+
export interface CodeDelegateOptions {
|
|
16
|
+
methods?: string[];
|
|
17
|
+
reads?: string[];
|
|
18
|
+
max?: number;
|
|
19
|
+
}
|
|
15
20
|
export interface CodeLiteralInOptions {
|
|
16
21
|
allow: string[];
|
|
17
22
|
}
|
|
@@ -52,6 +57,7 @@ export interface CodeTrivialFunctionsOptions {
|
|
|
52
57
|
services?: boolean;
|
|
53
58
|
deny?: string[];
|
|
54
59
|
guards?: boolean;
|
|
60
|
+
defaults?: boolean;
|
|
55
61
|
}
|
|
56
62
|
export interface CodeTrivialFunctionsGuardState {
|
|
57
63
|
values: Set<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NamingExportsStem } from './naming.types.ts';
|
|
1
|
+
import type { NamingExportsStem, NamingStemMode } from './naming.types.ts';
|
|
2
2
|
import type { OptionsPattern } from './options.types.ts';
|
|
3
3
|
import type { ESTree } from '@oxlint/plugins';
|
|
4
4
|
export interface FilesComponentsOnlyOptions {
|
|
@@ -24,7 +24,8 @@ export interface FilesDomainConstantsOptions {
|
|
|
24
24
|
roles?: string[];
|
|
25
25
|
file?: string;
|
|
26
26
|
}
|
|
27
|
-
export interface FilesExportsOptions extends Pick<NamingExportsStem, '
|
|
27
|
+
export interface FilesExportsOptions extends Pick<NamingExportsStem, 'roles' | 'separators' | 'singularize'> {
|
|
28
|
+
stem?: NamingStemMode | 'folder';
|
|
28
29
|
names?: string[];
|
|
29
30
|
patterns?: string[];
|
|
30
31
|
types?: boolean;
|
|
@@ -10,7 +10,7 @@ export interface PresetLayoutOptions {
|
|
|
10
10
|
services?: PresetLayoutMode | false;
|
|
11
11
|
hooks?: PresetLayoutMode | false;
|
|
12
12
|
components?: PresetLayoutMode | false;
|
|
13
|
-
|
|
13
|
+
files?: string[];
|
|
14
14
|
strict?: boolean;
|
|
15
15
|
operations?: PresetOperations;
|
|
16
16
|
service?: string[];
|
|
@@ -106,36 +106,30 @@ export interface PresetRegistryOptions {
|
|
|
106
106
|
export interface PresetBackendOptions {
|
|
107
107
|
exports?: string[];
|
|
108
108
|
registry?: false | string | PresetRegistryOptions;
|
|
109
|
-
writes?: string[];
|
|
110
109
|
}
|
|
111
110
|
export interface PresetDenyOptions {
|
|
112
111
|
imports?: Record<string, string | false>;
|
|
113
112
|
calls?: Record<string, string | false>;
|
|
114
113
|
}
|
|
115
|
-
export interface PresetExternalsOptions {
|
|
116
|
-
packages?: string[];
|
|
117
|
-
}
|
|
118
114
|
export interface PresetOrpcOptions {
|
|
119
115
|
public?: string[];
|
|
120
|
-
composers?: string[];
|
|
121
116
|
client?: string;
|
|
122
117
|
}
|
|
123
|
-
export interface PresetFormsOptions {
|
|
124
|
-
resolver?: string;
|
|
125
|
-
}
|
|
126
118
|
export interface PresetEffectOptions {
|
|
119
|
+
code?: boolean;
|
|
127
120
|
width?: number;
|
|
128
121
|
exports?: OptionsPattern;
|
|
129
122
|
skip?: OptionsPattern;
|
|
130
123
|
entries?: string[];
|
|
131
124
|
}
|
|
125
|
+
export interface PresetEffectStyle {
|
|
126
|
+
rules: PresetRules;
|
|
127
|
+
jsPlugins: PresetJsPlugins;
|
|
128
|
+
}
|
|
132
129
|
export interface PresetEffectPackages {
|
|
133
130
|
tsgo: typeof EffectTsgo;
|
|
134
131
|
linteffect: typeof EffectLinteffect;
|
|
135
132
|
}
|
|
136
|
-
export interface PresetSqlOptions {
|
|
137
|
-
sanitizers?: string[];
|
|
138
|
-
}
|
|
139
133
|
export interface PresetGroups {
|
|
140
134
|
layout?: PresetSwitch | PresetLayoutOptions;
|
|
141
135
|
limits?: PresetSwitch | PresetLimitsOptions;
|
|
@@ -156,12 +150,12 @@ export interface PresetGroups {
|
|
|
156
150
|
backend?: PresetSwitch | PresetBackendOptions;
|
|
157
151
|
orpc?: PresetSwitch | PresetOrpcOptions;
|
|
158
152
|
schemas?: PresetSwitch;
|
|
159
|
-
forms?: PresetSwitch
|
|
160
|
-
sql?: PresetSwitch
|
|
153
|
+
forms?: PresetSwitch;
|
|
154
|
+
sql?: PresetSwitch;
|
|
161
155
|
effect?: PresetSwitch | PresetEffectOptions;
|
|
162
156
|
console?: boolean;
|
|
163
157
|
deny?: PresetSwitch | PresetDenyOptions;
|
|
164
|
-
externals?: PresetSwitch
|
|
158
|
+
externals?: PresetSwitch;
|
|
165
159
|
}
|
|
166
160
|
export type PresetGroupName = keyof PresetGroups;
|
|
167
161
|
export interface PresetFolder extends PresetGroups {
|
|
@@ -171,18 +165,19 @@ export interface PresetFolder extends PresetGroups {
|
|
|
171
165
|
rules?: PresetRules;
|
|
172
166
|
}
|
|
173
167
|
export type PresetFolders = Record<string, boolean | PresetFolder>;
|
|
168
|
+
export type PresetEntry = [string, boolean | PresetFolder];
|
|
174
169
|
export interface PresetConfig {
|
|
175
170
|
root?: string;
|
|
176
171
|
folders?: PresetFolders;
|
|
177
172
|
detect?: boolean;
|
|
178
173
|
}
|
|
179
|
-
export type PresetRecipe = PresetGroups
|
|
174
|
+
export type PresetRecipe = PresetGroups & Partial<Record<symbol, string>>;
|
|
180
175
|
export type PresetRules = NonNullable<OxlintConfig['rules']>;
|
|
181
176
|
export type PresetJsPlugins = NonNullable<OxlintConfig['jsPlugins']>;
|
|
182
177
|
export type PresetPlugins = NonNullable<OxlintConfig['plugins']>;
|
|
183
178
|
export type PresetSettings = NonNullable<OxlintConfig['settings']>;
|
|
184
179
|
export interface PresetResolvedGroups {
|
|
185
|
-
layout: PresetLayoutOptions & Required<Pick<PresetLayoutOptions, '
|
|
180
|
+
layout: PresetLayoutOptions & Required<Pick<PresetLayoutOptions, 'files' | 'strict' | 'operations' | 'service'>>;
|
|
186
181
|
limits: Required<PresetLimitsOptions>;
|
|
187
182
|
style: Required<PresetStyleOptions>;
|
|
188
183
|
basics: Required<PresetBasicsOptions>;
|
|
@@ -200,21 +195,22 @@ export interface PresetResolvedGroups {
|
|
|
200
195
|
};
|
|
201
196
|
shadcn: Required<PresetShadcnOptions>;
|
|
202
197
|
kit: PresetEmptyOptions;
|
|
203
|
-
backend: PresetBackendOptions
|
|
198
|
+
backend: PresetBackendOptions;
|
|
204
199
|
orpc: PresetOrpcOptions;
|
|
205
200
|
schemas: PresetEmptyOptions;
|
|
206
|
-
forms:
|
|
207
|
-
sql:
|
|
201
|
+
forms: PresetEmptyOptions;
|
|
202
|
+
sql: PresetEmptyOptions;
|
|
208
203
|
effect: Pick<PresetEffectOptions, 'exports' | 'skip'> & {
|
|
204
|
+
code: boolean;
|
|
209
205
|
width: number;
|
|
210
206
|
entries: string[];
|
|
211
207
|
};
|
|
212
208
|
console: PresetEmptyOptions;
|
|
213
209
|
deny: {
|
|
214
|
-
imports: Record<string, string>;
|
|
215
|
-
calls: Record<string, string>;
|
|
210
|
+
imports: Record<string, string | false>;
|
|
211
|
+
calls: Record<string, string | false>;
|
|
216
212
|
};
|
|
217
|
-
externals:
|
|
213
|
+
externals: PresetEmptyOptions;
|
|
218
214
|
}
|
|
219
215
|
export interface PresetEmptyOptions {
|
|
220
216
|
empty?: never;
|
|
@@ -238,6 +234,11 @@ export interface PresetScope {
|
|
|
238
234
|
folder: PresetFolder;
|
|
239
235
|
effective: PresetEffective;
|
|
240
236
|
}
|
|
237
|
+
export interface PresetFileKey {
|
|
238
|
+
pattern: string;
|
|
239
|
+
folder: PresetFolder;
|
|
240
|
+
scopes: PresetScope[];
|
|
241
|
+
}
|
|
241
242
|
export interface PresetUnit {
|
|
242
243
|
key: string;
|
|
243
244
|
scope: PresetScope;
|
|
@@ -284,8 +285,9 @@ export interface PresetProject {
|
|
|
284
285
|
root: string;
|
|
285
286
|
serviceFolders: Record<string, string>;
|
|
286
287
|
scopes: PresetScope[];
|
|
288
|
+
fileKeys: PresetFileKey[];
|
|
287
289
|
units: PresetUnit[];
|
|
288
|
-
|
|
290
|
+
fileKinds: string[];
|
|
289
291
|
colocated: string[];
|
|
290
292
|
orpc: Required<PresetOrpcOptions>;
|
|
291
293
|
layouts: PresetLayoutScope[];
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { AstFunction } from './ast.types.ts';
|
|
2
2
|
import type { DeclarationsCandidate } from './declarations.types.ts';
|
|
3
3
|
import type { ESTree } from '@oxlint/plugins';
|
|
4
|
+
export interface ReactQueryPropsOptions {
|
|
5
|
+
hooks?: string[];
|
|
6
|
+
functions?: string[];
|
|
7
|
+
}
|
|
4
8
|
export interface ReactPropsOptions {
|
|
5
9
|
prefix?: boolean;
|
|
6
10
|
suffix?: string;
|
|
@@ -2,6 +2,7 @@ import type { OptionsPattern } from './options.types.ts';
|
|
|
2
2
|
import type { ESTree } from '@oxlint/plugins';
|
|
3
3
|
export interface TypesDeclarationsOptions {
|
|
4
4
|
allow?: OptionsPattern;
|
|
5
|
+
modules?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export type TypesDeclarationNode = ESTree.TSTypeAliasDeclaration | ESTree.TSInterfaceDeclaration;
|
|
7
8
|
export interface TypesImportedBinding {
|
|
@@ -12,6 +13,9 @@ export interface TypesInlineOptions {
|
|
|
12
13
|
parameters?: boolean;
|
|
13
14
|
returns?: boolean;
|
|
14
15
|
functions?: boolean;
|
|
16
|
+
variables?: boolean;
|
|
17
|
+
assertions?: boolean;
|
|
18
|
+
arguments?: boolean;
|
|
15
19
|
min?: number;
|
|
16
20
|
}
|
|
17
21
|
export interface TypesServiceOptions {
|
|
@@ -139,7 +139,7 @@ function optionsPatternsTest(patterns, value) {
|
|
|
139
139
|
function optionsGlob(pattern) {
|
|
140
140
|
const negated = [];
|
|
141
141
|
const source = pattern.replaceAll(/!\(([^()]*)\)/g, (_, options) => {
|
|
142
|
-
negated.push(options.split("|").map((option) => option.replaceAll(/[.+^$()|[\]
|
|
142
|
+
negated.push(options.split("|").map((option) => option.replaceAll(/[.+^$()|[\]\\?{}]/g, "\\$&").replaceAll("*", "[^/]*")).join("|"));
|
|
143
143
|
return `\x02${negated.length - 1}\x03`;
|
|
144
144
|
}).replaceAll(/[.+^$()|[\]\\]/g, "\\$&").replaceAll("?", "[^/]").replaceAll("**/", "\x00").replaceAll("**", "\x01").replaceAll("*", "[^/]*").replaceAll("\x00", "(?:.*/)?").replaceAll("\x01", ".*").replaceAll(/\{([^}]*)\}/g, (_, options) => `(?:${options.split(",").join("|")})`);
|
|
145
145
|
return new RegExp(`^${negated.reduce((text, names, index) => text.replace(`\x02${index}\x03`, `(?!(?:${names})(?:/|$))[^/]*`), source)}$`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-plugin-arch",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Configurable architecture rules for Oxlint JavaScript plugins.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -57,8 +57,11 @@
|
|
|
57
57
|
"@effect/tsgo": ">=0.67.1",
|
|
58
58
|
"@opsydyn/oxlint-effect": ">=2.0.1",
|
|
59
59
|
"@shadcn/lint": ">=0.2.3",
|
|
60
|
+
"eslint-plugin-de-morgan": ">=2.3.0",
|
|
60
61
|
"eslint-plugin-react": ">=7.37.5",
|
|
61
62
|
"eslint-plugin-react-you-might-not-need-an-effect": ">=1.0.2",
|
|
63
|
+
"eslint-plugin-regexp": ">=3.3.3",
|
|
64
|
+
"eslint-plugin-sonarjs": ">=4.2.2",
|
|
62
65
|
"eslint-plugin-svg-jsx": ">=1.3.0",
|
|
63
66
|
"oxlint": ">=1.85.0",
|
|
64
67
|
"oxlint-tailwindcss": ">=1.16.0",
|
|
@@ -70,8 +73,10 @@
|
|
|
70
73
|
"@shadcn/lint": "0.2.3",
|
|
71
74
|
"@types/node": "26.6.5",
|
|
72
75
|
"bumpp": "12.3.0",
|
|
76
|
+
"eslint-plugin-de-morgan": "2.3.0",
|
|
73
77
|
"eslint-plugin-react": "7.37.5",
|
|
74
78
|
"eslint-plugin-react-you-might-not-need-an-effect": "1.0.2",
|
|
79
|
+
"eslint-plugin-regexp": "3.3.3",
|
|
75
80
|
"eslint-plugin-svg-jsx": "1.3.0",
|
|
76
81
|
"fallow": "3.36.0",
|
|
77
82
|
"oxlint": "1.89.0",
|
|
@@ -111,12 +116,21 @@
|
|
|
111
116
|
"@shadcn/lint": {
|
|
112
117
|
"optional": true
|
|
113
118
|
},
|
|
119
|
+
"eslint-plugin-de-morgan": {
|
|
120
|
+
"optional": true
|
|
121
|
+
},
|
|
114
122
|
"eslint-plugin-react": {
|
|
115
123
|
"optional": true
|
|
116
124
|
},
|
|
117
125
|
"eslint-plugin-react-you-might-not-need-an-effect": {
|
|
118
126
|
"optional": true
|
|
119
127
|
},
|
|
128
|
+
"eslint-plugin-regexp": {
|
|
129
|
+
"optional": true
|
|
130
|
+
},
|
|
131
|
+
"eslint-plugin-sonarjs": {
|
|
132
|
+
"optional": true
|
|
133
|
+
},
|
|
120
134
|
"eslint-plugin-svg-jsx": {
|
|
121
135
|
"optional": true
|
|
122
136
|
},
|