oxlint-plugin-arch 0.12.5 → 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.
@@ -2,15 +2,21 @@ 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;
6
+ export declare function presetEffectPackages(): PresetTypes.PresetEffectPackages;
5
7
  export declare function presetScopes(roots: string[], suffix?: string): string[];
6
8
  export declare function presetServiceScopes(folders: Record<string, string>, sources: string[], suffix?: string): string[];
7
9
  export declare function presetOverride(files: string[], rules: PresetTypes.PresetRules, excludeFiles?: string[]): OxlintOverride;
8
10
  export declare function presetSeverity(rules: PresetTypes.PresetRules, level: PresetTypes.PresetLevel): PresetTypes.PresetRules;
9
11
  export declare function presetPackageName(root: string, directory: string): string | undefined;
10
12
  export declare function presetIntersect(glob: string, scope: string): string[];
13
+ export declare function presetGlobEscape(path: string): string;
11
14
  export declare function presetAliases(root: string, aliases: Record<string, string> | undefined): Record<string, string>;
12
15
  export declare function presetRuntime(project: PresetTypes.PresetProject, settings: Required<PresetTypes.PresetFrameworkOptions>, framework: PresetTypes.PresetFramework, rule: string): OxlintOverride[];
13
16
  export declare function presetManifest(root: string, directory: string): PresetTypes.PresetManifest;
14
17
  export declare function presetIsDirectory(path: string): boolean;
15
18
  export declare function presetServicesFolder(root: string, source: string, configured?: string, fallback?: boolean): string;
16
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 effectLayerFile: import("@oxlint/plugins").Rule;
@@ -0,0 +1 @@
1
+ export declare const effectLayers: import("@oxlint/plugins").Rule;
@@ -0,0 +1 @@
1
+ export declare const effectMergePipe: import("@oxlint/plugins").Rule;
@@ -0,0 +1 @@
1
+ export declare const effectSchemaFirst: import("@oxlint/plugins").Rule;
@@ -0,0 +1 @@
1
+ export declare const effectValuesFirst: import("@oxlint/plugins").Rule;
@@ -0,0 +1 @@
1
+ export declare const reactQueryProps: import("@oxlint/plugins").Rule;
@@ -0,0 +1 @@
1
+ export declare const typesDuplicate: 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: string[];
15
- sanitizers: string[];
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>;
@@ -0,0 +1,46 @@
1
+ import type { OptionsPattern } from './options.types.ts';
2
+ import type { SourceIndent } from './source.types.ts';
3
+ export interface EffectLayersGroup {
4
+ callees?: string[];
5
+ min?: number;
6
+ }
7
+ export interface EffectLayersOptions {
8
+ merge?: EffectLayersGroup;
9
+ provide?: EffectLayersGroup;
10
+ indent?: SourceIndent;
11
+ }
12
+ export interface EffectMergePipeOptions {
13
+ merge?: string[];
14
+ pipe?: string[];
15
+ methods?: string[];
16
+ }
17
+ export interface EffectValuesFirstOptions {
18
+ builders?: string[];
19
+ pinned?: OptionsPattern;
20
+ }
21
+ export interface EffectLayerFileOptions {
22
+ layer?: string;
23
+ make?: string;
24
+ prefix?: string;
25
+ builders?: string[];
26
+ layers?: OptionsPattern;
27
+ services?: OptionsPattern;
28
+ constructors?: string[];
29
+ }
30
+ export interface EffectSchemaFirstRows {
31
+ types?: string[];
32
+ suffix?: string;
33
+ }
34
+ export type EffectSchemaFirstSection = 'values' | 'interfaces' | 'modules' | 'aliases';
35
+ export interface EffectSchemaFirstDerived {
36
+ first?: boolean;
37
+ sorted?: boolean;
38
+ }
39
+ export interface EffectSchemaFirstOptions {
40
+ member?: string;
41
+ keep?: OptionsPattern;
42
+ runtime?: string[];
43
+ rows?: EffectSchemaFirstRows;
44
+ order?: (EffectSchemaFirstSection | EffectSchemaFirstSection[])[];
45
+ derived?: EffectSchemaFirstDerived;
46
+ }
@@ -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, 'stem' | 'roles' | 'separators'> {
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;
@@ -1,4 +1,6 @@
1
1
  import type { OptionsPattern } from './options.types.ts';
2
+ import type * as EffectTsgo from '@effect/tsgo/oxlint-presets';
3
+ import type * as EffectLinteffect from '@opsydyn/oxlint-effect';
2
4
  import type { OxlintConfig, OxlintOverride } from 'oxlint';
3
5
  export type PresetLevel = 'error' | 'warn';
4
6
  export type PresetSwitch = boolean | 'warn';
@@ -8,7 +10,7 @@ export interface PresetLayoutOptions {
8
10
  services?: PresetLayoutMode | false;
9
11
  hooks?: PresetLayoutMode | false;
10
12
  components?: PresetLayoutMode | false;
11
- suffixes?: string[];
13
+ files?: string[];
12
14
  strict?: boolean;
13
15
  operations?: PresetOperations;
14
16
  service?: string[];
@@ -104,30 +106,29 @@ export interface PresetRegistryOptions {
104
106
  export interface PresetBackendOptions {
105
107
  exports?: string[];
106
108
  registry?: false | string | PresetRegistryOptions;
107
- writes?: string[];
108
109
  }
109
110
  export interface PresetDenyOptions {
110
111
  imports?: Record<string, string | false>;
111
112
  calls?: Record<string, string | false>;
112
113
  }
113
- export interface PresetExternalsOptions {
114
- packages?: string[];
115
- }
116
114
  export interface PresetOrpcOptions {
117
115
  public?: string[];
118
- composers?: string[];
119
116
  client?: string;
120
117
  }
121
- export interface PresetFormsOptions {
122
- resolver?: string;
123
- }
124
118
  export interface PresetEffectOptions {
119
+ code?: boolean;
125
120
  width?: number;
126
121
  exports?: OptionsPattern;
127
122
  skip?: OptionsPattern;
123
+ entries?: string[];
124
+ }
125
+ export interface PresetEffectStyle {
126
+ rules: PresetRules;
127
+ jsPlugins: PresetJsPlugins;
128
128
  }
129
- export interface PresetSqlOptions {
130
- sanitizers?: string[];
129
+ export interface PresetEffectPackages {
130
+ tsgo: typeof EffectTsgo;
131
+ linteffect: typeof EffectLinteffect;
131
132
  }
132
133
  export interface PresetGroups {
133
134
  layout?: PresetSwitch | PresetLayoutOptions;
@@ -149,12 +150,12 @@ export interface PresetGroups {
149
150
  backend?: PresetSwitch | PresetBackendOptions;
150
151
  orpc?: PresetSwitch | PresetOrpcOptions;
151
152
  schemas?: PresetSwitch;
152
- forms?: PresetSwitch | PresetFormsOptions;
153
- sql?: PresetSwitch | PresetSqlOptions;
153
+ forms?: PresetSwitch;
154
+ sql?: PresetSwitch;
154
155
  effect?: PresetSwitch | PresetEffectOptions;
155
156
  console?: boolean;
156
157
  deny?: PresetSwitch | PresetDenyOptions;
157
- externals?: PresetSwitch | PresetExternalsOptions;
158
+ externals?: PresetSwitch;
158
159
  }
159
160
  export type PresetGroupName = keyof PresetGroups;
160
161
  export interface PresetFolder extends PresetGroups {
@@ -164,17 +165,19 @@ export interface PresetFolder extends PresetGroups {
164
165
  rules?: PresetRules;
165
166
  }
166
167
  export type PresetFolders = Record<string, boolean | PresetFolder>;
168
+ export type PresetEntry = [string, boolean | PresetFolder];
167
169
  export interface PresetConfig {
168
170
  root?: string;
169
171
  folders?: PresetFolders;
170
172
  detect?: boolean;
171
173
  }
172
- export type PresetRecipe = PresetGroups;
174
+ export type PresetRecipe = PresetGroups & Partial<Record<symbol, string>>;
173
175
  export type PresetRules = NonNullable<OxlintConfig['rules']>;
174
176
  export type PresetJsPlugins = NonNullable<OxlintConfig['jsPlugins']>;
177
+ export type PresetPlugins = NonNullable<OxlintConfig['plugins']>;
175
178
  export type PresetSettings = NonNullable<OxlintConfig['settings']>;
176
179
  export interface PresetResolvedGroups {
177
- layout: PresetLayoutOptions & Required<Pick<PresetLayoutOptions, 'suffixes' | 'strict' | 'operations' | 'service'>>;
180
+ layout: PresetLayoutOptions & Required<Pick<PresetLayoutOptions, 'files' | 'strict' | 'operations' | 'service'>>;
178
181
  limits: Required<PresetLimitsOptions>;
179
182
  style: Required<PresetStyleOptions>;
180
183
  basics: Required<PresetBasicsOptions>;
@@ -192,20 +195,22 @@ export interface PresetResolvedGroups {
192
195
  };
193
196
  shadcn: Required<PresetShadcnOptions>;
194
197
  kit: PresetEmptyOptions;
195
- backend: PresetBackendOptions & Required<Pick<PresetBackendOptions, 'writes'>>;
198
+ backend: PresetBackendOptions;
196
199
  orpc: PresetOrpcOptions;
197
200
  schemas: PresetEmptyOptions;
198
- forms: Required<PresetFormsOptions>;
199
- sql: Required<PresetSqlOptions>;
201
+ forms: PresetEmptyOptions;
202
+ sql: PresetEmptyOptions;
200
203
  effect: Pick<PresetEffectOptions, 'exports' | 'skip'> & {
204
+ code: boolean;
201
205
  width: number;
206
+ entries: string[];
202
207
  };
203
208
  console: PresetEmptyOptions;
204
209
  deny: {
205
- imports: Record<string, string>;
206
- calls: Record<string, string>;
210
+ imports: Record<string, string | false>;
211
+ calls: Record<string, string | false>;
207
212
  };
208
- externals: Required<PresetExternalsOptions>;
213
+ externals: PresetEmptyOptions;
209
214
  }
210
215
  export interface PresetEmptyOptions {
211
216
  empty?: never;
@@ -229,6 +234,11 @@ export interface PresetScope {
229
234
  folder: PresetFolder;
230
235
  effective: PresetEffective;
231
236
  }
237
+ export interface PresetFileKey {
238
+ pattern: string;
239
+ folder: PresetFolder;
240
+ scopes: PresetScope[];
241
+ }
232
242
  export interface PresetUnit {
233
243
  key: string;
234
244
  scope: PresetScope;
@@ -275,8 +285,9 @@ export interface PresetProject {
275
285
  root: string;
276
286
  serviceFolders: Record<string, string>;
277
287
  scopes: PresetScope[];
288
+ fileKeys: PresetFileKey[];
278
289
  units: PresetUnit[];
279
- suffixes: string[];
290
+ fileKinds: string[];
280
291
  colocated: string[];
281
292
  orpc: Required<PresetOrpcOptions>;
282
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;
@@ -10,6 +10,8 @@ export interface SchemasLocalOptions {
10
10
  calls?: string[];
11
11
  allow?: string[];
12
12
  patterns?: string[];
13
+ imports?: boolean;
14
+ values?: boolean;
13
15
  message?: string;
14
16
  importMessage?: string;
15
17
  constructionMessage?: 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 {
@@ -22,3 +26,7 @@ export interface TypesNamespaceImportOptions {
22
26
  max: number;
23
27
  names: Record<string, string>;
24
28
  }
29
+ export interface TypesDuplicateOptions {
30
+ structs?: string[];
31
+ min?: number;
32
+ }
@@ -0,0 +1,5 @@
1
+ import type { ESTree } from '@oxlint/plugins';
2
+ export declare const effectBuilders: string[];
3
+ export declare function effectIsBuilder(node: ESTree.Expression | null | undefined, builders: ReadonlySet<string>): node is ESTree.CallExpression;
4
+ export declare function effectGenerator(node: ESTree.Expression | null | undefined, builders: ReadonlySet<string>): ESTree.Function | undefined;
5
+ export declare function effectMatches(node: ESTree.Expression | ESTree.Super | null | undefined, patterns: RegExp[]): boolean;
@@ -1,3 +1,6 @@
1
+ import { createRequire } from "node:module";
2
+ var __require = /* @__PURE__ */ createRequire(import.meta.url);
3
+
1
4
  // src/vendor/dillon-anti-slop/index.ts
2
5
  import { eslintCompatPlugin } from "@oxlint/plugins";
3
6
 
@@ -136,7 +139,7 @@ function optionsPatternsTest(patterns, value) {
136
139
  function optionsGlob(pattern) {
137
140
  const negated = [];
138
141
  const source = pattern.replaceAll(/!\(([^()]*)\)/g, (_, options) => {
139
- negated.push(options.split("|").map((option) => option.replaceAll(/[.+^$()|[\]\\*?{}]/g, "\\$&")).join("|"));
142
+ negated.push(options.split("|").map((option) => option.replaceAll(/[.+^$()|[\]\\?{}]/g, "\\$&").replaceAll("*", "[^/]*")).join("|"));
140
143
  return `\x02${negated.length - 1}\x03`;
141
144
  }).replaceAll(/[.+^$()|[\]\\]/g, "\\$&").replaceAll("?", "[^/]").replaceAll("**/", "\x00").replaceAll("**", "\x01").replaceAll("*", "[^/]*").replaceAll("\x00", "(?:.*/)?").replaceAll("\x01", ".*").replaceAll(/\{([^}]*)\}/g, (_, options) => `(?:${options.split(",").join("|")})`);
142
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.12.5",
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",
@@ -54,20 +54,29 @@
54
54
  "oxlint-plugin-eslint": "1.89.0"
55
55
  },
56
56
  "peerDependencies": {
57
+ "@effect/tsgo": ">=0.67.1",
58
+ "@opsydyn/oxlint-effect": ">=2.0.1",
57
59
  "@shadcn/lint": ">=0.2.3",
60
+ "eslint-plugin-de-morgan": ">=2.3.0",
58
61
  "eslint-plugin-react": ">=7.37.5",
59
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",
60
65
  "eslint-plugin-svg-jsx": ">=1.3.0",
61
66
  "oxlint": ">=1.85.0",
62
67
  "oxlint-tailwindcss": ">=1.16.0",
63
68
  "oxlint-tsgolint": ">=7.0.2003"
64
69
  },
65
70
  "devDependencies": {
71
+ "@effect/tsgo": "0.67.1",
72
+ "@opsydyn/oxlint-effect": "2.0.1",
66
73
  "@shadcn/lint": "0.2.3",
67
74
  "@types/node": "26.6.5",
68
75
  "bumpp": "12.3.0",
76
+ "eslint-plugin-de-morgan": "2.3.0",
69
77
  "eslint-plugin-react": "7.37.5",
70
78
  "eslint-plugin-react-you-might-not-need-an-effect": "1.0.2",
79
+ "eslint-plugin-regexp": "3.3.3",
71
80
  "eslint-plugin-svg-jsx": "1.3.0",
72
81
  "fallow": "3.36.0",
73
82
  "oxlint": "1.89.0",
@@ -98,15 +107,30 @@
98
107
  "plugin"
99
108
  ],
100
109
  "peerDependenciesMeta": {
110
+ "@effect/tsgo": {
111
+ "optional": true
112
+ },
113
+ "@opsydyn/oxlint-effect": {
114
+ "optional": true
115
+ },
101
116
  "@shadcn/lint": {
102
117
  "optional": true
103
118
  },
119
+ "eslint-plugin-de-morgan": {
120
+ "optional": true
121
+ },
104
122
  "eslint-plugin-react": {
105
123
  "optional": true
106
124
  },
107
125
  "eslint-plugin-react-you-might-not-need-an-effect": {
108
126
  "optional": true
109
127
  },
128
+ "eslint-plugin-regexp": {
129
+ "optional": true
130
+ },
131
+ "eslint-plugin-sonarjs": {
132
+ "optional": true
133
+ },
110
134
  "eslint-plugin-svg-jsx": {
111
135
  "optional": true
112
136
  },