@longzai-intelligence/oxlint-plugin-package-json 0.0.1

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.
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e={"@longzai-intelligence/package-json/no-mit-license":`error`};exports.recommended=e;
@@ -0,0 +1,6 @@
1
+ import { OxlintRules } from "@longzai-intelligence/oxlint-core";
2
+
3
+ //#region src/configs/recommended.config.d.ts
4
+ declare const recommended: OxlintRules;
5
+ //#endregion
6
+ export { recommended };
@@ -0,0 +1,6 @@
1
+ import { OxlintRules } from "@longzai-intelligence/oxlint-core";
2
+
3
+ //#region src/configs/recommended.config.d.ts
4
+ declare const recommended: OxlintRules;
5
+ //#endregion
6
+ export { recommended };
@@ -0,0 +1 @@
1
+ const e={"@longzai-intelligence/package-json/no-mit-license":`error`};export{e as recommended};
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});let e=require(`@oxlint/plugins`);function t(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}function n(e){return typeof e==`object`&&!!e}const r={noMitLicense:`禁止使用 MIT 协议。项目中的所有包都应使用 "license": "UNLICENSED"。`},i=(0,e.defineRule)({meta:{type:`problem`,docs:{description:`禁止在 package.json 中使用 MIT 协议`}},createOnce(e){return{before(){let n=e.filename;if(!t(n))return!1},Program(t){let i=e.sourceCode.text;try{let a=JSON.parse(i);n(a)&&a.license===`MIT`&&e.report({node:t,message:r.noMitLicense})}catch{}}}}}),a=(0,e.eslintCompatPlugin)({meta:{name:`@longzai-intelligence/package-json`},rules:{"no-mit-license":i}});exports.default=a,exports.packageJsonPlugin=a,exports.isPackageJson=t,exports.noMitLicenseRule=i;
@@ -0,0 +1,10 @@
1
+ import * as _$_oxlint_plugins0 from "@oxlint/plugins";
2
+
3
+ //#region src/rules/no-mit-license/index.d.ts
4
+ declare function isPackageJson(filePath: string): boolean;
5
+ declare const noMitLicenseRule: _$_oxlint_plugins0.Rule;
6
+ //#endregion
7
+ //#region src/index.d.ts
8
+ declare const packageJsonPlugin: _$_oxlint_plugins0.Plugin;
9
+ //#endregion
10
+ export { packageJsonPlugin as default, packageJsonPlugin, isPackageJson, noMitLicenseRule };
@@ -0,0 +1,10 @@
1
+ import * as _$_oxlint_plugins0 from "@oxlint/plugins";
2
+
3
+ //#region src/rules/no-mit-license/index.d.ts
4
+ declare function isPackageJson(filePath: string): boolean;
5
+ declare const noMitLicenseRule: _$_oxlint_plugins0.Rule;
6
+ //#endregion
7
+ //#region src/index.d.ts
8
+ declare const packageJsonPlugin: _$_oxlint_plugins0.Plugin;
9
+ //#endregion
10
+ export { packageJsonPlugin as default, packageJsonPlugin, isPackageJson, noMitLicenseRule };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{defineRule as e,eslintCompatPlugin as t}from"@oxlint/plugins";function n(e){return e.replace(/\\/g,`/`).endsWith(`/package.json`)}function r(e){return typeof e==`object`&&!!e}const i={noMitLicense:`禁止使用 MIT 协议。项目中的所有包都应使用 "license": "UNLICENSED"。`},a=e({meta:{type:`problem`,docs:{description:`禁止在 package.json 中使用 MIT 协议`}},createOnce(e){return{before(){let t=e.filename;if(!n(t))return!1},Program(t){let n=e.sourceCode.text;try{let a=JSON.parse(n);r(a)&&a.license===`MIT`&&e.report({node:t,message:i.noMitLicense})}catch{}}}}}),o=t({meta:{name:`@longzai-intelligence/package-json`},rules:{"no-mit-license":a}});export{o as default,o as packageJsonPlugin,n as isPackageJson,a as noMitLicenseRule};
package/package.json ADDED
@@ -0,0 +1,86 @@
1
+ {
2
+ "name": "@longzai-intelligence/oxlint-plugin-package-json",
3
+ "version": "0.0.1",
4
+ "license": "UNLICENSED",
5
+ "files": [
6
+ "dist"
7
+ ],
8
+ "type": "module",
9
+ "main": "./dist/index.cjs",
10
+ "module": "./dist/index.mjs",
11
+ "types": "./dist/index.d.mts",
12
+ "exports": {
13
+ ".": {
14
+ "types": {
15
+ "import": "./dist/index.d.mts",
16
+ "require": "./dist/index.d.cts"
17
+ },
18
+ "import": "./dist/index.mjs",
19
+ "require": "./dist/index.cjs"
20
+ },
21
+ "./configs/recommended": {
22
+ "types": {
23
+ "import": "./dist/configs/recommended.d.mts",
24
+ "require": "./dist/configs/recommended.d.cts"
25
+ },
26
+ "import": "./dist/configs/recommended.mjs",
27
+ "require": "./dist/configs/recommended.cjs"
28
+ }
29
+ },
30
+ "scripts": {
31
+ "build": "tsdown",
32
+ "build:prod": "NODE_ENV=production tsdown",
33
+ "prepublishOnly": "bun run build:prod",
34
+ "dev": "tsdown --watch",
35
+ "clean": "rimraf dist",
36
+ "test": "vitest run",
37
+ "test:watch": "vitest",
38
+ "test:coverage": "vitest run --coverage",
39
+ "lint": "bun run lint:oxlint",
40
+ "lint:oxlint": "oxlint",
41
+ "lint:eslint": "eslint .",
42
+ "lint:fix": "bun run oxc:fix",
43
+ "lint:fix:oxlint": "oxlint --fix",
44
+ "lint:fix:eslint": "eslint . --fix",
45
+ "typecheck": "bun run typecheck:app && bun run typecheck:node",
46
+ "typecheck:app": "tsc --noEmit -p tsconfig/app.json",
47
+ "typecheck:node": "tsc --noEmit -p tsconfig/node.json",
48
+ "lint:file": "bun run lint:file:oxlint",
49
+ "lint:file:oxlint": "oxlint",
50
+ "lint:file:eslint": "eslint",
51
+ "fmt": "oxfmt",
52
+ "fmt:check": "oxfmt --check",
53
+ "oxc": "bun run lint:oxlint && bun run fmt:check",
54
+ "oxc:fix": "bun run lint:fix:oxlint && bun run fmt"
55
+ },
56
+ "dependencies": {
57
+ "@longzai-intelligence/oxlint-core": "0.0.1",
58
+ "@oxlint/plugins": "^1.64.0"
59
+ },
60
+ "devDependencies": {
61
+ "@longzai-intelligence/eslint-preset-library": "0.2.13",
62
+ "@longzai-intelligence/oxlint-config": "0.0.1",
63
+ "@longzai-intelligence/oxlint-plugin-architecture": "0.0.1",
64
+ "@longzai-intelligence/oxlint-plugin-code-style": "0.0.1",
65
+ "@longzai-intelligence/oxlint-plugin-package-json": "0.0.1",
66
+ "@longzai-intelligence/oxlint-plugin-perfectionist": "0.0.1",
67
+ "@longzai-intelligence/oxlint-plugin-schema-type-separation": "0.0.1",
68
+ "@longzai-intelligence/oxlint-plugin-stylistic": "0.0.1",
69
+ "@longzai-intelligence/oxlint-plugin-tsdoc": "0.0.1",
70
+ "@longzai-intelligence/oxlint-plugin-typescript-eslint": "0.0.1",
71
+ "@longzai-intelligence/oxlint-plugin-zod": "0.0.1",
72
+ "@longzai-intelligence/oxlint-utils": "0.0.1",
73
+ "@longzai-intelligence/tsdown-config": "0.0.1",
74
+ "@longzai-intelligence/typescript-config": "0.0.3",
75
+ "@longzai-intelligence/vitest-config": "0.0.10",
76
+ "@types/node": "^25.7.0",
77
+ "oxlint": "^1.64.0",
78
+ "rimraf": "^6.1.3",
79
+ "tsdown": "^0.21.10",
80
+ "typescript": "^6.0.3",
81
+ "vitest": "^4.1.6"
82
+ },
83
+ "peerDependencies": {
84
+ "oxlint": ">=1.0.0"
85
+ }
86
+ }