@longzai-intelligence-oxlint/lzi-config-plugin 0.1.26 → 0.1.29
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/configs/recommended.js +1 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
import"../rolldown-runtime-BqT_7tdF.js";const e={"@longzai-intelligence-oxlint/lzi-config-plugin/require-define-config":`error`};export{e as recommended};
|
|
1
|
+
import"../rolldown-runtime-BqT_7tdF.js";const e={"@longzai-intelligence-oxlint/lzi-config-plugin/no-empty-define-config":`error`,"@longzai-intelligence-oxlint/lzi-config-plugin/require-define-config":`error`};export{e as recommended};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
import "./rolldown-runtime-BqT_7tdF.js";
|
|
2
|
+
//#region src/rules/no-empty-define-config.rule.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* 禁止 `defineConfig` 空对象调用的门禁规则
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* 以文件名门禁限定 lzi 前缀配置文件,以调用入参形态判定是否空对象调用
|
|
8
|
+
* 空对象调用为自造变体形态,本规则在静态检查阶段拦截,判例正本见消费仓 `docs/records`
|
|
9
|
+
*/
|
|
10
|
+
declare const noEmptyDefineConfigRule: import("@oxlint/plugins").Rule;
|
|
11
|
+
//#endregion
|
|
2
12
|
//#region src/rules/require-define-config.rule.d.ts
|
|
3
13
|
/**
|
|
4
14
|
* 要求 lzi 工具配置默认导出携带类型防线的门禁规则
|
|
@@ -15,4 +25,4 @@ declare const requireDefineConfigRule: import("@oxlint/plugins").Rule;
|
|
|
15
25
|
*/
|
|
16
26
|
declare const lziConfigPlugin: import("@oxlint/plugins").Plugin;
|
|
17
27
|
//#endregion
|
|
18
|
-
export { lziConfigPlugin as default, lziConfigPlugin, requireDefineConfigRule };
|
|
28
|
+
export { lziConfigPlugin as default, lziConfigPlugin, noEmptyDefineConfigRule, requireDefineConfigRule };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime-BqT_7tdF.js";import{defineRule as e,eslintCompatPlugin as t}from"@oxlint/plugins";const n=/(^|\/)lzi-[^/]+\.config\.(ts|mts)$/;function r(e){let t=e.replace(/\\/g,`/`);return n.test(t)}function i(e){return typeof e==`object`&&!!e&&`type`in e}function a(e){return i(e)&&e.type===`ObjectExpression`}const o={bareDefaultExport:`lzi 工具配置的默认导出为裸对象字面量,缺少类型防线,字段写错时静态检查无法暴露。请改用 defineConfig 工厂包裹,工具未提供工厂时以 satisfies 标注配置类型。`},s=e({meta:{type:`problem`,docs:{description:`要求 lzi 工具配置默认导出经 defineConfig 或类型约束提供类型防线`}},createOnce(e){return{before(){let t=e.filename;if(!r(t))return!1},ExportDefaultDeclaration(t){t.type===`ExportDefaultDeclaration`&&a(t.declaration)&&e.report({node:t,message:o.bareDefaultExport})}}}})
|
|
1
|
+
import"./rolldown-runtime-BqT_7tdF.js";import{defineRule as e,eslintCompatPlugin as t}from"@oxlint/plugins";const n=/(^|\/)lzi-[^/]+\.config\.(ts|mts)$/;function r(e){let t=e.replace(/\\/g,`/`);return n.test(t)}function i(e){return typeof e==`object`&&!!e&&`type`in e}function a(e){return i(e)&&e.type===`ObjectExpression`}const o={bareDefaultExport:`lzi 工具配置的默认导出为裸对象字面量,缺少类型防线,字段写错时静态检查无法暴露。请改用 defineConfig 工厂包裹,工具未提供工厂时以 satisfies 标注配置类型。`},s=e({meta:{type:`problem`,docs:{description:`要求 lzi 工具配置默认导出经 defineConfig 或类型约束提供类型防线`}},createOnce(e){return{before(){let t=e.filename;if(!r(t))return!1},ExportDefaultDeclaration(t){t.type===`ExportDefaultDeclaration`&&a(t.declaration)&&e.report({node:t,message:o.bareDefaultExport})}}}});function c(e){return typeof e==`object`&&!!e&&`type`in e}function l(e){if(!c(e)||e.type!==`CallExpression`)return!1;let t=e.callee;if(!c(t)||t.type!==`Identifier`||t.name!==`defineConfig`)return!1;let n=e.arguments??[];if(n.length!==1)return!1;let[r]=n;return!c(r)||r.type!==`ObjectExpression`?!1:(r.properties??[]).length===0}const u={emptyDefineConfigCall:"`defineConfig` 不接受空对象字面量,空配置请使用无参调用 `defineConfig()`。配置文件形态以仓内同类配置先例为准。"},d=e({meta:{type:`problem`,docs:{description:"禁止 `defineConfig` 以空对象字面量为唯一入参,空配置应无参调用"}},createOnce(e){return{before(){let t=e.filename;if(!r(t))return!1},CallExpression(t){t.type===`CallExpression`&&l(t)&&e.report({node:t,message:u.emptyDefineConfigCall})}}}}),f=t({meta:{name:`@longzai-intelligence-oxlint/lzi-config-plugin`},rules:{"no-empty-define-config":d,"require-define-config":s}});export{f as default,f as lziConfigPlugin,d as noEmptyDefineConfigRule,s as requireDefineConfigRule};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@longzai-intelligence-oxlint/lzi-config-plugin",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.29",
|
|
4
4
|
"description": "Longzai Intelligence oxlint 工具配置规则插件",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"config",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"typecheck:test": "lzi-tsgo typecheck tsconfig/test.json"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@longzai-intelligence-oxlint/core": "0.1.
|
|
46
|
+
"@longzai-intelligence-oxlint/core": "0.1.29",
|
|
47
47
|
"@oxlint/plugins": "^1.74.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|