@longzai-intelligence-oxlint/presets 0.2.25 → 0.2.27
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/e2e-playwright.d.ts +15 -0
- package/dist/e2e-playwright.entry-D8R3Btl6.js +1 -0
- package/dist/e2e-playwright.js +1 -0
- package/dist/index.d.ts +15 -14
- package/dist/index.js +1 -1
- package/dist/plugins/package-json.js +1 -1
- package/dist/react.d.ts +23 -3
- package/dist/react.js +1 -1
- package/package.json +32 -28
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./rolldown-runtime-BqT_7tdF.js";
|
|
2
|
+
import { t as PresetOptions } from "./preset-options.types-BWSmiunG.js";
|
|
3
|
+
import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-lrryBFJ6.js";
|
|
4
|
+
/**
|
|
5
|
+
* 创建 Oxlint E2e Playwright 配置
|
|
6
|
+
*
|
|
7
|
+
* @param options - 预设选项,包含额外的规则、覆盖和忽略模式
|
|
8
|
+
* @returns 含 test 工具链判据注入的 Oxlint 配置对象
|
|
9
|
+
*/
|
|
10
|
+
declare function defineConfig(options?: PresetOptions): OxlintConfig;
|
|
11
|
+
/**
|
|
12
|
+
* 默认 Oxlint E2e Playwright 配置实例
|
|
13
|
+
*/
|
|
14
|
+
declare const oxlintE2ePlaywrightConfig: OxlintConfig;
|
|
15
|
+
export { type OxlintConfig, type OxlintConfigOverride, oxlintE2ePlaywrightConfig as default, defineConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./rolldown-runtime-BqT_7tdF.js";import{s as e,t}from"./base.entry-ihV3q_2I.js";import"./node.js";const n={"@longzai-intelligence-oxlint/package-json-plugin/require-test-script-toolchain":[`error`,{test:[`playwright`]}]};function r(r){let i=t();return{extends:[i],rules:{...n,...r?.rules},...r?.overrides?{overrides:r.overrides}:{},ignorePatterns:e([...i.ignorePatterns??[],...r?.ignorePatterns??[]])}}const i=r();export{i as n,r as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./node.js";export{n as default,t as defineConfig}from"./e2e-playwright.entry-D8R3Btl6.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import "./rolldown-runtime-BqT_7tdF.js";
|
|
2
2
|
import { defineConfig } from "./base.js";
|
|
3
|
-
import { defineConfig as defineConfig$
|
|
4
|
-
import { defineConfig as defineConfig$
|
|
5
|
-
import { defineConfig as defineConfig$
|
|
6
|
-
import { r as NEXTJS_SPECIAL_FILE_PATTERNS, t as defineConfig$
|
|
7
|
-
import { t as defineConfig$
|
|
8
|
-
import { i as FUMADOCS_SPECIAL_FILE_PATTERNS, r as FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS, t as defineConfig$
|
|
9
|
-
import { r as REACT_NATIVE_TOOLCHAIN_IGNORE_PATTERNS, t as defineConfig$
|
|
10
|
-
import { defineConfig as defineConfig$
|
|
11
|
-
import { defineConfig as defineConfig$
|
|
12
|
-
import { defineConfig as defineConfig$
|
|
13
|
-
import { defineConfig as defineConfig$
|
|
3
|
+
import { defineConfig as defineConfig$11 } from "./react.js";
|
|
4
|
+
import { defineConfig as defineConfig$6 } from "./hono.js";
|
|
5
|
+
import { defineConfig as defineConfig$8 } from "./mcp.js";
|
|
6
|
+
import { r as NEXTJS_SPECIAL_FILE_PATTERNS, t as defineConfig$10 } from "./next.entry-Ne8_XqK0.js";
|
|
7
|
+
import { t as defineConfig$15 } from "./taro.entry-BCmIDclj.js";
|
|
8
|
+
import { i as FUMADOCS_SPECIAL_FILE_PATTERNS, r as FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS, t as defineConfig$5 } from "./fumadocs.entry-8pmrxlhS.js";
|
|
9
|
+
import { r as REACT_NATIVE_TOOLCHAIN_IGNORE_PATTERNS, t as defineConfig$12 } from "./react-native.entry-Cj2-RwM6.js";
|
|
10
|
+
import { defineConfig as defineConfig$4 } from "./expo.js";
|
|
11
|
+
import { defineConfig as defineConfig$9 } from "./nest.js";
|
|
12
|
+
import { defineConfig as defineConfig$3 } from "./electron.js";
|
|
13
|
+
import { defineConfig as defineConfig$7 } from "./library.js";
|
|
14
14
|
import { defineConfig as defineConfig$1 } from "./e2e.js";
|
|
15
|
-
import {
|
|
16
|
-
import { r as
|
|
15
|
+
import { defineConfig as defineConfig$2 } from "./e2e-playwright.js";
|
|
16
|
+
import { r as SDK_GENERATED_PATTERNS, t as defineConfig$14 } from "./sdk.entry-BYKYZRSf.js";
|
|
17
|
+
import { r as ROOT_WHITELIST_PATTERNS, t as defineConfig$13 } from "./root.entry-zPzaL4rV.js";
|
|
17
18
|
import { t as PresetOptions } from "./preset-options.types-BWSmiunG.js";
|
|
18
19
|
import { i as OxlintRules, n as OxlintConfigOverride, r as OxlintRuleConfig, t as OxlintConfig } from "./index-lrryBFJ6.js";
|
|
19
20
|
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-BpYEgKCm.js";
|
|
@@ -30,4 +31,4 @@ declare const PLUGIN_DEFAULTS: OxlintRules;
|
|
|
30
31
|
* 生态层覆盖插件 recommended 的无选项形态,require-* 与 test-file 系列规则由此获得选项默认值
|
|
31
32
|
*/
|
|
32
33
|
declare const ALL_RULES: OxlintRules;
|
|
33
|
-
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, REACT_NATIVE_TOOLCHAIN_IGNORE_PATTERNS, ROOT_WHITELIST_PATTERNS, SDK_GENERATED_PATTERNS, TYPESCRIPT_PROJECT_RULES, TYPESCRIPT_RECOMMENDED_RULES, UNICORN_RULES, defineConfig as defineBaseConfig, defineConfig as defineNodeConfig, defineConfig$1 as defineE2eConfig, defineConfig$2 as
|
|
34
|
+
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, REACT_NATIVE_TOOLCHAIN_IGNORE_PATTERNS, ROOT_WHITELIST_PATTERNS, SDK_GENERATED_PATTERNS, TYPESCRIPT_PROJECT_RULES, TYPESCRIPT_RECOMMENDED_RULES, UNICORN_RULES, defineConfig as defineBaseConfig, defineConfig as defineNodeConfig, defineConfig$1 as defineE2eConfig, defineConfig$2 as defineE2ePlaywrightConfig, defineConfig$3 as defineElectronConfig, defineConfig$4 as defineExpoConfig, defineConfig$5 as defineFumadocsConfig, defineConfig$6 as defineHonoConfig, defineConfig$7 as defineLibraryConfig, defineConfig$8 as defineMcpConfig, defineConfig$9 as defineNestConfig, defineConfig$10 as defineNextConfig, defineConfig$11 as defineReactConfig, defineConfig$12 as defineReactNativeConfig, defineConfig$13 as defineRootConfig, defineConfig$14 as defineSdkConfig, defineConfig$15 as defineTaroConfig };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-BqT_7tdF.js";import{i as e,r as t,t as n}from"./base.entry-ihV3q_2I.js";import"./node.js";import{defineConfig as r}from"./react.js";import{defineConfig as i}from"./hono.js";import{defineConfig as a}from"./mcp.js";import{r as o,t as s}from"./next.entry-9WqH5pU4.js";import{t as c}from"./taro.entry-BMIixeDL.js";import{i as l,r as u,t as d}from"./fumadocs.entry-CbNS_gTP.js";import{r as f,t as p}from"./react-native.entry-D2Dj46b7.js";import{defineConfig as m}from"./expo.js";import{t as h}from"./nest.entry-esm5OFt2.js";import{t as g}from"./electron.entry-DUsDae4u.js";import{defineConfig as _}from"./library.js";import{t as v}from"./e2e.entry-BovadSvn.js";import{r as
|
|
1
|
+
import"./rolldown-runtime-BqT_7tdF.js";import{i as e,r as t,t as n}from"./base.entry-ihV3q_2I.js";import"./node.js";import{defineConfig as r}from"./react.js";import{defineConfig as i}from"./hono.js";import{defineConfig as a}from"./mcp.js";import{r as o,t as s}from"./next.entry-9WqH5pU4.js";import{t as c}from"./taro.entry-BMIixeDL.js";import{i as l,r as u,t as d}from"./fumadocs.entry-CbNS_gTP.js";import{r as f,t as p}from"./react-native.entry-D2Dj46b7.js";import{defineConfig as m}from"./expo.js";import{t as h}from"./nest.entry-esm5OFt2.js";import{t as g}from"./electron.entry-DUsDae4u.js";import{defineConfig as _}from"./library.js";import{t as v}from"./e2e.entry-BovadSvn.js";import{t as y}from"./e2e-playwright.entry-D8R3Btl6.js";import{r as b,t as x}from"./sdk.entry-DpBT2LZv.js";import{r as S,t as C}from"./root.entry-DgJMQCn5.js";import{n as w,t as T}from"./unicorn.rules-0a_FuIjL.js";import{n as E,r as D,t as O}from"./typescript-eslint.rules-j0Y80OGu.js";export{t as ALL_RULES,w as ESLINT_CORE_RULES,O as ESLINT_RECOMMENDED_RULES,u as FUMADOCS_FILE_NAMING_EXEMPT_PATTERNS,l as FUMADOCS_SPECIAL_FILE_PATTERNS,o as NEXTJS_SPECIAL_FILE_PATTERNS,e as PLUGIN_DEFAULTS,f as REACT_NATIVE_TOOLCHAIN_IGNORE_PATTERNS,S as ROOT_WHITELIST_PATTERNS,b as SDK_GENERATED_PATTERNS,E as TYPESCRIPT_PROJECT_RULES,D as TYPESCRIPT_RECOMMENDED_RULES,T as UNICORN_RULES,n as defineBaseConfig,n as defineNodeConfig,v as defineE2eConfig,y as defineE2ePlaywrightConfig,g as defineElectronConfig,m as defineExpoConfig,d as defineFumadocsConfig,i as defineHonoConfig,_ as defineLibraryConfig,a as defineMcpConfig,h as defineNestConfig,s as defineNextConfig,r as defineReactConfig,p as defineReactNativeConfig,C as defineRootConfig,x as defineSdkConfig,c as defineTaroConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../rolldown-runtime-BqT_7tdF.js";import{defineRule as e,eslintCompatPlugin as t}from"@oxlint/plugins";function n(e){return/\/(apps|packages)\//.test(e)&&e.endsWith(`/package.json`)}function r(e){return e.endsWith(`-infrastructure`)}function i(e){return typeof e==`object`&&!!e}const a=e({meta:{type:`problem`,docs:{description:`禁止 apps/packages 层声明领域基础设施包依赖(ADR 0102:域细节只经域公开面流出)`}},createOnce(e){return{before(){if(!n(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let a=JSON.parse(n);if(!i(a)||!i(a.dependencies))return;let o=Object.keys(a.dependencies).filter(r);o.length>0&&e.report({node:t,message:`禁止 apps/packages 层声明领域基础设施包依赖(ADR 0102):域的持久化实现细节只经域公开面流出。发现依赖 [${o.join(`, `)}]。`})}catch{}}}}});function o(e){return/\/apps\//.test(e)&&e.endsWith(`/package.json`)}function s(e){return typeof e==`object`&&!!e}function c(e){return s(e)?Object.keys(e).filter(e=>e!==`.`):[]}const l=e({meta:{type:`problem`,docs:{description:`禁止 apps 层应用包声明多出口 exports,依据 ADR 0198:应用包 exports 只允许无或单一根出口,跨应用复用一律经根出口取件`}},createOnce(e){return{before(){if(!o(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!s(r))return;let i=c(r.exports);i.length>0&&e.report({node:t,message:`禁止 apps 层应用包声明多出口 exports,依据 ADR 0198:应用包 exports 只允许无或单一根出口,跨应用复用一律经根出口取件。发现子出口 [${i.join(`, `)}]。`})}catch{}}}}}),ee=/* @__PURE__ */ new Set([`tsgo`,`tsc`]),te={bareCompiler:`裸调 tsgo 或 tsc 执行类型检查`,legacyDevCliTypecheck:`使用 lzi-dev-cli typecheck 旧封装,应迁移至 lzi-tsgo typecheck`,wrapperWithoutConfig:`lzi-tsgo typecheck 未传 tsconfig 路径`,wrapperWithoutSubcommand:`调用 lzi-tsgo 未带 typecheck 子命令`};function ne(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}function u(e){return typeof e==`object`&&!!e}function d(e){return e===`typecheck`||e.startsWith(`typecheck:`)}function f(e){return e.split(/&&|\|\||;|\|/).map(e=>e.trim()).filter(e=>e.length>0)}function p(e){let t=e.split(/\s+/).filter(e=>e.length>0),n=``,r=[];for(let e of t)if(n)r.push(e);else{if(/^[A-Za-z_][A-Za-z0-9_]*=/.test(e))continue;n=e}return n?{command:n,args:r}:null}function m(e,t,n){let r=p(t);if(!r)return null;let i=r.command,a=r.args;return ee.has(i)?n||a.includes(`--noEmit`)?{key:e,kind:`bareCompiler`,segment:t}:null:n?i===`lzi-tsgo`?a[0]===`typecheck`?a.slice(1).some(e=>!e.startsWith(`-`))?null:{key:e,kind:`wrapperWithoutConfig`,segment:t}:{key:e,kind:`wrapperWithoutSubcommand`,segment:t}:i===`lzi-dev-cli`&&a[0]===`typecheck`?{key:e,kind:`legacyDevCliTypecheck`,segment:t}:null:null}function h(e){let t=[];for(let[n,r]of Object.entries(e)){if(typeof r!=`string`)continue;let e=d(n);for(let i of f(r)){let r=m(n,i,e);r&&t.push(r)}}return t}function g(e){if(!u(e))return null;let t=e.scripts;return u(t)?t:null}function _(e){return`scripts 键 ${e.key} ${te[e.kind]}。类型检查统一使用 lzi-tsgo typecheck 加 tsconfig 路径,依据 ADR 0057 与 ADR 0117。`}const v=e({meta:{type:`problem`,docs:{description:`禁止在 package.json scripts 中绕过 lzi-tsgo 封装执行类型检查`}},createOnce(e){return{before(){let t=e.filename;if(!ne(t))return!1},Program(t){let n=e.sourceCode.text;try{let r=g(JSON.parse(n));if(r){let n=h(r);for(let r of n)e.report({node:t,message:_(r)})}}catch{}}}}});function y(e){return/\/domains\/[^/]+\/implementation\/package\.json$/.test(e)}function b(e){return typeof e==`object`&&!!e}function re(e,t){if(e===`./domain`)return!0;let n=typeof t==`string`?t:b(t)?[t.types,t.import,t.require,t.default].filter(e=>typeof e==`string`).join(` `):``;return/(^|\/)dist\/domain(\.|\/|$)/.test(n)||/(^|\/)src\/domain(\/|$)/.test(n)}const ie={noDomainLayerSubpathExport:"禁止领域实现包声明领域分层子路径导出(ADR 0101):领域分层(domain/)为 implementation 包内私有,仓储端口应落位 contract 包;`./domain` 类子导出属违规逃逸通道。"},ae=e({meta:{type:`problem`,docs:{description:`禁止领域实现包声明领域分层子路径导出(ADR 0101 违规逃逸通道)`}},createOnce(e){return{before(){if(!y(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!b(r)||!b(r.exports))return;for(let[n,i]of Object.entries(r.exports))n!==`.`&&re(n,i)&&e.report({node:t,message:`${ie.noDomainLayerSubpathExport}(发现子路径 "${n}")`})}catch{}}}}}),oe=/* @__PURE__ */ new Set([`@types/bun`,`@types/node`,`@typescript/native-preview`,`oxfmt`,`oxlint`,`tsdown`,`turbo`]),se=[`@longzai-intelligence-agent-tools/`,`@longzai-intelligence-bun/`,`@longzai-intelligence-builder/`,`@longzai-intelligence-changelog/`,`@longzai-intelligence-decision/`,`@longzai-intelligence-dev-tools/`,`@longzai-intelligence-env/`,`@longzai-intelligence-git/`,`@longzai-intelligence-issues/`,`@longzai-intelligence-oxfmt/`,`@longzai-intelligence-oxlint/`,`@longzai-intelligence-release/`,`@longzai-intelligence-tsgo/`,`@longzai-intelligence-tsdown/`,`@longzai-intelligence-typescript/`,`@longzai-intelligence-vitest/`,`@longzai-intelligence-vscode/`],ce=/* @__PURE__ */ new Set([`@longzai-intelligence/typescript-config`]),le=/* @__PURE__ */ new Set([`@longzai-intelligence-dev-tools/vite-plugin`,`@longzai-intelligence-typescript/rolldown-plugin-type-boundary`]);function x(e){return/\/(apps|packages|domains|plugins)\//.test(e)&&e.endsWith(`/package.json`)}function S(e){return le.has(e)?!1:oe.has(e)||ce.has(e)?!0:se.some(t=>e.startsWith(t))}function C(e){return typeof e==`object`&&!!e}const w=e({meta:{type:`problem`,docs:{description:`禁止子包声明应放 workspace 根的开发依赖,依据 ADR 0036 根已声明与应放根类别由根统一承载`}},createOnce(e){return{before(){if(!x(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!C(r)||!C(r.devDependencies)||`workspaces`in r)return;let i=Object.keys(r.devDependencies).filter(S);i.length>0&&e.report({node:t,message:`禁止子包声明应放 workspace 根的开发依赖,ADR 0036 判定根已声明与应放根类别均由根统一承载,子包经 Bun hoisting 取用。发现依赖 [${i.join(`, `)}]。`})}catch{}}}}});function T(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}function E(e){return typeof e==`object`&&!!e}const D={noMitLicense:`禁止使用 MIT 协议。项目中的所有包都应使用 "license": "UNLICENSED"。`},O=e({meta:{type:`problem`,docs:{description:`禁止在 package.json 中使用 MIT 协议`}},createOnce(e){return{before(){let t=e.filename;if(!T(t))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);E(r)&&r.license===`MIT`&&e.report({node:t,message:D.noMitLicense})}catch{}}}}});function k(e){return/\/domains\/[^/]+\/infrastructure\/package\.json$/.test(e)}function A(e){return e.endsWith(`-infrastructure`)?`${e.slice(0,-15)}-implementation`:null}function j(e){return typeof e==`object`&&!!e}const M=e({meta:{type:`problem`,docs:{description:`禁止领域基础设施包依赖同域实现包(ADR 0101 依赖图只允许 infrastructure ──> contract)`}},createOnce(e){return{before(){if(!k(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!j(r)||typeof r.name!=`string`)return;let i=A(r.name);if(!i||!j(r.dependencies))return;i in r.dependencies&&e.report({node:t,message:`禁止领域基础设施包依赖同域实现包(ADR 0101):依赖图只允许 infrastructure ──> contract,发现依赖 "${i}"。`})}catch{}}}}});function N(e){return e.endsWith(`/package.json`)}const P=/^(?:\.{1,2}\/)?src\//;function F(e){return typeof e==`object`&&!!e}function I(e,t,n){if(typeof t==`string`)P.test(t)&&n.push({subpath:e,target:t});else if(F(t))for(let r of Object.values(t))I(e,r,n)}function L(e){let t=[];if(typeof e==`string`)return I(`.`,e,t),t;if(F(e))for(let[n,r]of Object.entries(e))I(n,r,t);return t}const R={noSrcExports:`禁止 exports 指向 src 源码(统一 dist 产物范式):包导出一律指向 dist 产物,指向源码会使消费方程序拉入本包源码编译。`},z=e({meta:{type:`problem`,docs:{description:`禁止 exports 指向 src 源码(统一 dist 产物范式门禁)`}},createOnce(e){return{before(){if(!N(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!F(r))return;let i=L(r.exports);for(let n of i)e.report({node:t,message:`${R.noSrcExports}(发现 "${n.subpath}" 指向 "${n.target}")`})}catch{}}}}}),B=[`-domain`,`-contract`,`-implementation`,`-infrastructure`];function V(e){return/\/domains\/[^/]+\/ui\/package\.json$/.test(e)}function H(e){return B.some(t=>e.endsWith(t))}function U(e){return typeof e==`object`&&!!e}const ue=e({meta:{type:`problem`,docs:{description:`禁止 domains ui 层声明域内四层包依赖,ADR 0127:UI 面域外依赖唯一指向生成式 sdk 客户端`}},createOnce(e){return{before(){if(!V(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!U(r)||!U(r.dependencies))return;let i=Object.keys(r.dependencies).filter(H);i.length>0&&e.report({node:t,message:`禁止 ui 层声明域内包依赖,ADR 0127:UI 面域外依赖唯一指向生成式 sdk 客户端,DDD 主体对 ui 全封闭。发现依赖 [${i.join(`, `)}]。`})}catch{}}}}});function de(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}function fe(e){return e.split(/&&|\|\||;|\|/).map(e=>e.trim()).filter(e=>e.length>0)}function pe(e){let t=e.split(/\s+/).filter(e=>e.length>0),n=``,r=[];for(let e of t)if(n)r.push(e);else{if(/^[A-Za-z_][A-Za-z0-9_]*=/.test(e))continue;n=e}return n?{command:n,args:r}:null}const me={buildToolchainMismatch:`build 脚本命令与所属预设的工具链不符`,buildProdToolchainMismatch:`build:prod 脚本命令与所属预设的工具链不符`,devToolchainMismatch:`dev 脚本命令与所属预设的工具链不符`};function W(e){return typeof e==`object`&&!!e}function he(e){if(!W(e))return!1;for(let t of[`dev`,`build`,`buildProd`]){let n=e[t];if(n!==void 0&&(!Array.isArray(n)||n.some(e=>typeof e!=`string`)))return!1}return!0}function ge(e){if(!W(e))return null;let t=e.scripts;return W(t)?t:null}function G(e,t,n,r){if(r===void 0||r.length===0)return[];let i=e[t];if(typeof i!=`string`)return[];let a=[];for(let e of fe(i)){let i=pe(e);i!==null&&(r.includes(i.command)||a.push({key:t,kind:n,command:i.command,allowedList:r.join(`、`)}))}return a}function K(e,t){return[...G(e,`dev`,`devToolchainMismatch`,t.dev),...G(e,`build`,`buildToolchainMismatch`,t.build),...G(e,`build:prod`,`buildProdToolchainMismatch`,t.buildProd)]}function _e(e){return`scripts 键 ${e.key} 使用命令 "${e.command}",${me[e.kind]},允许清单为 ${e.allowedList}。build 脚本形态按预设校验,依据 ADR 0220,请改用当前预设允许的命令。`}const ve=e({meta:{type:`problem`,docs:{description:`按预设注入的允许清单校验 package.json 的 dev 与 build 与 build:prod 脚本命令形态`},schema:[{type:`object`,properties:{dev:{type:`array`,items:{type:`string`}},build:{type:`array`,items:{type:`string`}},buildProd:{type:`array`,items:{type:`string`}}},additionalProperties:!1}]},createOnce(e){return{before(){let t=e.filename;if(!de(t))return!1},Program(t){let n=e.options?.[0];if(!he(n)||n.dev===void 0&&n.build===void 0&&n.buildProd===void 0)return;let r=e.sourceCode.text;try{let i=ge(JSON.parse(r));if(i){let r=K(i,n);for(let n of r)e.report({node:t,message:_e(n)})}}catch{}}}}}),q=[`mcp`,`cli`,`tui`,`dev`];function ye(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}const be=/^@longzai-intelligence-([a-z0-9][a-z0-9-]*)\//,xe=/^longzai-intelligence-[a-z0-9][a-z0-9-]*$/;function J(e){return typeof e==`object`&&!!e}function Se(e){let t=e.replace(/\\/g,`/`).split(`/`);for(let e=t.length-2;e>=0;--e){let n=t[e];if(n!==void 0&&xe.test(n))return n.slice(21)}return null}function Ce(e){let t=be.exec(e);return t===null?null:t[1]??null}function we(e,t){return Se(e)??Ce(t)}function Y(e){return`lzi-${e}`}function X(e){return e.includes(`/`)?e.slice(e.indexOf(`/`)+1):e}function Te(e,t,n){let r=Y(t),i=q.find(t=>e===t||e.endsWith(`-${t}`));if(i!==void 0)return`${r}-${i}`;if(n===void 0)return r;let a=X(n);return e.endsWith(`-${a}`)?`${r}-${a}`:r}function Z(e,t,n){let r=Y(t);return e===r||q.some(t=>e===`${r}-${t}`)?!0:n!==void 0&&e===`${r}-${X(n)}`}function Q(e,t){let n=e.bin;return typeof n==`string`?[X(t)]:J(n)?Object.keys(n):[]}const Ee={invalidBinName:`bin 命令名不符合 ADR 0049 完整名称规范,命令名须为 lzi- 前缀加项目全名的 kebab-case 形态,禁止缩写`};function De(e,t){return`${Ee.invalidBinName},实际命令名为 "${e}",应为 "${t}"。`}const Oe=e({meta:{type:`problem`,docs:{description:`校验 package.json 的 bin 命令名使用项目全名,禁止缩写,依据 ADR 0049`}},createOnce(e){return{before(){let t=e.filename;if(!ye(t))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!J(r)||typeof r.name!=`string`||r.bin===void 0||r.name.includes(`{{`))return;let i=we(e.filename,r.name);if(i===null)return;let a=Q(r,r.name);for(let n of a)n.includes(`{{`)||Z(n,i,r.name)||e.report({node:t,message:De(n,Te(n,i,r.name))})}catch{}}}}}),$=t({meta:{name:`@longzai-intelligence-oxlint/package-json-plugin`},rules:{"no-app-infrastructure-dependency":a,"no-app-subpath-exports":l,"no-bare-tsgo-invocation":v,"no-domain-layer-subpath-export":ae,"no-hoistable-dev-dependency":w,"no-mit-license":O,"no-sibling-implementation-dependency":M,"no-src-exports":z,"no-ui-domain-package-dependency":ue,"require-build-script-toolchain":ve,"require-full-project-bin-name":Oe}});export{$ as default,$ as packageJsonPlugin,K as detectBuildScriptToolchainViolations,Q as extractBinNames,c as extractSubpathExits,L as findSrcExportTargets,o as isAppLayerPackageJson,T as isPackageJson,Z as isValidBinName,O as noMitLicenseRule};
|
|
1
|
+
import"../rolldown-runtime-BqT_7tdF.js";import{defineRule as e,eslintCompatPlugin as t}from"@oxlint/plugins";function n(e){return/\/(apps|packages)\//.test(e)&&e.endsWith(`/package.json`)}function r(e){return e.endsWith(`-infrastructure`)}function i(e){return typeof e==`object`&&!!e}const a=e({meta:{type:`problem`,docs:{description:`禁止 apps/packages 层声明领域基础设施包依赖(ADR 0102:域细节只经域公开面流出)`}},createOnce(e){return{before(){if(!n(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let a=JSON.parse(n);if(!i(a)||!i(a.dependencies))return;let o=Object.keys(a.dependencies).filter(r);o.length>0&&e.report({node:t,message:`禁止 apps/packages 层声明领域基础设施包依赖(ADR 0102):域的持久化实现细节只经域公开面流出。发现依赖 [${o.join(`, `)}]。`})}catch{}}}}});function o(e){return/\/apps\//.test(e)&&e.endsWith(`/package.json`)}function s(e){return typeof e==`object`&&!!e}function c(e){return s(e)?Object.keys(e).filter(e=>e!==`.`):[]}const l=e({meta:{type:`problem`,docs:{description:`禁止 apps 层应用包声明多出口 exports,依据 ADR 0198:应用包 exports 只允许无或单一根出口,跨应用复用一律经根出口取件`}},createOnce(e){return{before(){if(!o(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!s(r))return;let i=c(r.exports);i.length>0&&e.report({node:t,message:`禁止 apps 层应用包声明多出口 exports,依据 ADR 0198:应用包 exports 只允许无或单一根出口,跨应用复用一律经根出口取件。发现子出口 [${i.join(`, `)}]。`})}catch{}}}}}),ee=/* @__PURE__ */ new Set([`tsgo`,`tsc`]),te={bareCompiler:`裸调 tsgo 或 tsc 执行类型检查`,legacyDevCliTypecheck:`使用 lzi-dev-cli typecheck 旧封装,应迁移至 lzi-tsgo typecheck`,wrapperWithoutConfig:`lzi-tsgo typecheck 未传 tsconfig 路径`,wrapperWithoutSubcommand:`调用 lzi-tsgo 未带 typecheck 子命令`};function u(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}function d(e){return typeof e==`object`&&!!e}function f(e){return e===`typecheck`||e.startsWith(`typecheck:`)}function p(e){return e.split(/&&|\|\||;|\|/).map(e=>e.trim()).filter(e=>e.length>0)}function m(e){let t=e.split(/\s+/).filter(e=>e.length>0),n=``,r=[];for(let e of t)if(n)r.push(e);else{if(/^[A-Za-z_][A-Za-z0-9_]*=/.test(e))continue;n=e}return n?{command:n,args:r}:null}function h(e,t,n){let r=m(t);if(!r)return null;let i=r.command,a=r.args;return ee.has(i)?n||a.includes(`--noEmit`)?{key:e,kind:`bareCompiler`,segment:t}:null:n?i===`lzi-tsgo`?a[0]===`typecheck`?a.slice(1).some(e=>!e.startsWith(`-`))?null:{key:e,kind:`wrapperWithoutConfig`,segment:t}:{key:e,kind:`wrapperWithoutSubcommand`,segment:t}:i===`lzi-dev-cli`&&a[0]===`typecheck`?{key:e,kind:`legacyDevCliTypecheck`,segment:t}:null:null}function g(e){let t=[];for(let[n,r]of Object.entries(e)){if(typeof r!=`string`)continue;let e=f(n);for(let i of p(r)){let r=h(n,i,e);r&&t.push(r)}}return t}function ne(e){if(!d(e))return null;let t=e.scripts;return d(t)?t:null}function re(e){return`scripts 键 ${e.key} ${te[e.kind]}。类型检查统一使用 lzi-tsgo typecheck 加 tsconfig 路径,依据 ADR 0057 与 ADR 0117。`}const ie=e({meta:{type:`problem`,docs:{description:`禁止在 package.json scripts 中绕过 lzi-tsgo 封装执行类型检查`}},createOnce(e){return{before(){let t=e.filename;if(!u(t))return!1},Program(t){let n=e.sourceCode.text;try{let r=ne(JSON.parse(n));if(r){let n=g(r);for(let r of n)e.report({node:t,message:re(r)})}}catch{}}}}});function ae(e){return/\/domains\/[^/]+\/implementation\/package\.json$/.test(e)}function _(e){return typeof e==`object`&&!!e}function oe(e,t){if(e===`./domain`)return!0;let n=typeof t==`string`?t:_(t)?[t.types,t.import,t.require,t.default].filter(e=>typeof e==`string`).join(` `):``;return/(^|\/)dist\/domain(\.|\/|$)/.test(n)||/(^|\/)src\/domain(\/|$)/.test(n)}const se={noDomainLayerSubpathExport:"禁止领域实现包声明领域分层子路径导出(ADR 0101):领域分层(domain/)为 implementation 包内私有,仓储端口应落位 contract 包;`./domain` 类子导出属违规逃逸通道。"},ce=e({meta:{type:`problem`,docs:{description:`禁止领域实现包声明领域分层子路径导出(ADR 0101 违规逃逸通道)`}},createOnce(e){return{before(){if(!ae(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!_(r)||!_(r.exports))return;for(let[n,i]of Object.entries(r.exports))n!==`.`&&oe(n,i)&&e.report({node:t,message:`${se.noDomainLayerSubpathExport}(发现子路径 "${n}")`})}catch{}}}}}),le=/* @__PURE__ */ new Set([`@types/bun`,`@types/node`,`@typescript/native-preview`,`oxfmt`,`oxlint`,`tsdown`,`turbo`]),ue=[`@longzai-intelligence-agent-tools/`,`@longzai-intelligence-bun/`,`@longzai-intelligence-builder/`,`@longzai-intelligence-changelog/`,`@longzai-intelligence-decision/`,`@longzai-intelligence-dev-tools/`,`@longzai-intelligence-env/`,`@longzai-intelligence-git/`,`@longzai-intelligence-issues/`,`@longzai-intelligence-oxfmt/`,`@longzai-intelligence-oxlint/`,`@longzai-intelligence-release/`,`@longzai-intelligence-tsgo/`,`@longzai-intelligence-tsdown/`,`@longzai-intelligence-typescript/`,`@longzai-intelligence-vitest/`,`@longzai-intelligence-vscode/`],de=/* @__PURE__ */ new Set([`@longzai-intelligence/typescript-config`]),fe=/* @__PURE__ */ new Set([`@longzai-intelligence-dev-tools/vite-plugin`,`@longzai-intelligence-typescript/rolldown-plugin-type-boundary`]);function pe(e){return/\/(apps|packages|domains|plugins)\//.test(e)&&e.endsWith(`/package.json`)}function me(e){return fe.has(e)?!1:le.has(e)||de.has(e)?!0:ue.some(t=>e.startsWith(t))}function v(e){return typeof e==`object`&&!!e}const y=e({meta:{type:`problem`,docs:{description:`禁止子包声明应放 workspace 根的开发依赖,依据 ADR 0036 根已声明与应放根类别由根统一承载`}},createOnce(e){return{before(){if(!pe(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!v(r)||!v(r.devDependencies)||`workspaces`in r)return;let i=Object.keys(r.devDependencies).filter(me);i.length>0&&e.report({node:t,message:`禁止子包声明应放 workspace 根的开发依赖,ADR 0036 判定根已声明与应放根类别均由根统一承载,子包经 Bun hoisting 取用。发现依赖 [${i.join(`, `)}]。`})}catch{}}}}});function b(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}function x(e){return typeof e==`object`&&!!e}const S={noMitLicense:`禁止使用 MIT 协议。项目中的所有包都应使用 "license": "UNLICENSED"。`},C=e({meta:{type:`problem`,docs:{description:`禁止在 package.json 中使用 MIT 协议`}},createOnce(e){return{before(){let t=e.filename;if(!b(t))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);x(r)&&r.license===`MIT`&&e.report({node:t,message:S.noMitLicense})}catch{}}}}});function w(e){return/\/domains\/[^/]+\/infrastructure\/package\.json$/.test(e)}function T(e){return e.endsWith(`-infrastructure`)?`${e.slice(0,-15)}-implementation`:null}function E(e){return typeof e==`object`&&!!e}const D=e({meta:{type:`problem`,docs:{description:`禁止领域基础设施包依赖同域实现包(ADR 0101 依赖图只允许 infrastructure ──> contract)`}},createOnce(e){return{before(){if(!w(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!E(r)||typeof r.name!=`string`)return;let i=T(r.name);if(!i||!E(r.dependencies))return;i in r.dependencies&&e.report({node:t,message:`禁止领域基础设施包依赖同域实现包(ADR 0101):依赖图只允许 infrastructure ──> contract,发现依赖 "${i}"。`})}catch{}}}}});function O(e){return e.endsWith(`/package.json`)}const k=/^(?:\.{1,2}\/)?src\//;function A(e){return typeof e==`object`&&!!e}function j(e,t,n){if(typeof t==`string`)k.test(t)&&n.push({subpath:e,target:t});else if(A(t))for(let r of Object.values(t))j(e,r,n)}function M(e){let t=[];if(typeof e==`string`)return j(`.`,e,t),t;if(A(e))for(let[n,r]of Object.entries(e))j(n,r,t);return t}const N={noSrcExports:`禁止 exports 指向 src 源码(统一 dist 产物范式):包导出一律指向 dist 产物,指向源码会使消费方程序拉入本包源码编译。`},P=e({meta:{type:`problem`,docs:{description:`禁止 exports 指向 src 源码(统一 dist 产物范式门禁)`}},createOnce(e){return{before(){if(!O(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!A(r))return;let i=M(r.exports);for(let n of i)e.report({node:t,message:`${N.noSrcExports}(发现 "${n.subpath}" 指向 "${n.target}")`})}catch{}}}}}),F=[`-domain`,`-contract`,`-implementation`,`-infrastructure`];function I(e){return/\/domains\/[^/]+\/ui\/package\.json$/.test(e)}function L(e){return F.some(t=>e.endsWith(t))}function R(e){return typeof e==`object`&&!!e}const z=e({meta:{type:`problem`,docs:{description:`禁止 domains ui 层声明域内四层包依赖,ADR 0127:UI 面域外依赖唯一指向生成式 sdk 客户端`}},createOnce(e){return{before(){if(!I(e.filename.replace(/\\/g,`/`)))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!R(r)||!R(r.dependencies))return;let i=Object.keys(r.dependencies).filter(L);i.length>0&&e.report({node:t,message:`禁止 ui 层声明域内包依赖,ADR 0127:UI 面域外依赖唯一指向生成式 sdk 客户端,DDD 主体对 ui 全封闭。发现依赖 [${i.join(`, `)}]。`})}catch{}}}}});function he(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}function ge(e){return e.split(/&&|\|\||;|\|/).map(e=>e.trim()).filter(e=>e.length>0)}function _e(e){let t=e.split(/\s+/).filter(e=>e.length>0),n=``,r=[];for(let e of t)if(n)r.push(e);else{if(/^[A-Za-z_][A-Za-z0-9_]*=/.test(e))continue;n=e}return n?{command:n,args:r}:null}const ve={buildToolchainMismatch:`build 脚本命令与所属预设的工具链不符`,buildProdToolchainMismatch:`build:prod 脚本命令与所属预设的工具链不符`,devToolchainMismatch:`dev 脚本命令与所属预设的工具链不符`};function B(e){return typeof e==`object`&&!!e}function ye(e){if(!B(e))return!1;for(let t of[`dev`,`build`,`buildProd`]){let n=e[t];if(n!==void 0&&(!Array.isArray(n)||n.some(e=>typeof e!=`string`)))return!1}return!0}function be(e){if(!B(e))return null;let t=e.scripts;return B(t)?t:null}function V(e,t,n,r){if(r===void 0||r.length===0)return[];let i=e[t];if(typeof i!=`string`)return[];let a=[];for(let e of ge(i)){let i=_e(e);i!==null&&(r.includes(i.command)||a.push({key:t,kind:n,command:i.command,allowedList:r.join(`、`)}))}return a}function H(e,t){return[...V(e,`dev`,`devToolchainMismatch`,t.dev),...V(e,`build`,`buildToolchainMismatch`,t.build),...V(e,`build:prod`,`buildProdToolchainMismatch`,t.buildProd)]}function xe(e){return`scripts 键 ${e.key} 使用命令 "${e.command}",${ve[e.kind]},允许清单为 ${e.allowedList}。build 脚本形态按预设校验,依据 ADR 0220,请改用当前预设允许的命令。`}const Se=e({meta:{type:`problem`,docs:{description:`按预设注入的允许清单校验 package.json 的 dev 与 build 与 build:prod 脚本命令形态`},schema:[{type:`object`,properties:{dev:{type:`array`,items:{type:`string`}},build:{type:`array`,items:{type:`string`}},buildProd:{type:`array`,items:{type:`string`}}},additionalProperties:!1}]},createOnce(e){return{before(){let t=e.filename;if(!he(t))return!1},Program(t){let n=e.options?.[0];if(!ye(n)||n.dev===void 0&&n.build===void 0&&n.buildProd===void 0)return;let r=e.sourceCode.text;try{let i=be(JSON.parse(r));if(i){let r=H(i,n);for(let n of r)e.report({node:t,message:xe(n)})}}catch{}}}}}),U=[`mcp`,`cli`,`tui`,`dev`];function Ce(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}const we=/^@longzai-intelligence-([a-z0-9][a-z0-9-]*)\//,Te=/^longzai-intelligence-[a-z0-9][a-z0-9-]*$/;function W(e){return typeof e==`object`&&!!e}function Ee(e){let t=e.replace(/\\/g,`/`).split(`/`);for(let e=t.length-2;e>=0;--e){let n=t[e];if(n!==void 0&&Te.test(n))return n.slice(21)}return null}function De(e){let t=we.exec(e);return t===null?null:t[1]??null}function Oe(e,t){return Ee(e)??De(t)}function G(e){return`lzi-${e}`}function K(e){return e.includes(`/`)?e.slice(e.indexOf(`/`)+1):e}function ke(e,t,n){let r=G(t),i=U.find(t=>e===t||e.endsWith(`-${t}`));if(i!==void 0)return`${r}-${i}`;if(n===void 0)return r;let a=K(n);return e.endsWith(`-${a}`)?`${r}-${a}`:r}function q(e,t,n){let r=G(t);return e===r||U.some(t=>e===`${r}-${t}`)?!0:n!==void 0&&e===`${r}-${K(n)}`}function J(e,t){let n=e.bin;return typeof n==`string`?[K(t)]:W(n)?Object.keys(n):[]}const Ae={invalidBinName:`bin 命令名不符合 ADR 0049 完整名称规范,命令名须为 lzi- 前缀加项目全名的 kebab-case 形态,禁止缩写`};function je(e,t){return`${Ae.invalidBinName},实际命令名为 "${e}",应为 "${t}"。`}const Me=e({meta:{type:`problem`,docs:{description:`校验 package.json 的 bin 命令名使用项目全名,禁止缩写,依据 ADR 0049`}},createOnce(e){return{before(){let t=e.filename;if(!Ce(t))return!1},Program(t){let n=e.sourceCode.text;try{let r=JSON.parse(n);if(!W(r)||typeof r.name!=`string`||r.bin===void 0||r.name.includes(`{{`))return;let i=Oe(e.filename,r.name);if(i===null)return;let a=J(r,r.name);for(let n of a)n.includes(`{{`)||q(n,i,r.name)||e.report({node:t,message:je(n,ke(n,i,r.name))})}catch{}}}}});function Ne(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}function Pe(e){return e.split(/&&|\|\||;|\|/).map(e=>e.trim()).filter(e=>e.length>0)}function Y(e){let t=e.split(/\s+/).filter(e=>e.length>0),n=``,r=[];for(let e of t)if(n)r.push(e);else{if(/^[A-Za-z_][A-Za-z0-9_]*=/.test(e))continue;n=e}return n?{command:n,args:r}:null}const Fe={testToolchainMismatch:`test 脚本命令与所属预设的工具链不符`,testWatchToolchainMismatch:`test:watch 脚本命令与所属预设的工具链不符`,testCoverageToolchainMismatch:`test:coverage 脚本命令与所属预设的工具链不符`};function X(e){return typeof e==`object`&&!!e}function Ie(e){if(!X(e))return!1;for(let t of[`test`,`testWatch`,`testCoverage`]){let n=e[t];if(n!==void 0&&(!Array.isArray(n)||n.some(e=>typeof e!=`string`)))return!1}return!0}function Le(e){if(!X(e))return null;let t=e.scripts;return X(t)?t:null}function Z(e,t,n,r){if(r===void 0||r.length===0)return[];let i=e[t];if(typeof i!=`string`)return[];let a=[];for(let e of Pe(i)){let i=Y(e);i!==null&&(r.includes(i.command)||a.push({key:t,kind:n,command:i.command,allowedList:r.join(`、`)}))}return a}function Q(e,t){return[...Z(e,`test`,`testToolchainMismatch`,t.test),...Z(e,`test:watch`,`testWatchToolchainMismatch`,t.testWatch),...Z(e,`test:coverage`,`testCoverageToolchainMismatch`,t.testCoverage)]}function Re(e){return`scripts 键 ${e.key} 使用命令 "${e.command}",${Fe[e.kind]},允许清单为 ${e.allowedList}。test 脚本形态按预设校验,依据 ADR 0227,请改用当前预设允许的命令。`}const ze=e({meta:{type:`problem`,docs:{description:`按预设注入的允许清单校验 package.json 的 test 与 test:watch 与 test:coverage 脚本命令形态`},schema:[{type:`object`,properties:{test:{type:`array`,items:{type:`string`}},testWatch:{type:`array`,items:{type:`string`}},testCoverage:{type:`array`,items:{type:`string`}}},additionalProperties:!1}]},createOnce(e){return{before(){let t=e.filename;if(!Ne(t))return!1},Program(t){let n=e.options?.[0];if(!Ie(n)||n.test===void 0&&n.testWatch===void 0&&n.testCoverage===void 0)return;let r=e.sourceCode.text;try{let i=Le(JSON.parse(r));if(i){let r=Q(i,n);for(let n of r)e.report({node:t,message:Re(n)})}}catch{}}}}}),$=t({meta:{name:`@longzai-intelligence-oxlint/package-json-plugin`},rules:{"no-app-infrastructure-dependency":a,"no-app-subpath-exports":l,"no-bare-tsgo-invocation":ie,"no-domain-layer-subpath-export":ce,"no-hoistable-dev-dependency":y,"no-mit-license":C,"no-sibling-implementation-dependency":D,"no-src-exports":P,"no-ui-domain-package-dependency":z,"require-build-script-toolchain":Se,"require-full-project-bin-name":Me,"require-test-script-toolchain":ze}});export{$ as default,$ as packageJsonPlugin,H as detectBuildScriptToolchainViolations,Q as detectTestScriptToolchainViolations,J as extractBinNames,c as extractSubpathExits,M as findSrcExportTargets,o as isAppLayerPackageJson,b as isPackageJson,q as isValidBinName,C as noMitLicenseRule};
|
package/dist/react.d.ts
CHANGED
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
import "./rolldown-runtime-BqT_7tdF.js";
|
|
2
2
|
import { t as PresetOptions } from "./preset-options.types-BWSmiunG.js";
|
|
3
3
|
import { n as OxlintConfigOverride, t as OxlintConfig } from "./index-lrryBFJ6.js";
|
|
4
|
+
/**
|
|
5
|
+
* react 域构建形态
|
|
6
|
+
*
|
|
7
|
+
* 工程形即应用宿主单元自身可起可构建,库形即产出 dist 产物
|
|
8
|
+
* 被应用宿主消费的界面库单元
|
|
9
|
+
*/
|
|
10
|
+
type BuildForm = 'application' | 'library';
|
|
11
|
+
/**
|
|
12
|
+
* react 域预设选项
|
|
13
|
+
*
|
|
14
|
+
* 在共享选项之上增加构建形态声明
|
|
15
|
+
*/
|
|
16
|
+
type ReactPresetOptions = PresetOptions & {
|
|
17
|
+
/**
|
|
18
|
+
* 构建形态声明,三键判据按形态规定死
|
|
19
|
+
*
|
|
20
|
+
* @default 'application'
|
|
21
|
+
*/
|
|
22
|
+
buildForm?: BuildForm;
|
|
23
|
+
};
|
|
4
24
|
/**
|
|
5
25
|
* 创建 Oxlint React 配置
|
|
6
26
|
*
|
|
7
|
-
* @param options -
|
|
27
|
+
* @param options - 预设选项,含构建形态声明与额外的规则、覆盖和忽略模式
|
|
8
28
|
* @returns 包含 React 和 JSX a11y 插件的 Oxlint 配置对象
|
|
9
29
|
*/
|
|
10
|
-
declare function defineConfig(options?:
|
|
30
|
+
declare function defineConfig(options?: ReactPresetOptions): OxlintConfig;
|
|
11
31
|
/**
|
|
12
32
|
* 默认 Oxlint React 配置实例
|
|
13
33
|
*/
|
|
14
34
|
declare const oxlintReactConfig: OxlintConfig;
|
|
15
|
-
export { type OxlintConfig, type OxlintConfigOverride, oxlintReactConfig as default, defineConfig };
|
|
35
|
+
export { type BuildForm, type OxlintConfig, type OxlintConfigOverride, type ReactPresetOptions, oxlintReactConfig as default, defineConfig };
|
package/dist/react.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-BqT_7tdF.js";import{s as e,t}from"./base.entry-ihV3q_2I.js";import{t as n}from"./ui-consumption.rules-KvXiDxx6.js";const r={"@longzai-intelligence-oxlint/package-json-plugin/require-build-script-toolchain":[`warn`,{dev:[`lzi-vite`],build:[`lzi-vite`],buildProd:[`bun`]}]};function i(
|
|
1
|
+
import"./rolldown-runtime-BqT_7tdF.js";import{s as e,t}from"./base.entry-ihV3q_2I.js";import{t as n}from"./ui-consumption.rules-KvXiDxx6.js";const r={"@longzai-intelligence-oxlint/package-json-plugin/require-build-script-toolchain":[`warn`,{dev:[`lzi-vite`],build:[`lzi-vite`],buildProd:[`bun`]}]},i={"@longzai-intelligence-oxlint/package-json-plugin/require-build-script-toolchain":[`warn`,{dev:[`lzi-builder`],build:[`lzi-builder`],buildProd:[`bun`]}]};function a(e){if(e===`library`)return i;if(e===`application`)return r;throw Error(`未知的构建形态 \`${String(e)}\`,react 域合法形态为 application 与 library`)}function o(r){let i=a(r?.buildForm??`application`),{buildForm:o,...s}=r??{},c=t();return{extends:[c],plugins:[`react`,`jsx-a11y`],...s,rules:{...i,...n,...s.rules},ignorePatterns:e([...c.ignorePatterns??[],...s.ignorePatterns??[]])}}const s=o();export{s as default,o as defineConfig};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence-oxlint/presets",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.27",
|
|
4
4
|
"description": "Longzai Intelligence oxlint 配置预设",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -53,6 +53,10 @@
|
|
|
53
53
|
"types": "./dist/e2e.d.ts",
|
|
54
54
|
"import": "./dist/e2e.js"
|
|
55
55
|
},
|
|
56
|
+
"./e2e-playwright": {
|
|
57
|
+
"types": "./dist/e2e-playwright.d.ts",
|
|
58
|
+
"import": "./dist/e2e-playwright.js"
|
|
59
|
+
},
|
|
56
60
|
"./sdk": {
|
|
57
61
|
"types": "./dist/sdk.d.ts",
|
|
58
62
|
"import": "./dist/sdk.js"
|
|
@@ -116,33 +120,33 @@
|
|
|
116
120
|
"zod": "^4.6.7"
|
|
117
121
|
},
|
|
118
122
|
"devDependencies": {
|
|
119
|
-
"@longzai-intelligence-oxlint/architecture-core-plugin": "0.2.
|
|
120
|
-
"@longzai-intelligence-oxlint/architecture-electron-plugin": "0.2.
|
|
121
|
-
"@longzai-intelligence-oxlint/architecture-library-plugin": "0.2.
|
|
122
|
-
"@longzai-intelligence-oxlint/code-style-plugin": "0.2.
|
|
123
|
-
"@longzai-intelligence-oxlint/composer-plugin": "0.2.
|
|
124
|
-
"@longzai-intelligence-oxlint/core": "0.2.
|
|
125
|
-
"@longzai-intelligence-oxlint/design-rules-plugin": "0.2.
|
|
126
|
-
"@longzai-intelligence-oxlint/elysia-route-plugin": "0.2.
|
|
127
|
-
"@longzai-intelligence-oxlint/eslint-config-plugin": "0.2.
|
|
128
|
-
"@longzai-intelligence-oxlint/file-naming-plugin": "0.2.
|
|
129
|
-
"@longzai-intelligence-oxlint/lzi-builder-config-plugin": "0.2.
|
|
130
|
-
"@longzai-intelligence-oxlint/lzi-config-plugin": "0.2.
|
|
131
|
-
"@longzai-intelligence-oxlint/nestjs-route-plugin": "0.2.
|
|
132
|
-
"@longzai-intelligence-oxlint/package-json-plugin": "0.2.
|
|
133
|
-
"@longzai-intelligence-oxlint/perfectionist-plugin": "0.2.
|
|
134
|
-
"@longzai-intelligence-oxlint/react-plugin": "0.2.
|
|
135
|
-
"@longzai-intelligence-oxlint/schema-type-separation-plugin": "0.2.
|
|
136
|
-
"@longzai-intelligence-oxlint/stylistic-plugin": "0.2.
|
|
137
|
-
"@longzai-intelligence-oxlint/tsconfig-plugin": "0.2.
|
|
138
|
-
"@longzai-intelligence-oxlint/tsdoc-plugin": "0.2.
|
|
139
|
-
"@longzai-intelligence-oxlint/tsdown-config-plugin": "0.2.
|
|
140
|
-
"@longzai-intelligence-oxlint/tsup-config-plugin": "0.2.
|
|
141
|
-
"@longzai-intelligence-oxlint/typeorm-plugin": "0.2.
|
|
142
|
-
"@longzai-intelligence-oxlint/typescript-eslint-plugin": "0.2.
|
|
143
|
-
"@longzai-intelligence-oxlint/utils": "0.2.
|
|
144
|
-
"@longzai-intelligence-oxlint/vitest-config-plugin": "0.2.
|
|
145
|
-
"@longzai-intelligence-oxlint/zod-plugin": "0.2.
|
|
123
|
+
"@longzai-intelligence-oxlint/architecture-core-plugin": "0.2.27",
|
|
124
|
+
"@longzai-intelligence-oxlint/architecture-electron-plugin": "0.2.27",
|
|
125
|
+
"@longzai-intelligence-oxlint/architecture-library-plugin": "0.2.27",
|
|
126
|
+
"@longzai-intelligence-oxlint/code-style-plugin": "0.2.27",
|
|
127
|
+
"@longzai-intelligence-oxlint/composer-plugin": "0.2.27",
|
|
128
|
+
"@longzai-intelligence-oxlint/core": "0.2.27",
|
|
129
|
+
"@longzai-intelligence-oxlint/design-rules-plugin": "0.2.27",
|
|
130
|
+
"@longzai-intelligence-oxlint/elysia-route-plugin": "0.2.27",
|
|
131
|
+
"@longzai-intelligence-oxlint/eslint-config-plugin": "0.2.27",
|
|
132
|
+
"@longzai-intelligence-oxlint/file-naming-plugin": "0.2.27",
|
|
133
|
+
"@longzai-intelligence-oxlint/lzi-builder-config-plugin": "0.2.27",
|
|
134
|
+
"@longzai-intelligence-oxlint/lzi-config-plugin": "0.2.27",
|
|
135
|
+
"@longzai-intelligence-oxlint/nestjs-route-plugin": "0.2.27",
|
|
136
|
+
"@longzai-intelligence-oxlint/package-json-plugin": "0.2.27",
|
|
137
|
+
"@longzai-intelligence-oxlint/perfectionist-plugin": "0.2.27",
|
|
138
|
+
"@longzai-intelligence-oxlint/react-plugin": "0.2.27",
|
|
139
|
+
"@longzai-intelligence-oxlint/schema-type-separation-plugin": "0.2.27",
|
|
140
|
+
"@longzai-intelligence-oxlint/stylistic-plugin": "0.2.27",
|
|
141
|
+
"@longzai-intelligence-oxlint/tsconfig-plugin": "0.2.27",
|
|
142
|
+
"@longzai-intelligence-oxlint/tsdoc-plugin": "0.2.27",
|
|
143
|
+
"@longzai-intelligence-oxlint/tsdown-config-plugin": "0.2.27",
|
|
144
|
+
"@longzai-intelligence-oxlint/tsup-config-plugin": "0.2.27",
|
|
145
|
+
"@longzai-intelligence-oxlint/typeorm-plugin": "0.2.27",
|
|
146
|
+
"@longzai-intelligence-oxlint/typescript-eslint-plugin": "0.2.27",
|
|
147
|
+
"@longzai-intelligence-oxlint/utils": "0.2.27",
|
|
148
|
+
"@longzai-intelligence-oxlint/vitest-config-plugin": "0.2.27",
|
|
149
|
+
"@longzai-intelligence-oxlint/zod-plugin": "0.2.27",
|
|
146
150
|
"@vitest/coverage-v8": "^4.1.10"
|
|
147
151
|
},
|
|
148
152
|
"peerDependencies": {
|