@longzai-intelligence-oxlint/presets 0.2.10 → 0.2.11

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/dist/base.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
2
- import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-CejDIGVV.js";
1
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
2
+ import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-DB5ATUd4.js";
3
3
  export { type OxlintConfig, type OxlintConfigOverride, oxlintBaseConfig as default, defineConfig };
@@ -1,7 +1,6 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/entries/base.entry.d.ts
2
+ import { t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * 创建 Oxlint Base 配置
7
6
  *
@@ -13,5 +12,4 @@ declare function defineConfig(options?: PresetOptions): OxlintConfig;
13
12
  * 默认 Oxlint Base 配置实例
14
13
  */
15
14
  declare const oxlintBaseConfig: OxlintConfig;
16
- //#endregion
17
15
  export { oxlintBaseConfig as n, defineConfig as t };
@@ -1,7 +1,6 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/entries/electron.entry.d.ts
2
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * 创建 Oxlint Electron 配置
7
6
  *
@@ -13,5 +12,4 @@ declare function defineConfig(options?: PresetOptions): OxlintConfig;
13
12
  * 默认 Oxlint Electron 配置实例
14
13
  */
15
14
  declare const oxlintElectronConfig: OxlintConfig;
16
- //#endregion
17
15
  export { type OxlintConfig, type OxlintConfigOverride, oxlintElectronConfig as default, defineConfig };
package/dist/elysia.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/entries/elysia.entry.d.ts
2
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * 创建 Oxlint Elysia 配置
7
6
  *
@@ -13,5 +12,4 @@ declare function defineConfig(options?: PresetOptions): OxlintConfig;
13
12
  * 默认 Oxlint Elysia 配置实例
14
13
  */
15
14
  declare const oxlintElysiaConfig: OxlintConfig;
16
- //#endregion
17
15
  export { type OxlintConfig, type OxlintConfigOverride, oxlintElysiaConfig as default, defineConfig };
package/dist/expo.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-CejDIGVV.js";
2
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-DB5ATUd4.js";
4
4
  export { type OxlintConfig, type OxlintConfigOverride, oxlintBaseConfig as default, defineConfig };
@@ -1,3 +1,3 @@
1
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
2
- import { i as FUMADOCS_SPECIAL_FILE_PATTERNS, n as oxFumadocsConfig, r as FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS, t as defineConfig } from "./fumadocs.entry-C7QzCdVJ.js";
1
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
2
+ import { i as FUMADOCS_SPECIAL_FILE_PATTERNS, n as oxFumadocsConfig, r as FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS, t as defineConfig } from "./fumadocs.entry-DI6V68LH.js";
3
3
  export { FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS, FUMADOCS_SPECIAL_FILE_PATTERNS, type OxlintConfig, type OxlintConfigOverride, oxFumadocsConfig as default, defineConfig };
@@ -1,7 +1,6 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/defaults/fumadocs.patterns.d.ts
2
+ import { t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * fumadocs 预设 - 文档站底座约定文件模式
7
6
  *
@@ -27,8 +26,6 @@ declare const FUMADOCS_SPECIAL_FILE_PATTERNS: string[];
27
26
  * 口径仅限底座约定文件,不随消费方自定义命名扩面
28
27
  */
29
28
  declare const FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS: string[];
30
- //#endregion
31
- //#region src/entries/fumadocs.entry.d.ts
32
29
  /**
33
30
  * fumadocs 预设选项
34
31
  *
@@ -57,5 +54,4 @@ declare function defineConfig(options?: FumadocsPresetOptions): OxlintConfig;
57
54
  * 默认 Oxlint fumadocs 配置实例
58
55
  */
59
56
  declare const oxFumadocsConfig: OxlintConfig;
60
- //#endregion
61
57
  export { FUMADOCS_SPECIAL_FILE_PATTERNS as i, oxFumadocsConfig as n, FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS as r, defineConfig as t };
package/dist/hono.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-CejDIGVV.js";
2
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-DB5ATUd4.js";
4
4
  export { type OxlintConfig, type OxlintConfigOverride, oxlintBaseConfig as default, defineConfig };
@@ -1,4 +1,3 @@
1
- //#region ../core/dist/index.d.ts
2
1
  //#region src/types/config.types.d.ts
3
2
  /**
4
3
  * Oxlint 核心类型定义
@@ -64,5 +63,4 @@ type OxlintConfig = {
64
63
  */
65
64
  ignorePatterns?: string[];
66
65
  };
67
- //#endregion
68
66
  export { OxlintRules as i, OxlintConfigOverride as n, OxlintRuleConfig as r, OxlintConfig as t };
package/dist/index.d.ts CHANGED
@@ -1,17 +1,16 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { i as OxlintRules, n as OxlintConfigOverride, r as OxlintRuleConfig, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- import { t as defineConfig } from "./base.entry-CejDIGVV.js";
2
+ import { i as OxlintRules, n as OxlintConfigOverride, r as OxlintRuleConfig, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
4
+ import { t as defineConfig } from "./base.entry-DB5ATUd4.js";
5
5
  import { defineConfig as defineConfig$1 } from "./electron.js";
6
- import { i as FUMADOCS_SPECIAL_FILE_PATTERNS, r as FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS, t as defineConfig$2 } from "./fumadocs.entry-C7QzCdVJ.js";
6
+ import { i as FUMADOCS_SPECIAL_FILE_PATTERNS, r as FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS, t as defineConfig$2 } from "./fumadocs.entry-DI6V68LH.js";
7
7
  import { defineConfig as defineConfig$3 } from "./library.js";
8
8
  import { defineConfig as defineConfig$4 } from "./nest.js";
9
- import { r as NEXTJS_SPECIAL_FILE_PATTERNS, t as defineConfig$5 } from "./next.entry-moZEmUkw.js";
9
+ import { r as NEXTJS_SPECIAL_FILE_PATTERNS, t as defineConfig$5 } from "./next.entry-flJkkYfV.js";
10
10
  import { defineConfig as defineConfig$6 } from "./react.js";
11
- import { r as ROOT_WHITELIST_PATTERNS, t as defineConfig$7 } from "./root.entry-D3HRGFNj.js";
12
- import { t as defineConfig$8 } from "./taro.entry-DuohnWen.js";
13
- import { a as ESLINT_CORE_RULES, i as TYPESCRIPT_RECOMMENDED_RULES, n as ESLINT_RECOMMENDED_RULES, r as TYPESCRIPT_PROJECT_RULES, t as UNICORN_RULES } from "./unicorn.rules-CoZq5SQL.js";
14
- //#region src/defaults/base.rules.d.ts
11
+ import { r as ROOT_WHITELIST_PATTERNS, t as defineConfig$7 } from "./root.entry-DW6F5jjU.js";
12
+ import { t as defineConfig$8 } from "./taro.entry-DQK7ypZY.js";
13
+ import { a as ESLINT_CORE_RULES, i as TYPESCRIPT_RECOMMENDED_RULES, n as ESLINT_RECOMMENDED_RULES, r as TYPESCRIPT_PROJECT_RULES, t as UNICORN_RULES } from "./unicorn.rules-DgKAk9wi.js";
15
14
  /**
16
15
  * 合并后的插件推荐配置
17
16
  *
@@ -25,5 +24,4 @@ declare const PLUGIN_DEFAULTS: OxlintRules;
25
24
  * 生态层覆盖插件 recommended 的无选项形态,require-* 规则由此获得选项默认值
26
25
  */
27
26
  declare const ALL_RULES: OxlintRules;
28
- //#endregion
29
27
  export { ALL_RULES, ESLINT_CORE_RULES, ESLINT_RECOMMENDED_RULES, FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS, FUMADOCS_SPECIAL_FILE_PATTERNS, NEXTJS_SPECIAL_FILE_PATTERNS, type OxlintConfig, type OxlintConfigOverride, type OxlintRuleConfig, type OxlintRules, PLUGIN_DEFAULTS, type PresetOptions, ROOT_WHITELIST_PATTERNS, TYPESCRIPT_PROJECT_RULES, TYPESCRIPT_RECOMMENDED_RULES, UNICORN_RULES, defineConfig as defineBaseConfig, defineConfig as defineExpoConfig, defineConfig as defineHonoConfig, defineConfig as defineMcpConfig, defineConfig as defineNodeConfig, defineConfig$1 as defineElectronConfig, defineConfig$2 as defineFumadocsConfig, defineConfig$3 as defineLibraryConfig, defineConfig$4 as defineNestConfig, defineConfig$5 as defineNextConfig, defineConfig$6 as defineReactConfig, defineConfig$7 as defineRootConfig, defineConfig$8 as defineTaroConfig };
package/dist/library.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/entries/library.entry.d.ts
2
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * 创建 Oxlint Library 配置
7
6
  *
@@ -13,5 +12,4 @@ declare function defineConfig(options?: PresetOptions): OxlintConfig;
13
12
  * 默认 Oxlint Library 配置实例
14
13
  */
15
14
  declare const oxlintLibraryConfig: OxlintConfig;
16
- //#endregion
17
15
  export { type OxlintConfig, type OxlintConfigOverride, oxlintLibraryConfig as default, defineConfig };
package/dist/mcp.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-CejDIGVV.js";
2
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-DB5ATUd4.js";
4
4
  export { type OxlintConfig, type OxlintConfigOverride, oxlintBaseConfig as default, defineConfig };
package/dist/nest.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/entries/nest.entry.d.ts
2
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * 创建 Oxlint Nest 配置
7
6
  *
@@ -13,5 +12,4 @@ declare function defineConfig(options?: PresetOptions): OxlintConfig;
13
12
  * 默认 Oxlint Nest 配置实例
14
13
  */
15
14
  declare const oxlintNestConfig: OxlintConfig;
16
- //#endregion
17
15
  export { type OxlintConfig, type OxlintConfigOverride, oxlintNestConfig as default, defineConfig };
package/dist/next.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
2
- import { n as oxlintNextConfig, r as NEXTJS_SPECIAL_FILE_PATTERNS, t as defineConfig } from "./next.entry-moZEmUkw.js";
1
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
2
+ import { n as oxlintNextConfig, r as NEXTJS_SPECIAL_FILE_PATTERNS, t as defineConfig } from "./next.entry-flJkkYfV.js";
3
3
  export { NEXTJS_SPECIAL_FILE_PATTERNS, type OxlintConfig, type OxlintConfigOverride, oxlintNextConfig as default, defineConfig };
@@ -1,15 +1,12 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/defaults/next.patterns.d.ts
2
+ import { t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * Next.js App Router 约定文件模式全集
7
6
  *
8
7
  * 作为单一真源同时供两条规则注入,见文件头说明
9
8
  */
10
9
  declare const NEXTJS_SPECIAL_FILE_PATTERNS: string[];
11
- //#endregion
12
- //#region src/entries/next.entry.d.ts
13
10
  /**
14
11
  * Next 预设选项
15
12
  *
@@ -38,5 +35,4 @@ declare function defineConfig(options?: NextPresetOptions): OxlintConfig;
38
35
  * 默认 Oxlint Next 配置实例
39
36
  */
40
37
  declare const oxlintNextConfig: OxlintConfig;
41
- //#endregion
42
38
  export { oxlintNextConfig as n, NEXTJS_SPECIAL_FILE_PATTERNS as r, defineConfig as t };
package/dist/node.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-CejDIGVV.js";
2
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { n as oxlintBaseConfig, t as defineConfig } from "./base.entry-DB5ATUd4.js";
4
4
  export { type OxlintConfig, type OxlintConfigOverride, oxlintBaseConfig as default, defineConfig };
@@ -1 +1 @@
1
- import"../rolldown-runtime-BqT_7tdF.js";import"../rolldown-runtime-BqT_7tdF-BqT_7tdF.js";import{n as e,r as t,t as n}from"../dist-CskvMq7J.js";import{defineRule as r,eslintCompatPlugin as i}from"@oxlint/plugins";import{existsSync as a,readFileSync as ee}from"node:fs";import{dirname as o,join as te}from"node:path";import*as s from"zod/mini";function c(e){return e.endsWith(`Class`)}const l=r({meta:{type:`problem`,docs:{description:`禁止在 import 别名中使用 "Class" 后缀`}},createOnce(e){return{ImportSpecifier(t){let n=t.local.name,r=t.imported.type===`Identifier`?t.imported.name:n;n!==r&&c(n)&&e.report({node:t,message:`导入别名 "${n}" 使用了 "Class" 后缀,这是不允许的命名方式。请使用更具描述性的名称,或直接使用原始名称 "${r}"`})}}}}),u=/* @__PURE__ */ new Set([`console.log`,`console.warn`,`console.error`,`console.info`,`console.debug`,`console.trace`,`console.dir`,`console.table`]);function d(e){let t=e.callee;return t.type===`Identifier`?t.name:t.type===`MemberExpression`&&t.property.type===`Identifier`&&t.object.type===`Identifier`?`${t.object.name}.${t.property.name}`:null}const f=r({meta:{type:`problem`,docs:{description:`禁止使用 console 方法,必须使用 @longzai-intelligence/logger-preset-* 或 react-devtools(ADR 0038)`}},createOnce(e){return{CallExpression(t){if(t.type!==`CallExpression`)return;let n=d(t);n&&u.has(n)&&e.report({node:t,message:`检测到 '${n}' — 必须使用 @longzai-intelligence/logger-preset-* 代替(ADR 0038)`})}}}}),p=/\/src\/(index|main|cli)\.(ts|mts|cts)$/,m=/(^|\/)dist\//;function ne(e){return e.replace(/\\/g,`/`)}function h(e){return typeof e==`object`&&!!e}function re(e){return e.startsWith(`#!`)}function g(e){return p.test(ne(e))}function ie(e){let t=e;for(let e=0;e<4;e+=1){let e=te(t,`package.json`);if(a(e))try{let t=JSON.parse(ee(e,`utf8`));return h(t)?t:null}catch{return null}let n=o(t);if(n===t)break;t=n}return null}function ae(e){let t=e.bin;return(typeof t==`string`?[t]:h(t)?Object.values(t).filter(e=>typeof e==`string`):[]).some(e=>m.test(e.replace(/^\.\//,``)))}const oe={noHandwrittenShebang:`入口源码手写 shebang 属被裁定的错误方式,bin 产物首行 shebang 应由 "lzi-builder.config.ts" 的 banner 在构建期注入。请删除源码首行的 "#!" 行并补 banner 配置。`},_=r({meta:{type:`problem`,docs:{description:`禁止所属包 bin 指向 dist 产物的入口源码手写 shebang`}},createOnce(e){return{before(){let t=e.filename;if(!g(t))return!1},Program(t){let n=e.sourceCode.text;if(!re(n))return;let r=ie(o(o(e.filename)));r!==null&&ae(r)&&e.report({node:t,message:oe.noHandwrittenShebang})}}}}),v=s.object({type:s.literal(`TSTypeLiteral`)}),y=s.object({type:s.literal(`TSFunctionType`)}),b=s.object({type:s.literal(`TSUnionType`),types:s.array(s.unknown())}),se=s.object({type:s.literal(`TSIntersectionType`),types:s.array(s.unknown())}),ce=s.object({type:s.literal(`Identifier`),name:s.string()}),le=s.object({type:s.literal(`RestElement`),argument:s.object({name:s.string()})}),ue=s.union([ce,le]),x=s.object({typeAnnotation:s.unknown()}),de=s.object({type:s.literal(`MethodDefinition`),key:s.object({type:s.string(),name:s.optional(s.string())}),value:s.object({params:s.optional(s.array(s.unknown())),returnType:s.optional(s.union([x,s.null()]))}),kind:s.enum([`method`,`constructor`,`get`,`set`])}),fe=s.object({returnType:x}),pe=s.object({id:s.optional(s.object({name:s.optional(s.string())})),params:s.optional(s.array(s.unknown())),returnType:s.optional(s.unknown())}),me=s.object({params:s.optional(s.array(s.unknown()))});function S(e){return v.safeParse(e).success}function C(e){return y.safeParse(e).success}function w(e){return b.safeParse(e).success}function T(e){return se.safeParse(e).success}function E(e){return ue.safeParse(e).success}function D(e){if(typeof e!=`object`||!e||!(`type`in e))return!1;let t=[`FunctionDeclaration`,`FunctionExpression`,`ArrowFunctionExpression`,`MethodDefinition`],n=e.type;return typeof n==`string`&&t.includes(n)}function O(e){return de.safeParse(e).success}function k(e){return fe.safeParse(e).success}function A(e){return pe.safeParse(e).success}function j(e){return me.safeParse(e).success}function M(e){return S(e)||C(e)?!0:w(e)||T(e)?e.types.some(M):!1}function N(e){return S(e)?`对象类型`:C(e)?`函数类型`:`内联类型`}function P(e){return E(e)?e.type===`Identifier`?e.name:e.type===`RestElement`?e.argument.name:null:null}function F(e,t,n,r,i,a){i?e.report({node:t,message:`参数 "${n}" 使用了内联${r}定义。请将其提取为具名的 type。`}):a?e.report({node:t,message:`方法 "${a}" 的参数 "${n}" 使用了内联${r}定义。请将其提取为具名的 type。`}):e.report({node:t,message:`参数 "${n}" 使用了内联${r}定义。请将其提取为具名的 type。`})}function I(e,t,n,r,i){i?e.report({node:t,message:`方法 "${i}" 的返回值使用了内联${n}定义。请将其提取为具名的 type。`}):r?e.report({node:t,message:`函数 "${r}" 的返回值使用了内联${n}定义。请将其提取为具名的 type。`}):e.report({node:t,message:`匿名函数的返回值使用了内联${n}定义。请将其提取为具名的 type。`})}function L(e,t,n,r,i){if(typeof e!=`object`||!e||!(`typeAnnotation`in e)||e.typeAnnotation===null||typeof e.typeAnnotation!=`object`||!(`typeAnnotation`in e.typeAnnotation))return;let a=e.typeAnnotation.typeAnnotation;M(a)&&F(t,n,P(e)??`未知参数`,N(a),r,i)}function R(e,t,n,r,i){for(let a of e)L(a,t,n,i??!1,r)}function z(e,t,n,r,i){if(typeof e!=`object`||!e||!(`typeAnnotation`in e))return;let a=e.typeAnnotation;M(a)&&I(t,n,N(a),r,i)}function B(e,t){if(!D(e)||!A(e))return;let n=null;`id`in e&&e.id!==null&&typeof e.id==`object`&&`name`in e.id&&typeof e.id.name==`string`&&(n=e.id.name),j(e)&&R(e.params??[],t,e),k(e)&&z(e.returnType,t,e,n??void 0)}function he(e,t){D(e)&&j(e)&&(j(e)&&R(e.params??[],t,e),k(e)&&z(e.returnType,t,e))}function ge(e,t){if(!O(e))return;let n=e.key,r=n&&`name`in n&&typeof n.name==`string`?n.name:`未知方法`,i=e.value;if(i&&`params`in i&&Array.isArray(i.params)&&R(i.params,t,e,r,e.kind===`constructor`),i&&`returnType`in i&&i.returnType&&typeof i.returnType==`object`&&`typeAnnotation`in i.returnType){let n=i.returnType;z(n,t,e,void 0,r)}}const V=r({meta:{type:`suggestion`,docs:{description:`禁止在函数参数和返回值中使用内联类型定义,强制使用具名类型`}},createOnce(e){return{FunctionDeclaration(t){B(t,e)},FunctionExpression(t){B(t,e)},ArrowFunctionExpression(t){he(t,e)},MethodDefinition(t){ge(t,e)}}}}),H=/^(?:eslint-disable(?:-next-line|-line)?|eslint-enable|oxlint-disable(?:-next-line|-line)?|oxlint-enable|biome-ignore|stylelint-disable(?:-next-line|-line)?|stylelint-enable|@ts-ignore|@ts-nocheck)(?=[\s,]|$)/;function _e(e){let t=e.trimStart();return H.exec(t)?.[0]??null}const U=r({meta:{type:`problem`,docs:{description:`禁止 eslint-disable、oxlint-disable、biome-ignore、stylelint-disable、@ts-ignore、@ts-nocheck 等抑制注释`}},createOnce(e){return{Program(){let t=e.sourceCode.getAllComments();for(let n of t){if(n.type===`Shebang`)continue;let t=_e(n.value);t!==null&&e.report({node:n,message:`检测到抑制指令 ${t},抑制注释不是合法豁免手段,请从源头消除违例或在包级 oxlint.config.ts 的 ignorePatterns 登记路径豁免`})}}}}});function ve(e){let t=[];if(e.type===`Identifier`&&t.push(e.name),e.type===`ObjectPattern`)for(let n of e.properties)n.type===`Property`&&`value`in n?n.value.type===`Identifier`&&t.push(n.value.name):n.type===`RestElement`&&n.argument.type===`Identifier`&&t.push(n.argument.name);if(e.type===`ArrayPattern`)for(let n of e.elements)n&&n.type===`Identifier`&&t.push(n.name);return t}const W=r({meta:{type:`suggestion`,docs:{description:`将 export const/let/var 拆分为独立的声明和导出语句`}},createOnce(e){return{ExportNamedDeclaration(t){if(!t.declaration||t.declaration.type!==`VariableDeclaration`)return;let n=t.declaration;if(n.kind!==`const`&&n.kind!==`let`&&n.kind!==`var`||n.declarations.length===0)return;let r=[];for(let e of n.declarations)r.push(...ve(e.id));r.length!==0&&e.report({node:t,message:`应将 \`export ${n.kind} ${r.join(`, `)}\` 拆分为独立的声明和导出语句`})}}}}),G=[{suffix:`.service.drizzle.ts`,classSuffix:`Service`,isInterface:!1,isPrefix:!1},{suffix:`.service.memory.ts`,classSuffix:`Service`,isInterface:!1,isPrefix:!1},{suffix:`.service.ts`,classSuffix:`Service`,isInterface:!1,isPrefix:!1},{suffix:`.controller.ts`,classSuffix:`Controller`,isInterface:!1,isPrefix:!1},{suffix:`.module.ts`,classSuffix:`Module`,isInterface:!1,isPrefix:!1},{suffix:`.repository.drizzle.ts`,classSuffix:`Repository`,isInterface:!1,isPrefix:!1},{suffix:`.repository.memory.ts`,classSuffix:`Repository`,isInterface:!1,isPrefix:!1},{suffix:`.repository.interface.ts`,classSuffix:`Repository`,isInterface:!0,isPrefix:!0},{suffix:`.repository.ts`,classSuffix:`Repository`,isInterface:!1,isPrefix:!1},{suffix:`.entity.ts`,classSuffix:`Entity`,isInterface:!1,isPrefix:!1},{suffix:`.orm-entity.ts`,classSuffix:`OrmEntity`,isInterface:!1,isPrefix:!1},{suffix:`.dto.ts`,classSuffix:`DTO`,isInterface:!1,isPrefix:!1},{suffix:`.port.interface.ts`,classSuffix:`Port`,isInterface:!0,isPrefix:!0},{suffix:`.interface.ts`,classSuffix:``,isInterface:!0,isPrefix:!0},{suffix:`.port.ts`,classSuffix:`Port`,isInterface:!0,isPrefix:!1},{suffix:`.port.adapter.ts`,classSuffix:`PortAdapter`,isInterface:!1,isPrefix:!1},{suffix:`.adapter.ts`,classSuffix:`Adapter`,isInterface:!1,isPrefix:!1},{suffix:`.events.ts`,classSuffix:`Event`,isInterface:!1,isPrefix:!1},{suffix:`.mapper.ts`,classSuffix:`Mapper`,isInterface:!1,isPrefix:!1},{suffix:`.vo.ts`,classSuffix:`VO`,isInterface:!1,isPrefix:!1},{suffix:`.usecase.ts`,classSuffix:`UseCase`,isInterface:!1,isPrefix:!1},{suffix:`.errors.ts`,classSuffix:`Error`,isInterface:!1,isPrefix:!1}];function K(e){for(let t of G)if(e.endsWith(t.suffix))return t;return null}function q(e,t){if(t.isPrefix&&t.isInterface){if(t.classSuffix){let n=t.classSuffix;return e.startsWith(`I`)&&e.endsWith(n)&&e.length>1+n.length}return e.startsWith(`I`)&&e.length>1}return t.isPrefix?e.startsWith(`I`)&&e.length>1:e.endsWith(t.classSuffix)&&e.length>t.classSuffix.length}function J(e){return e.isPrefix&&e.isInterface?e.classSuffix?`I${e.classSuffix}(如 IUser${e.classSuffix})`:`I 前缀(如 IUser)`:e.isPrefix?`I 前缀(如 IUser)`:`${e.classSuffix} 后缀`}const Y=r({meta:{type:`problem`,docs:{description:`强制执行类名与文件类型后缀的一致性`}},createOnce(e){return{before(){let t=e.filename.replace(/\\/g,`/`).split(`/`).pop()??``;if(t.endsWith(`.test.ts`)||t.endsWith(`.spec.ts`)||!K(t))return!1},ClassDeclaration(t){let n=e.filename.replace(/\\/g,`/`).split(`/`).pop()??``,r=K(n);if(!r||r.isInterface||!t.id)return;let i=t.id.name;q(i,r)||e.report({node:t,message:`类名 "${i}" 不符合命名规范。文件 "${n}" 中的类应使用 ${J(r)}`})},TSInterfaceDeclaration(t){let n=e.filename.replace(/\\/g,`/`).split(`/`).pop()??``,r=K(n);if(!r||!r.isInterface)return;let i=t.id.name;q(i,r)||e.report({node:t,message:`接口名 "${i}" 不符合命名规范。文件 "${n}" 中的接口应使用 ${J(r)}`})}}}});function X(e){return e.endsWith(`.dto.ts`)}function ye(e){return e.endsWith(`DTO`)}const Z=r({meta:{type:`problem`,docs:{description:`强制执行 DTO 文件中的接口命名规范(Dto 后缀,驼峰式)`}},createOnce(e){return{before(){let t=e.filename.replace(/\\/g,`/`).split(`/`).pop()??``;if(t.endsWith(`.test.ts`)||t.endsWith(`.spec.ts`)||!X(t))return!1},TSInterfaceDeclaration(n){let r=n.id.name;ye(r)?e.report({node:n,message:`接口名 "${r}" 后缀应使用 Dto(驼峰式)而非 DTO(全大写)`}):t(r)||e.report({node:n,message:`DTO 文件中的接口名 "${r}" 应以 Dto 结尾(如 UserResponseDto)`})}}}}),be=[`types.ts`,`types.d.ts`],xe=[`.port.interface.ts`,`.repository.interface.ts`,`.types.ts`,`.types.d.ts`,`.events.ts`,`.d.ts`];function Se(t,r){return e(t)?!1:!r.endsWith(`.dto.ts`)||n(t)}function Ce(e){return e.endsWith(`.dto.ts`)?`DTO 后缀(如 UserDTO),禁止 I 前缀`:`PascalCase(如 User、UserRepository),禁止 I 前缀`}function we(e){if(be.includes(e))return!0;for(let t of xe)if(e.endsWith(t))return!0;return!1}function Te(e){return e.endsWith(`.port.ts`)?e.replace(`.port.ts`,`.port.interface.ts`):e.endsWith(`.repository.ts`)?e.replace(`.repository.ts`,`.repository.interface.ts`):e.replace(`.ts`,`.interface.ts`)}const Q=r({meta:{type:`problem`,docs:{description:`强制执行接口命名规范(禁止 I 前缀,使用 PascalCase)和文件命名规范`}},createOnce(t){return{before(){let e=t.filename.replace(/\\/g,`/`).split(`/`).pop()??``;if(e.endsWith(`.test.ts`)||e.endsWith(`.spec.ts`)||we(e))return!1},TSInterfaceDeclaration(n){let r=t.filename.replace(/\\/g,`/`).split(`/`).pop()??``,i=r.endsWith(`.interface.ts`)||r.endsWith(`.interface.tsx`),a=n.id.name;Se(a,r)||(e(a)?t.report({node:n,message:`接口名 "${a}" 使用了 I 前缀。现代 TypeScript 不推荐使用匈牙利命名法,建议使用 "${a.substring(1)}"`}):r.endsWith(`.dto.ts`)&&a.endsWith(`Dto`)?t.report({node:n,message:`接口名 "${a}" 后缀应使用 DTO(全大写)而非 Dto(驼峰式)`}):t.report({node:n,message:`接口名 "${a}" 不符合命名规范。接口名应使用 ${Ce(r)}`})),!i&&!r.endsWith(`.dto.ts`)&&!r.endsWith(`.tsx`)&&t.report({node:n,message:`包含接口 "${a}" 的文件 "${r}" 应命名为 "${Te(r)}"`})}}}}),$=i({meta:{name:`@longzai-intelligence-oxlint/code-style-plugin`},rules:{"no-console":f,"no-inline-type-definition":V,"prefer-split-export-const":W,"require-interface-naming":Q,"require-dto-naming":Z,"require-class-suffix":Y,"no-class-suffix-alias":l,"no-handwritten-shebang":_,"no-lint-suppression":U}});export{G as SUFFIX_MAPPINGS,$ as codeStylePlugin,$ as default,N as getInlineTypeDescription,P as getParamName,e as hasIPrefix,M as hasInlineType,X as isDtoFile,D as isFunctionNode,O as isMethodDefinition,C as isTSFunctionType,T as isTSIntersectionType,S as isTSTypeLiteral,w as isTSUnionType,l as noClassSuffixAliasRule,f as noConsoleRule,_ as noHandwrittenShebangRule,V as noInlineTypeDefinitionRule,U as noLintSuppressionRule,W as preferSplitExportConstRule,Y as requireClassSuffixRule,Z as requireDtoNamingRule,Q as requireInterfaceNamingRule};
1
+ import"../rolldown-runtime-BqT_7tdF.js";import"../rolldown-runtime-BqT_7tdF-BqT_7tdF.js";import{n as e,r as t,t as n}from"../dist-CskvMq7J.js";import{defineRule as r,eslintCompatPlugin as i}from"@oxlint/plugins";import{existsSync as a,readFileSync as ee}from"node:fs";import{dirname as o,join as te}from"node:path";import*as s from"zod/mini";function c(e){return e.endsWith(`Class`)}const l=r({meta:{type:`problem`,docs:{description:`禁止在 import 别名中使用 "Class" 后缀`}},createOnce(e){return{ImportSpecifier(t){let n=t.local.name,r=t.imported.type===`Identifier`?t.imported.name:n;n!==r&&c(n)&&e.report({node:t,message:`导入别名 "${n}" 使用了 "Class" 后缀,这是不允许的命名方式。请使用更具描述性的名称,或直接使用原始名称 "${r}"`})}}}}),u=/* @__PURE__ */ new Set([`console.log`,`console.warn`,`console.error`,`console.info`,`console.debug`,`console.trace`,`console.dir`,`console.table`]);function d(e){let t=e.callee;return t.type===`Identifier`?t.name:t.type===`MemberExpression`&&t.property.type===`Identifier`&&t.object.type===`Identifier`?`${t.object.name}.${t.property.name}`:null}const f=r({meta:{type:`problem`,docs:{description:`禁止使用 console 方法,必须使用 @longzai-intelligence/logger-preset-* 或 react-devtools(ADR 0038)`}},createOnce(e){return{CallExpression(t){if(t.type!==`CallExpression`)return;let n=d(t);n&&u.has(n)&&e.report({node:t,message:`检测到 '${n}' — 必须使用 @longzai-intelligence/logger-preset-* 代替(ADR 0038)`})}}}}),p=/\/src\/(index|main|cli)\.(ts|mts|cts)$/,m=/(^|\/)dist\//;function ne(e){return e.replace(/\\/g,`/`)}function h(e){return typeof e==`object`&&!!e}function re(e){return e.startsWith(`#!`)}function g(e){return p.test(ne(e))}function ie(e){let t=e;for(let e=0;e<4;e+=1){let e=te(t,`package.json`);if(a(e))try{let t=JSON.parse(ee(e,`utf8`));return h(t)?t:null}catch{return null}let n=o(t);if(n===t)break;t=n}return null}function ae(e){let t=e.bin;return(typeof t==`string`?[t]:h(t)?Object.values(t).filter(e=>typeof e==`string`):[]).some(e=>m.test(e.replace(/^\.\//,``)))}const oe={noHandwrittenShebang:`入口源码手写 shebang 属被裁定的错误方式,bin 产物首行 shebang 应由 "lzi-builder.config.ts" 的 banner 在构建期注入。请删除源码首行的 "#!" 行并补 banner 配置。`},_=r({meta:{type:`problem`,docs:{description:`禁止所属包 bin 指向 dist 产物的入口源码手写 shebang`}},createOnce(e){return{before(){let t=e.filename;if(!g(t))return!1},Program(t){let n=e.sourceCode.text;if(!re(n))return;let r=ie(o(o(e.filename)));r!==null&&ae(r)&&e.report({node:t,message:oe.noHandwrittenShebang})}}}}),v=s.object({type:s.literal(`TSTypeLiteral`)}),y=s.object({type:s.literal(`TSFunctionType`)}),b=s.object({type:s.literal(`TSUnionType`),types:s.array(s.unknown())}),se=s.object({type:s.literal(`TSIntersectionType`),types:s.array(s.unknown())}),ce=s.object({type:s.literal(`Identifier`),name:s.string()}),le=s.object({type:s.literal(`RestElement`),argument:s.object({name:s.string()})}),ue=s.union([ce,le]),x=s.object({typeAnnotation:s.unknown()}),de=s.object({type:s.literal(`MethodDefinition`),key:s.object({type:s.string(),name:s.optional(s.string())}),value:s.object({params:s.optional(s.array(s.unknown())),returnType:s.optional(s.union([x,s.null()]))}),kind:s.enum([`method`,`constructor`,`get`,`set`])}),fe=s.object({returnType:x}),pe=s.object({id:s.optional(s.object({name:s.optional(s.string())})),params:s.optional(s.array(s.unknown())),returnType:s.optional(s.unknown())}),me=s.object({params:s.optional(s.array(s.unknown()))});function S(e){return v.safeParse(e).success}function C(e){return y.safeParse(e).success}function w(e){return b.safeParse(e).success}function T(e){return se.safeParse(e).success}function E(e){return ue.safeParse(e).success}function D(e){if(typeof e!=`object`||!e||!(`type`in e))return!1;let t=[`FunctionDeclaration`,`FunctionExpression`,`ArrowFunctionExpression`,`MethodDefinition`],n=e.type;return typeof n==`string`&&t.includes(n)}function O(e){return de.safeParse(e).success}function k(e){return fe.safeParse(e).success}function A(e){return pe.safeParse(e).success}function j(e){return me.safeParse(e).success}function M(e){return S(e)||C(e)?!0:w(e)||T(e)?e.types.some(M):!1}function N(e){return S(e)?`对象类型`:C(e)?`函数类型`:`内联类型`}function P(e){return E(e)?e.type===`Identifier`?e.name:e.type===`RestElement`?e.argument.name:null:null}function F(e,t,n,r,i,a){i?e.report({node:t,message:`参数 "${n}" 使用了内联${r}定义。请将其提取为具名的 type。`}):a?e.report({node:t,message:`方法 "${a}" 的参数 "${n}" 使用了内联${r}定义。请将其提取为具名的 type。`}):e.report({node:t,message:`参数 "${n}" 使用了内联${r}定义。请将其提取为具名的 type。`})}function I(e,t,n,r,i){i?e.report({node:t,message:`方法 "${i}" 的返回值使用了内联${n}定义。请将其提取为具名的 type。`}):r?e.report({node:t,message:`函数 "${r}" 的返回值使用了内联${n}定义。请将其提取为具名的 type。`}):e.report({node:t,message:`匿名函数的返回值使用了内联${n}定义。请将其提取为具名的 type。`})}function L(e,t,n,r,i){if(typeof e!=`object`||!e||!(`typeAnnotation`in e)||e.typeAnnotation===null||typeof e.typeAnnotation!=`object`||!(`typeAnnotation`in e.typeAnnotation))return;let a=e.typeAnnotation.typeAnnotation;M(a)&&F(t,n,P(e)??`未知参数`,N(a),r,i)}function R(e,t,n,r,i){for(let a of e)L(a,t,n,i??!1,r)}function z(e,t,n,r,i){if(typeof e!=`object`||!e||!(`typeAnnotation`in e))return;let a=e.typeAnnotation;M(a)&&I(t,n,N(a),r,i)}function B(e,t){if(!D(e)||!A(e))return;let n=null;`id`in e&&e.id!==null&&typeof e.id==`object`&&`name`in e.id&&typeof e.id.name==`string`&&(n=e.id.name),j(e)&&R(e.params??[],t,e),k(e)&&z(e.returnType,t,e,n??void 0)}function he(e,t){D(e)&&j(e)&&(j(e)&&R(e.params??[],t,e),k(e)&&z(e.returnType,t,e))}function ge(e,t){if(!O(e))return;let n=e.key,r=n&&`name`in n&&typeof n.name==`string`?n.name:`未知方法`,i=e.value;if(i&&`params`in i&&Array.isArray(i.params)&&R(i.params,t,e,r,e.kind===`constructor`),i&&`returnType`in i&&i.returnType&&typeof i.returnType==`object`&&`typeAnnotation`in i.returnType){let n=i.returnType;z(n,t,e,void 0,r)}}const V=r({meta:{type:`suggestion`,docs:{description:`禁止在函数参数和返回值中使用内联类型定义,强制使用具名类型`}},createOnce(e){return{FunctionDeclaration(t){B(t,e)},FunctionExpression(t){B(t,e)},ArrowFunctionExpression(t){he(t,e)},MethodDefinition(t){ge(t,e)}}}}),H=/^(?:eslint-disable(?:-next-line|-line)?|eslint-enable|oxlint-disable(?:-next-line|-line)?|oxlint-enable|biome-ignore|stylelint-disable(?:-next-line|-line)?|stylelint-enable|@ts-ignore|@ts-nocheck)(?=[\s,]|$)/;function _e(e){let t=e.trimStart();return H.exec(t)?.[0]??null}const U=r({meta:{type:`problem`,docs:{description:`禁止 eslint-disable、oxlint-disable、biome-ignore、stylelint-disable、@ts-ignore、@ts-nocheck 等抑制注释`}},createOnce(e){return{Program(){let t=e.sourceCode.getAllComments();for(let n of t){if(n.type===`Shebang`)continue;let t=_e(n.value);t!==null&&e.report({node:n,message:`检测到抑制指令 ${t},抑制注释不是合法豁免手段,请从源头消除违例或在包级 oxlint.config.ts 的 ignorePatterns 登记路径豁免`})}}}}});function ve(e){let t=[];if(e.type===`Identifier`&&t.push(e.name),e.type===`ObjectPattern`)for(let n of e.properties)n.type===`Property`&&`value`in n?n.value.type===`Identifier`&&t.push(n.value.name):n.type===`RestElement`&&n.argument.type===`Identifier`&&t.push(n.argument.name);if(e.type===`ArrayPattern`)for(let n of e.elements)n&&n.type===`Identifier`&&t.push(n.name);return t}const W=r({meta:{type:`suggestion`,docs:{description:`将 export const/let/var 拆分为独立的声明和导出语句`}},createOnce(e){return{ExportNamedDeclaration(t){if(!t.declaration||t.declaration.type!==`VariableDeclaration`)return;let n=t.declaration;if(n.kind!==`const`&&n.kind!==`let`&&n.kind!==`var`||n.declarations.length===0)return;let r=[];for(let e of n.declarations)r.push(...ve(e.id));r.length!==0&&e.report({node:t,message:`应将 \`export ${n.kind} ${r.join(`, `)}\` 拆分为独立的声明和导出语句`})}}}}),G=[{suffix:`.service.drizzle.ts`,classSuffix:`Service`,isInterface:!1,isPrefix:!1},{suffix:`.service.memory.ts`,classSuffix:`Service`,isInterface:!1,isPrefix:!1},{suffix:`.service.ts`,classSuffix:`Service`,isInterface:!1,isPrefix:!1},{suffix:`.controller.ts`,classSuffix:`Controller`,isInterface:!1,isPrefix:!1},{suffix:`.module.ts`,classSuffix:`Module`,isInterface:!1,isPrefix:!1},{suffix:`.repository.drizzle.ts`,classSuffix:`Repository`,isInterface:!1,isPrefix:!1},{suffix:`.repository.memory.ts`,classSuffix:`Repository`,isInterface:!1,isPrefix:!1},{suffix:`.repository.interface.ts`,classSuffix:`Repository`,isInterface:!0,isPrefix:!0},{suffix:`.repository.ts`,classSuffix:`Repository`,isInterface:!1,isPrefix:!1},{suffix:`.entity.ts`,classSuffix:`Entity`,isInterface:!1,isPrefix:!1},{suffix:`.orm-entity.ts`,classSuffix:`OrmEntity`,isInterface:!1,isPrefix:!1},{suffix:`.dto.ts`,classSuffix:`DTO`,isInterface:!1,isPrefix:!1},{suffix:`.port.interface.ts`,classSuffix:`Port`,isInterface:!0,isPrefix:!0},{suffix:`.interface.ts`,classSuffix:``,isInterface:!0,isPrefix:!0},{suffix:`.port.ts`,classSuffix:`Port`,isInterface:!0,isPrefix:!1},{suffix:`.port.adapter.ts`,classSuffix:`PortAdapter`,isInterface:!1,isPrefix:!1},{suffix:`.adapter.ts`,classSuffix:`Adapter`,isInterface:!1,isPrefix:!1},{suffix:`.events.ts`,classSuffix:`Event`,isInterface:!1,isPrefix:!1},{suffix:`.mapper.ts`,classSuffix:`Mapper`,isInterface:!1,isPrefix:!1},{suffix:`.vo.ts`,classSuffix:`VO`,isInterface:!1,isPrefix:!1},{suffix:`.usecase.ts`,classSuffix:`UseCase`,isInterface:!1,isPrefix:!1},{suffix:`.errors.ts`,classSuffix:`Error`,isInterface:!1,isPrefix:!1}];function K(e){for(let t of G)if(e.endsWith(t.suffix))return t;return null}function q(e,t){if(t.isPrefix&&t.isInterface){if(t.classSuffix){let n=t.classSuffix;return e.startsWith(`I`)&&e.endsWith(n)&&e.length>1+n.length}return e.startsWith(`I`)&&e.length>1}return t.isPrefix?e.startsWith(`I`)&&e.length>1:e.endsWith(t.classSuffix)&&e.length>t.classSuffix.length}function J(e){return e.isPrefix&&e.isInterface?e.classSuffix?`I${e.classSuffix}(如 IUser${e.classSuffix})`:`I 前缀(如 IUser)`:e.isPrefix?`I 前缀(如 IUser)`:`${e.classSuffix} 后缀`}const Y=r({meta:{type:`problem`,docs:{description:`强制执行类名与文件类型后缀的一致性`}},createOnce(e){return{before(){let t=e.filename.replace(/\\/g,`/`).split(`/`).pop()??``;if(t.endsWith(`.test.ts`)||t.endsWith(`.spec.ts`)||!K(t))return!1},ClassDeclaration(t){let n=e.filename.replace(/\\/g,`/`).split(`/`).pop()??``,r=K(n);if(!r||r.isInterface||!t.id)return;let i=t.id.name;q(i,r)||e.report({node:t,message:`类名 "${i}" 不符合命名规范。文件 "${n}" 中的类应使用 ${J(r)}`})},TSInterfaceDeclaration(t){let n=e.filename.replace(/\\/g,`/`).split(`/`).pop()??``,r=K(n);if(!r||!r.isInterface)return;let i=t.id.name;q(i,r)||e.report({node:t,message:`接口名 "${i}" 不符合命名规范。文件 "${n}" 中的接口应使用 ${J(r)}`})}}}});function X(e){return e.endsWith(`.dto.ts`)}function ye(e){return e.endsWith(`DTO`)}const Z=r({meta:{type:`problem`,docs:{description:`强制执行 DTO 文件中的接口命名规范(Dto 后缀,驼峰式)`}},createOnce(e){return{before(){let t=e.filename.replace(/\\/g,`/`).split(`/`).pop()??``;if(t.endsWith(`.test.ts`)||t.endsWith(`.spec.ts`)||!X(t))return!1},TSInterfaceDeclaration(n){let r=n.id.name;ye(r)?e.report({node:n,message:`接口名 "${r}" 后缀应使用 Dto(驼峰式)而非 DTO(全大写)`}):t(r)||e.report({node:n,message:`DTO 文件中的接口名 "${r}" 应以 Dto 结尾(如 UserResponseDto)`})}}}}),be=[`types.ts`,`types.d.ts`],xe=[`.port.interface.ts`,`.repository.interface.ts`,`.types.ts`,`.types.d.ts`,`.events.ts`,`.d.ts`];function Se(t,r){return e(t)?!1:!r.endsWith(`.dto.ts`)||n(t)}function Ce(e){return e.endsWith(`.dto.ts`)?`DTO 后缀(如 UserDTO),禁止 I 前缀`:`PascalCase(如 User、UserRepository),禁止 I 前缀`}function we(e){if(be.includes(e))return!0;for(let t of xe)if(e.endsWith(t))return!0;return!1}function Te(e){return e.endsWith(`.port.ts`)?e.replace(`.port.ts`,`.port.interface.ts`):e.endsWith(`.repository.ts`)?e.replace(`.repository.ts`,`.repository.interface.ts`):e.replace(`.ts`,`.interface.ts`)}const Q=r({meta:{type:`problem`,docs:{description:`强制执行接口命名规范(禁止 I 前缀,使用 PascalCase)和文件命名规范`}},createOnce(t){return{before(){let e=t.filename.replace(/\\/g,`/`).split(`/`).pop()??``;if(e.endsWith(`.test.ts`)||e.endsWith(`.spec.ts`)||we(e))return!1},TSInterfaceDeclaration(n){let r=t.filename.replace(/\\/g,`/`).split(`/`).pop()??``,i=r.endsWith(`.interface.ts`)||r.endsWith(`.interface.tsx`),a=n.id.name;Se(a,r)||(e(a)?t.report({node:n,message:`接口名 "${a}" 使用了 I 前缀。现代 TypeScript 不推荐使用匈牙利命名法,建议使用 "${a.substring(1)}"`}):r.endsWith(`.dto.ts`)&&a.endsWith(`Dto`)?t.report({node:n,message:`接口名 "${a}" 后缀应使用 DTO(全大写)而非 Dto(驼峰式)`}):t.report({node:n,message:`接口名 "${a}" 不符合命名规范。接口名应使用 ${Ce(r)}`})),i||r.endsWith(`.dto.ts`)||r.endsWith(`.tsx`)||t.report({node:n,message:`包含接口 "${a}" 的文件 "${r}" 应命名为 "${Te(r)}"`})}}}}),$=i({meta:{name:`@longzai-intelligence-oxlint/code-style-plugin`},rules:{"no-console":f,"no-inline-type-definition":V,"prefer-split-export-const":W,"require-interface-naming":Q,"require-dto-naming":Z,"require-class-suffix":Y,"no-class-suffix-alias":l,"no-handwritten-shebang":_,"no-lint-suppression":U}});export{G as SUFFIX_MAPPINGS,$ as codeStylePlugin,$ as default,N as getInlineTypeDescription,P as getParamName,e as hasIPrefix,M as hasInlineType,X as isDtoFile,D as isFunctionNode,O as isMethodDefinition,C as isTSFunctionType,T as isTSIntersectionType,S as isTSTypeLiteral,w as isTSUnionType,l as noClassSuffixAliasRule,f as noConsoleRule,_ as noHandwrittenShebangRule,V as noInlineTypeDefinitionRule,U as noLintSuppressionRule,W as preferSplitExportConstRule,Y as requireClassSuffixRule,Z as requireDtoNamingRule,Q as requireInterfaceNamingRule};
@@ -1,6 +1,6 @@
1
1
  import"../rolldown-runtime-BqT_7tdF.js";import{parseSeparatorComment as e}from"./tsdoc.js";import{defineRule as t,eslintCompatPlugin as n}from"@oxlint/plugins";function r(){return{isBlockStart:!1,isBlockEnd:!1,isObjectStart:!1,isObjectEnd:!1,isArrayStart:!1,isArrayEnd:!1,isClassStart:!1,isClassEnd:!1,isInterfaceStart:!1,isInterfaceEnd:!1,isTypeStart:!1,isTypeEnd:!1,isEnumStart:!1,isEnumEnd:!1,isModuleStart:!1,isModuleEnd:!1,isFunctionStart:!1,isFunctionEnd:!1}}function i(e){return!!(e.includes(`type `)||e.includes(`extends {`)||e.includes(`type{`)||e.includes(`Array<{`)||e.includes(`Promise<{`)||e.includes(`<{`)||e.includes(`| {`)||e.includes(`as {`)||e.includes(`Record<{`)||e.includes(`Partial<{`)||e.includes(`Required<{`)||e.includes(`Pick<{`)||e.includes(`Omit<{`)||e.includes(`& {`))}function a(e,t){for(let n=2;n<=5&&t>n;n++){let r=e[t-n-1];if(r){let e=r.trimEnd();if(e.includes(`Record<{`)||e.includes(`Partial<{`)||e.includes(`Required<{`)||e.includes(`Pick<{`)||e.includes(`Omit<{`)||e.includes(`Array<{`)||e.includes(`Promise<{`)||e.includes(`type `)||e.includes(`interface `))return!0}}return!1}function o(e){return e.endsWith(`) {`)||e.endsWith(`){`)||/\)\s*(?::\s*[^{]+)?\{/.test(e)||e.includes(`=> {`)}function s(e){return!!(e.endsWith(`) {`)||e.endsWith(`){`)||e===`{`||/: [^{]+ \{$/.test(e)||/\)\s*(?::\s*[^{]+)?\{/.test(e)||e.endsWith(`}> {`)||e===`> {`||e.includes(`try {`)||e.includes(`catch {`)||e.includes(`finally {`)||e.includes(`=> {`)||e.includes(`else {`)||/^\w+\s*\{$/.test(e)||/^\| .+ \{$/.test(e))}function c(e){let t=e.includes(`namespace `)||e.includes(`namespace{`),n=e.startsWith(`declare global`)||e.startsWith(`declare module`);return e.includes(`module `)||e.includes(`module{`)||t||n}function l(e,t){for(let n=2;n<=10&&t>n;n++){let r=e[t-n-1];if(r){let e=r.trim();if(e.includes(`class `)||e.includes(`class{`))return!0}}return!1}function u(e){let t=/\w\(\{$/.test(e),n=e.endsWith(`, {`),r=/=>\s*\(\{$/.test(e),i=e.includes(`export default {`);return e.includes(`: {`)||e.endsWith(`= {`)||t||n||r||i}function d(e,t,n,r){i(t)?e.isTypeStart=!0:t.trim()===`{`?e[a(n,r)?`isTypeStart`:`isBlockStart`]=!0:t.includes(`interface `)||t.includes(`interface{`)?e.isInterfaceStart=!0:t.includes(`enum `)||t.includes(`enum{`)?e.isEnumStart=!0:c(t)?e.isModuleStart=!0:t.includes(`class `)||t.includes(`class{`)||t===`> {`?e.isClassStart=!0:s(t)?(e.isBlockStart=!0,o(t)&&(e.isFunctionStart=!0)):u(t)?e.isObjectStart=!0:t.includes(`: [`)||t.endsWith(`= [`)||t.endsWith(`[`)?e.isArrayStart=!0:l(n,r)&&(e.isClassStart=!0)}function f(e,t,n){if(t<=1)return;let r=t-2;for(;r>=0;){let e=n[r];if(e&&e.trim().length>0)break;r--}if(r<0)return;let i=n[r];if(!i)return;let a=i.trim();a.endsWith(`{`)||/>+\s*\{\s*$/.test(a)?d(e,a,n,t):a.endsWith(`(`)||a.endsWith(`>`)?e.isBlockStart=!0:a.endsWith(`[`)&&(e.isArrayStart=!0)}function p(e,t,n){if(t>=n.length)return;let r=n[t];if(!r)return;let i=r.trimStart();i===`}`||i===`};`?(e.isBlockEnd=!0,e.isObjectEnd=!0,e.isClassEnd=!0,e.isInterfaceEnd=!0,e.isTypeEnd=!0,e.isEnumEnd=!0,e.isModuleEnd=!0,e.isFunctionEnd=!0):i.startsWith(`];`)&&(e.isArrayEnd=!0)}function m(e,t){let n=r(),i=e.loc.start.line,a=e.loc.end.line;return f(n,i,t),p(n,a,t),n}const h={beforeBlockComment:!0,afterBlockComment:!1,beforeLineComment:!1,afterLineComment:!1,allowBlockStart:!1,allowBlockEnd:!1,allowObjectStart:!1,allowObjectEnd:!1,allowArrayStart:!1,allowArrayEnd:!1,allowClassStart:!1,allowClassEnd:!1,allowInterfaceStart:!1,allowInterfaceEnd:!1,allowTypeStart:!1,allowTypeEnd:!1,allowEnumStart:!1,allowEnumEnd:!1,allowModuleStart:!1,allowModuleEnd:!1,allowFunctionStart:!1,allowFunctionEnd:!1,ignorePattern:void 0,applyDefaultIgnorePatterns:!0};function ee(e,t){if(e.loc.start.line<=1)return!1;let n=g(e.loc.start.line,t);return n?/\w+=\{$/.test(n):!1}function te(e,t){if(e.loc.start.line<=1)return!1;let n=g(e.loc.start.line,t);if(!n||!(n===`}`||/^\w+=("[^"]*"|'[^']*')$/.test(n)||/^\w+=\{.+\}$/.test(n)||/^<[A-Z]\w*$/.test(n)||/^\w+:$/.test(n)))return!1;let r=_(e.loc.end.line,t);return r?/^\w+=/.test(r)||/^\/?>$/.test(r)||r.startsWith(`/>`)||r.startsWith(`(`)||r.startsWith(`<`):!1}const ne=/(?:,|:|\?|=>|&&|\|\||=|[+*/%&|^<-])$/u;function re(e,t){if(e.loc.start.line<=1)return!1;let n=y(e.loc.start.line,t);return n?ne.test(n):!1}function g(e,t){let n=e-2;for(;n>=0;){let e=t[n];if(e&&e.trim().length>0)return e.trim();n--}return null}function _(e,t){let n=e;for(;n<t.length;){let e=t[n];if(e&&e.trim().length>0)return e.trim();n++}return null}function v(e){return e.startsWith(`//`)||e.startsWith(`/*`)||e.startsWith(`*`)}function y(e,t){let n=e-2;for(;n>=0;){let e=t[n];if(e&&e.trim().length>0&&!v(e.trim()))return e.trim();n--}return null}function b(e,t){let n=t[e.loc.start.line-1];return n?n.slice(0,e.loc.start.column).trim().length>0:!1}function x(e,t){if(t.length===0)return!1;let n=t[t.length-1];return n?n.loc.end.line+1>=e.loc.start.line:!1}const S=[/^eslint/i,/^jshint/i,/^jslint/i,/^istanbul/i,/^global/i,/^exported/i,/^jscs/i];function C(e,t){let n=e.value.trim();if(t.applyDefaultIgnorePatterns!==!1){for(let e of S)if(e.test(n))return!0}return!!(t.ignorePattern&&new RegExp(t.ignorePattern,`u`).test(n))}function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function T(e,t,n){let r=t[n];typeof r==`boolean`&&(e[n]=r)}function E(e,t){T(e,t,`beforeBlockComment`),T(e,t,`afterBlockComment`),T(e,t,`beforeLineComment`),T(e,t,`afterLineComment`),T(e,t,`allowBlockStart`),T(e,t,`allowBlockEnd`),T(e,t,`allowObjectStart`),T(e,t,`allowObjectEnd`),T(e,t,`allowArrayStart`),T(e,t,`allowArrayEnd`),T(e,t,`allowClassStart`),T(e,t,`allowClassEnd`),T(e,t,`allowInterfaceStart`),T(e,t,`allowInterfaceEnd`),T(e,t,`allowTypeStart`),T(e,t,`allowTypeEnd`),T(e,t,`allowEnumStart`),T(e,t,`allowEnumEnd`),T(e,t,`allowModuleStart`),T(e,t,`allowModuleEnd`),T(e,t,`allowFunctionStart`),T(e,t,`allowFunctionEnd`),T(e,t,`applyDefaultIgnorePatterns`)}function D(e,t,n){let r=t[n];typeof r==`string`&&(e[n]=r)}function O(e){let t={...h};return w(e)&&(E(t,e),D(t,e,`ignorePattern`)),t}function k(e,t){return e<=1||t[e-2]?.trim()===``}function A(e,t){return e>=t.length||t[e]?.trim()===``}function j(e,t){return e.isBlockStart&&(t.allowBlockStart??!1)||e.isObjectStart&&(t.allowObjectStart??!1)||e.isArrayStart&&(t.allowArrayStart??!1)||e.isClassStart&&(t.allowClassStart??!1)||e.isInterfaceStart&&(t.allowInterfaceStart??!1)||e.isTypeStart&&(t.allowTypeStart??!1)||e.isEnumStart&&(t.allowEnumStart??!1)||e.isModuleStart&&(t.allowModuleStart??!1)||e.isFunctionStart&&(t.allowFunctionStart??!1)}function M(e,t){return e.isBlockEnd&&(t.allowBlockEnd??!1)||e.isObjectEnd&&(t.allowObjectEnd??!1)||e.isArrayEnd&&(t.allowArrayEnd??!1)||e.isClassEnd&&(t.allowClassEnd??!1)||e.isInterfaceEnd&&(t.allowInterfaceEnd??!1)||e.isTypeEnd&&(t.allowTypeEnd??!1)||e.isEnumEnd&&(t.allowEnumEnd??!1)||e.isModuleEnd&&(t.allowModuleEnd??!1)||e.isFunctionEnd&&(t.allowFunctionEnd??!1)}function N(e,t,n,r,i){let a=e.type===`Block`;if(a&&n.beforeBlockComment||!a&&n.beforeLineComment){if(j(i,n))return;let o=e.loc.start.line;k(o,t)||r.report({loc:{start:e.loc.start,end:e.loc.start},message:a?`块注释前需要空行`:`行注释前需要空行`,fix:n=>{let r=0;for(let n=0;n<e.loc.start.line-1;n++)r+=(t[n]?.length??0)+1;return n.insertTextBeforeRange([r,r],`
2
2
  `)}})}}function P(e,t,n,r,i){let a=e.type===`Block`;if(a&&n.afterBlockComment||!a&&n.afterLineComment){if(M(i,n))return;let o=e.loc.end.line;A(o,t)||r.report({loc:{start:e.loc.end,end:e.loc.end},message:a?`块注释后需要空行`:`行注释后需要空行`,fix:t=>t.insertTextAfterRange([e.range[1],e.range[1]],`
3
- `)})}}function F(e,t,n,r,i=[],a=!1,o=!1){if(b(e,t)||C(e,n))return;let s=x(e,i),c=m(e,t),l=ee(e,t)||te(e,t),u=re(e,t);!a&&!s&&!l&&!u&&N(e,t,n,r,c),o||P(e,t,n,r,c)}const ie=t({meta:{type:`layout`,fixable:`whitespace`,docs:{description:`要求在注释前后有空行`},schema:[{type:`object`,properties:{beforeBlockComment:{type:`boolean`},afterBlockComment:{type:`boolean`},beforeLineComment:{type:`boolean`},afterLineComment:{type:`boolean`},allowBlockStart:{type:`boolean`},allowBlockEnd:{type:`boolean`},allowObjectStart:{type:`boolean`},allowObjectEnd:{type:`boolean`},allowArrayStart:{type:`boolean`},allowArrayEnd:{type:`boolean`},allowClassStart:{type:`boolean`},allowClassEnd:{type:`boolean`},allowInterfaceStart:{type:`boolean`},allowInterfaceEnd:{type:`boolean`},allowTypeStart:{type:`boolean`},allowTypeEnd:{type:`boolean`},allowEnumStart:{type:`boolean`},allowEnumEnd:{type:`boolean`},allowModuleStart:{type:`boolean`},allowModuleEnd:{type:`boolean`},allowFunctionStart:{type:`boolean`},allowFunctionEnd:{type:`boolean`},ignorePattern:{type:`string`},applyDefaultIgnorePatterns:{type:`boolean`}},additionalProperties:!1}]},createOnce(e){let t=[],n=[];return{Program(){let r=O(e.options?.[0]);t=e.sourceCode.text.split(`
3
+ `)})}}function F(e,t,n,r,i=[],a=!1,o=!1){if(b(e,t)||C(e,n))return;let s=x(e,i),c=m(e,t),l=ee(e,t)||te(e,t),u=re(e,t);a||s||l||u||N(e,t,n,r,c),o||P(e,t,n,r,c)}const ie=t({meta:{type:`layout`,fixable:`whitespace`,docs:{description:`要求在注释前后有空行`},schema:[{type:`object`,properties:{beforeBlockComment:{type:`boolean`},afterBlockComment:{type:`boolean`},beforeLineComment:{type:`boolean`},afterLineComment:{type:`boolean`},allowBlockStart:{type:`boolean`},allowBlockEnd:{type:`boolean`},allowObjectStart:{type:`boolean`},allowObjectEnd:{type:`boolean`},allowArrayStart:{type:`boolean`},allowArrayEnd:{type:`boolean`},allowClassStart:{type:`boolean`},allowClassEnd:{type:`boolean`},allowInterfaceStart:{type:`boolean`},allowInterfaceEnd:{type:`boolean`},allowTypeStart:{type:`boolean`},allowTypeEnd:{type:`boolean`},allowEnumStart:{type:`boolean`},allowEnumEnd:{type:`boolean`},allowModuleStart:{type:`boolean`},allowModuleEnd:{type:`boolean`},allowFunctionStart:{type:`boolean`},allowFunctionEnd:{type:`boolean`},ignorePattern:{type:`string`},applyDefaultIgnorePatterns:{type:`boolean`}},additionalProperties:!1}]},createOnce(e){let t=[],n=[];return{Program(){let r=O(e.options?.[0]);t=e.sourceCode.text.split(`
4
4
  `),n=[];let i=e.sourceCode.getAllComments();for(let a=0;a<i.length;a++){let o=i[a];if(!o)continue;let s=i[a+1],c=s!==void 0&&s.loc.start.line<=o.loc.end.line+1;F(o,t,r,e,n,!1,c),n.push(o)}}}}}),I=[`eslint`,`oxlint`,`jshint`,`jslint`,`tslint`,`istanbul`,`global`,`exported`,`jscs`],L=[`<reference`,`<amd-module`,`<amd-dependency`,`@ts-`],R=/^\*?\s*$/u,z=/^\s*$/u,B=`禁止双斜杠注释,只允许多行块注释`;function V(e){let t=e.value.trim(),n=t.replace(/^\/+/u,``).trim();return I.some(e=>t.startsWith(e))||L.some(e=>n.startsWith(e))}function H(t){return t.type===`Line`&&e(t.value)!==null}function U(e,t){let n=t[e.loc.start.line-1];if(!n)return` `.repeat(e.loc.start.column);let r=n.slice(0,e.loc.start.column);return r.trim().length>0?` `.repeat(e.loc.start.column):r}function W(e){let t=[];for(let n of e){let e=t[t.length-1];if(e){let t=e[e.length-1];if(t&&t.loc.end.line===n.loc.start.line-1){e.push(n);continue}}t.push([n])}return t}function G(e){return e.map(e=>e.value)}function K(e,t){return`/*\n${e.map(e=>{let n=e.trim();return n?`${t} * ${n}`:`${t} *`}).join(`
5
5
  `)}\n${t} */`}function q(e,t){let n=e.trim(),r=n.startsWith(`*`),i=r?n.slice(1).trim():n,a=r?`/**`:`/*`;return i?`${a}\n${t} * ${i}\n${t} */`:`${a}\n${t} */`}function J(e,t){let n=e.value.split(`
6
6
  `),r=0;for(let e=0;e<t;e++)r+=(n[e]?.length??0)+1;return e.range[0]+2+r}function Y(e,t){let n=[],r=[];for(let i of e)b(i,t)?n.push({message:B,loc:{start:{...i.loc.start},end:{...i.loc.end}}}):r.push(i);for(let e of W(r)){let r=e[0],i=e[e.length-1];if(!r||!i)continue;let a=U(r,t),o=G(e),s=o.some(e=>e.trim().startsWith(`/`));n.push({message:B,loc:{start:{...r.loc.start},end:{...i.loc.end}},fix:s?void 0:{range:[r.range[0],i.range[1]],text:K(o,a)}})}return n}function ae(e,t){let n=[],r=e.value.split(`
@@ -1,5 +1,4 @@
1
- import { i as OxlintRules, n as OxlintConfigOverride } from "./index-eNRova_s.js";
2
- //#region src/types/preset-options.types.d.ts
1
+ import { i as OxlintRules, n as OxlintConfigOverride } from "./index-7B-WMfha.js";
3
2
  /**
4
3
  * 预设选项
5
4
  *
@@ -21,5 +20,4 @@ type PresetOptions = {
21
20
  */
22
21
  ignorePatterns?: string[];
23
22
  };
24
- //#endregion
25
23
  export { PresetOptions as t };
package/dist/react.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/entries/react.entry.d.ts
2
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * 创建 Oxlint React 配置
7
6
  *
@@ -13,5 +12,4 @@ declare function defineConfig(options?: PresetOptions): OxlintConfig;
13
12
  * 默认 Oxlint React 配置实例
14
13
  */
15
14
  declare const oxlintReactConfig: OxlintConfig;
16
- //#endregion
17
15
  export { type OxlintConfig, type OxlintConfigOverride, oxlintReactConfig as default, defineConfig };
package/dist/root.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
2
- import { n as oxlintRootConfig, r as ROOT_WHITELIST_PATTERNS, t as defineConfig } from "./root.entry-D3HRGFNj.js";
1
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
2
+ import { n as oxlintRootConfig, r as ROOT_WHITELIST_PATTERNS, t as defineConfig } from "./root.entry-DW6F5jjU.js";
3
3
  export { type OxlintConfig, type OxlintConfigOverride, ROOT_WHITELIST_PATTERNS, oxlintRootConfig as default, defineConfig };
@@ -1,7 +1,6 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/defaults/root.patterns.d.ts
2
+ import { t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * monorepo 根目录白名单忽略模式全集
7
6
  *
@@ -10,8 +9,6 @@ import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
10
9
  * lzi 模式串复用强制包含单一真源,入口拉平时统一归一化落尾
11
10
  */
12
11
  declare const ROOT_WHITELIST_PATTERNS: readonly string[];
13
- //#endregion
14
- //#region src/entries/root.entry.d.ts
15
12
  /**
16
13
  * 创建 Oxlint Root 配置
17
14
  *
@@ -23,5 +20,4 @@ declare function defineConfig(options?: PresetOptions): OxlintConfig;
23
20
  * 默认 Oxlint Root 配置实例
24
21
  */
25
22
  declare const oxlintRootConfig: OxlintConfig;
26
- //#endregion
27
23
  export { oxlintRootConfig as n, ROOT_WHITELIST_PATTERNS as r, defineConfig as t };
package/dist/rules.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { a as ESLINT_CORE_RULES, i as TYPESCRIPT_RECOMMENDED_RULES, n as ESLINT_RECOMMENDED_RULES, r as TYPESCRIPT_PROJECT_RULES, t as UNICORN_RULES } from "./unicorn.rules-CoZq5SQL.js";
2
+ import { a as ESLINT_CORE_RULES, i as TYPESCRIPT_RECOMMENDED_RULES, n as ESLINT_RECOMMENDED_RULES, r as TYPESCRIPT_PROJECT_RULES, t as UNICORN_RULES } from "./unicorn.rules-DgKAk9wi.js";
3
3
  export { ESLINT_CORE_RULES, ESLINT_RECOMMENDED_RULES, TYPESCRIPT_PROJECT_RULES, TYPESCRIPT_RECOMMENDED_RULES, UNICORN_RULES };
package/dist/taro.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-eNRova_s.js";
2
- import { i as TARO_SPECIAL_FILE_PATTERNS, n as oxlintTaroConfig, r as TARO_FILE_NAMING_EXEMPT_PATTERNS, t as defineConfig } from "./taro.entry-DuohnWen.js";
1
+ import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-7B-WMfha.js";
2
+ import { i as TARO_SPECIAL_FILE_PATTERNS, n as oxlintTaroConfig, r as TARO_FILE_NAMING_EXEMPT_PATTERNS, t as defineConfig } from "./taro.entry-DQK7ypZY.js";
3
3
  export { type OxlintConfig, type OxlintConfigOverride, TARO_FILE_NAMING_EXEMPT_PATTERNS, TARO_SPECIAL_FILE_PATTERNS, oxlintTaroConfig as default, defineConfig };
@@ -1,7 +1,6 @@
1
1
  import "./rolldown-runtime-BqT_7tdF.js";
2
- import { t as OxlintConfig } from "./index-eNRova_s.js";
3
- import { t as PresetOptions } from "./preset-options.types-Czyi-DdY.js";
4
- //#region src/defaults/taro.patterns.d.ts
2
+ import { t as OxlintConfig } from "./index-7B-WMfha.js";
3
+ import { t as PresetOptions } from "./preset-options.types-Ch-eTtkd.js";
5
4
  /**
6
5
  * Taro 预设 - 框架约定文件模式
7
6
  *
@@ -27,8 +26,6 @@ declare const TARO_SPECIAL_FILE_PATTERNS: string[];
27
26
  * 口径仅限框架约定的应用入口,不随消费仓自定义命名扩面
28
27
  */
29
28
  declare const TARO_FILE_NAMING_EXEMPT_PATTERNS: string[];
30
- //#endregion
31
- //#region src/entries/taro.entry.d.ts
32
29
  /**
33
30
  * Taro 预设选项
34
31
  *
@@ -57,5 +54,4 @@ declare function defineConfig(options?: TaroPresetOptions): OxlintConfig;
57
54
  * 默认 Oxlint Taro 配置实例
58
55
  */
59
56
  declare const oxlintTaroConfig: OxlintConfig;
60
- //#endregion
61
57
  export { TARO_SPECIAL_FILE_PATTERNS as i, oxlintTaroConfig as n, TARO_FILE_NAMING_EXEMPT_PATTERNS as r, defineConfig as t };
@@ -1,5 +1,4 @@
1
- import { i as OxlintRules, r as OxlintRuleConfig } from "./index-eNRova_s.js";
2
- //#region src/rules/eslint-core.rules.d.ts
1
+ import { i as OxlintRules, r as OxlintRuleConfig } from "./index-7B-WMfha.js";
3
2
  /**
4
3
  * Oxlint 原生规则配置 - eslint-core 规则
5
4
  *
@@ -16,8 +15,6 @@ import { i as OxlintRules, r as OxlintRuleConfig } from "./index-eNRova_s.js";
16
15
  * 默认值来源:@longzai-intelligence-oxlint/core 的 oxlintDefaults
17
16
  */
18
17
  declare const ESLINT_CORE_RULES: Record<string, OxlintRuleConfig>;
19
- //#endregion
20
- //#region src/rules/typescript-eslint.rules.d.ts
21
18
  /**
22
19
  * eslint/recommended 中 Oxlint 原生支持的规则(21 条)
23
20
  *
@@ -40,8 +37,6 @@ declare const TYPESCRIPT_RECOMMENDED_RULES: OxlintRules;
40
37
  * 注意:no-unused-vars 在 Oxlint 中是 eslint 内置规则,不带 typescript/ 前缀。
41
38
  */
42
39
  declare const TYPESCRIPT_PROJECT_RULES: OxlintRules;
43
- //#endregion
44
- //#region src/rules/unicorn.rules.d.ts
45
40
  /**
46
41
  * Oxlint 原生规则配置 - unicorn 规则
47
42
  *
@@ -58,5 +53,4 @@ declare const TYPESCRIPT_PROJECT_RULES: OxlintRules;
58
53
  * 默认值来源:@longzai-intelligence-oxlint/core 的 unicornDefaults
59
54
  */
60
55
  declare const UNICORN_RULES: Record<string, OxlintRuleConfig>;
61
- //#endregion
62
56
  export { ESLINT_CORE_RULES as a, TYPESCRIPT_RECOMMENDED_RULES as i, ESLINT_RECOMMENDED_RULES as n, TYPESCRIPT_PROJECT_RULES as r, UNICORN_RULES as t };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-oxlint/presets",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "description": "Longzai Intelligence oxlint 配置预设",
5
5
  "keywords": [
6
6
  "config",
@@ -104,33 +104,33 @@
104
104
  "zod": "^4.6.7"
105
105
  },
106
106
  "devDependencies": {
107
- "@longzai-intelligence-oxlint/architecture-core-plugin": "0.2.10",
108
- "@longzai-intelligence-oxlint/architecture-electron-plugin": "0.2.10",
109
- "@longzai-intelligence-oxlint/architecture-library-plugin": "0.2.10",
110
- "@longzai-intelligence-oxlint/code-style-plugin": "0.2.10",
111
- "@longzai-intelligence-oxlint/composer-plugin": "0.2.10",
112
- "@longzai-intelligence-oxlint/core": "0.2.10",
113
- "@longzai-intelligence-oxlint/design-rules-plugin": "0.2.10",
114
- "@longzai-intelligence-oxlint/elysia-route-plugin": "0.2.10",
115
- "@longzai-intelligence-oxlint/eslint-config-plugin": "0.2.10",
116
- "@longzai-intelligence-oxlint/file-naming-plugin": "0.2.10",
117
- "@longzai-intelligence-oxlint/lzi-builder-config-plugin": "0.2.10",
118
- "@longzai-intelligence-oxlint/lzi-config-plugin": "0.2.10",
119
- "@longzai-intelligence-oxlint/nestjs-route-plugin": "0.2.10",
120
- "@longzai-intelligence-oxlint/package-json-plugin": "0.2.10",
121
- "@longzai-intelligence-oxlint/perfectionist-plugin": "0.2.10",
122
- "@longzai-intelligence-oxlint/react-plugin": "0.2.10",
123
- "@longzai-intelligence-oxlint/schema-type-separation-plugin": "0.2.10",
124
- "@longzai-intelligence-oxlint/stylistic-plugin": "0.2.10",
125
- "@longzai-intelligence-oxlint/tsconfig-plugin": "0.2.10",
126
- "@longzai-intelligence-oxlint/tsdoc-plugin": "0.2.10",
127
- "@longzai-intelligence-oxlint/tsdown-config-plugin": "0.2.10",
128
- "@longzai-intelligence-oxlint/tsup-config-plugin": "0.2.10",
129
- "@longzai-intelligence-oxlint/typeorm-plugin": "0.2.10",
130
- "@longzai-intelligence-oxlint/typescript-eslint-plugin": "0.2.10",
131
- "@longzai-intelligence-oxlint/utils": "0.2.10",
132
- "@longzai-intelligence-oxlint/vitest-config-plugin": "0.2.10",
133
- "@longzai-intelligence-oxlint/zod-plugin": "0.2.10",
107
+ "@longzai-intelligence-oxlint/architecture-core-plugin": "0.2.11",
108
+ "@longzai-intelligence-oxlint/architecture-electron-plugin": "0.2.11",
109
+ "@longzai-intelligence-oxlint/architecture-library-plugin": "0.2.11",
110
+ "@longzai-intelligence-oxlint/code-style-plugin": "0.2.11",
111
+ "@longzai-intelligence-oxlint/composer-plugin": "0.2.11",
112
+ "@longzai-intelligence-oxlint/core": "0.2.11",
113
+ "@longzai-intelligence-oxlint/design-rules-plugin": "0.2.11",
114
+ "@longzai-intelligence-oxlint/elysia-route-plugin": "0.2.11",
115
+ "@longzai-intelligence-oxlint/eslint-config-plugin": "0.2.11",
116
+ "@longzai-intelligence-oxlint/file-naming-plugin": "0.2.11",
117
+ "@longzai-intelligence-oxlint/lzi-builder-config-plugin": "0.2.11",
118
+ "@longzai-intelligence-oxlint/lzi-config-plugin": "0.2.11",
119
+ "@longzai-intelligence-oxlint/nestjs-route-plugin": "0.2.11",
120
+ "@longzai-intelligence-oxlint/package-json-plugin": "0.2.11",
121
+ "@longzai-intelligence-oxlint/perfectionist-plugin": "0.2.11",
122
+ "@longzai-intelligence-oxlint/react-plugin": "0.2.11",
123
+ "@longzai-intelligence-oxlint/schema-type-separation-plugin": "0.2.11",
124
+ "@longzai-intelligence-oxlint/stylistic-plugin": "0.2.11",
125
+ "@longzai-intelligence-oxlint/tsconfig-plugin": "0.2.11",
126
+ "@longzai-intelligence-oxlint/tsdoc-plugin": "0.2.11",
127
+ "@longzai-intelligence-oxlint/tsdown-config-plugin": "0.2.11",
128
+ "@longzai-intelligence-oxlint/tsup-config-plugin": "0.2.11",
129
+ "@longzai-intelligence-oxlint/typeorm-plugin": "0.2.11",
130
+ "@longzai-intelligence-oxlint/typescript-eslint-plugin": "0.2.11",
131
+ "@longzai-intelligence-oxlint/utils": "0.2.11",
132
+ "@longzai-intelligence-oxlint/vitest-config-plugin": "0.2.11",
133
+ "@longzai-intelligence-oxlint/zod-plugin": "0.2.11",
134
134
  "@vitest/coverage-v8": "^4.1.10"
135
135
  },
136
136
  "peerDependencies": {