@longzai-intelligence-oxlint/tsconfig-plugin 0.1.36 → 0.1.37

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.
Files changed (2) hide show
  1. package/dist/index.js +1 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{defineRule as e,eslintCompatPlugin as t}from"@oxlint/plugins";import{existsSync as n,readFileSync as r}from"node:fs";import{dirname as i,join as a}from"node:path";const o=[`app.json`,`node.json`,`test.json`],s=[`./tsconfig/app.json`,`./tsconfig/node.json`,`./tsconfig/test.json`];function c(e){let t=e.replace(/\\/g,`/`);return(t.split(`/`).pop()??``)===`tsconfig.json`&&!t.includes(`/tsconfig/`)}function l(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function u(e,t){return n(e)?!0:(t(`缺少 tsconfig/ 目录。请创建 tsconfig/ 目录并配置子配置文件。`),!1)}function d(e,t){for(let r of o)n(a(e,r))||t(`缺少必需的 tsconfig 子配置文件 tsconfig/${r}。`)}function f(e,t){(!(`files`in e)||!Array.isArray(e.files)||e.files.length>0)&&t(`tsconfig.json 的 files 字段应为空数组 []。根配置仅用于引用子配置。`)}function p(e){return l(e)&&`path`in e}function m(e,t){if(!(`references`in e)||!Array.isArray(e.references)){t(`tsconfig.json 必须包含 references 字段。请配置项目引用。`);return}let n=new Set(e.references.map(e=>p(e)?String(e.path):``));for(let e of s)n.has(e)||t(`tsconfig.json 缺少必需的引用 "${e}"。`)}function h(e,t){let n=JSON.parse(e);if(!l(n)){t(`tsconfig.json 内容不是有效的对象。`);return}f(n,t),m(n,t)}function g(e,t){try{let n=r(e,`utf-8`),o=a(i(e),`tsconfig`);if(!u(o,t))return;d(o,t),h(n,t)}catch{}}const _=e({meta:{type:`problem`,docs:{description:`检查 tsconfig.json 是否正确使用 references 配置`}},createOnce(e){return{before(){if(!c(e.filename))return!1},Program(t){g(e.filename,n=>{e.report({node:t,message:n})})}}}}),v=t({meta:{name:`@longzai-intelligence-oxlint/tsconfig-plugin`},rules:{"tsconfig-references":_}});export{v as default,v as tsconfigPlugin,_ as tsconfigReferencesRule};
1
+ import{defineRule as e,eslintCompatPlugin as t}from"@oxlint/plugins";import{existsSync as n,readFileSync as r}from"node:fs";import{dirname as i,join as a}from"node:path";const o=[`app.json`,`node.json`,`test.json`],s=[`./tsconfig/app.json`,`./tsconfig/node.json`,`./tsconfig/test.json`];function c(e){let t=e.replace(/\\/g,`/`);return(t.split(`/`).pop()??``)===`tsconfig.json`&&!t.includes(`/tsconfig/`)}function l(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function u(e,t){return n(e)?!0:(t(`缺少 tsconfig/ 目录。请创建 tsconfig/ 目录并配置子配置文件。`),!1)}function d(e,t){for(let r of o)n(a(e,r))||t(`缺少必需的 tsconfig 子配置文件 tsconfig/${r}。`)}function f(e,t){(!(`files`in e)||!Array.isArray(e.files)||e.files.length>0)&&t(`tsconfig.json 的 files 字段应为空数组 []。根配置仅用于引用子配置。`)}function p(e){return l(e)&&`path`in e}function m(e,t){if(!(`references`in e)||!Array.isArray(e.references)){t(`tsconfig.json 必须包含 references 字段。请配置项目引用。`);return}let n=new Set(e.references.map(e=>p(e)?String(e.path):``));for(let e of s)n.has(e)||t(`tsconfig.json 缺少必需的引用 "${e}"。`)}function h(e,t){let n=JSON.parse(e);l(n)?(f(n,t),m(n,t)):t(`tsconfig.json 内容不是有效的对象。`)}function g(e,t){try{let n=r(e,`utf-8`),o=a(i(e),`tsconfig`);if(!u(o,t))return;d(o,t),h(n,t)}catch{}}const _=e({meta:{type:`problem`,docs:{description:`检查 tsconfig.json 是否正确使用 references 配置`}},createOnce(e){return{before(){if(!c(e.filename))return!1},Program(t){g(e.filename,n=>{e.report({node:t,message:n})})}}}}),v=t({meta:{name:`@longzai-intelligence-oxlint/tsconfig-plugin`},rules:{"tsconfig-references":_}});export{v as default,v as tsconfigPlugin,_ as tsconfigReferencesRule};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longzai-intelligence-oxlint/tsconfig-plugin",
3
- "version": "0.1.36",
3
+ "version": "0.1.37",
4
4
  "description": "Longzai Intelligence oxlint tsconfig 规则插件",
5
5
  "keywords": [
6
6
  "longzai-intelligence",
@@ -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.36",
46
+ "@longzai-intelligence-oxlint/core": "0.1.37",
47
47
  "@oxlint/plugins": "^1.74.0"
48
48
  },
49
49
  "devDependencies": {