@longzai-intelligence-oxlint/core 0.0.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/index.cjs +2 -0
- package/dist/index.d.cts +45 -0
- package/dist/index.d.mts +45 -0
- package/dist/index.mjs +2 -0
- package/package.json +65 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require(`node:path`),t=require(`node:path/win32`),n=require(`node:url`);const r={"max-lines":[`error`,{max:400,skipBlankLines:!0,skipComments:!0}],"max-lines-per-function":[`error`,{max:200,skipBlankLines:!0,skipComments:!0}],"no-useless-rename":`error`,"sort-imports":[`error`,{ignoreDeclarationSort:!0,ignoreMemberSort:!1,ignoreCase:!0}]},i={"typescript/no-explicit-any":`error`,"typescript/no-non-null-assertion":`error`,"typescript/no-extra-non-null-assertion":`error`,"typescript/no-misused-new":`error`,"typescript/no-this-alias":`error`,"typescript/no-unnecessary-type-constraint":`error`,"typescript/no-unsafe-argument":`error`,"typescript/no-unsafe-assignment":`error`,"typescript/no-unsafe-call":`error`,"typescript/no-unsafe-member-access":`error`,"typescript/no-unsafe-return":`error`,"typescript/no-require-imports":`error`,"typescript/triple-slash-reference":`error`},a=[{files:[`**/*.cjs`],rules:{"typescript/no-require-imports":`off`}}],o={"unicorn/prefer-node-protocol":`error`,"unicorn/no-empty-file":`error`},s=[`**/node_modules/**`,`**/dist/**`,`**/out/**`,`**/.next/**`,`**/coverage/**`,`**/.bun/**`,`**/tailwind/*.mjs`,`**/tsup.config.bundled_*.mjs`],c={...r,...i,...o},l=[`typescript`,`unicorn`,`import`],u=[...a];function d(e={}){let{rules:t,overrides:n,ignorePatterns:r,plugins:i,jsPlugins:a}=e;return{ignorePatterns:[...s,...r??[]],plugins:[...l,...i??[]],jsPlugins:a??[...l],rules:{...c,...t},overrides:[...u,...n??[]]}}function f(e){for(let t of[/\((file:\/\/[^):\s]+):\d+:\d+\)/,/\(([^):\s]+):\d+:\d+\)/,/at\s+(file:\/\/[^):\s]+):\d+:\d+/,/at\s+([^):\s]+):\d+:\d+/,/at\s+async\s+(file:\/\/[^):\s]+):\d+:\d+/,/at\s+async\s+([^):\s]+):\d+:\d+/]){let n=e.match(t);if(n?.[1])return n[1]}return null}function p(e){return e.endsWith(`/oxlint.config.ts`)||e.endsWith(`\\oxlint.config.ts`)||e.endsWith(`/oxlint.config.js`)||e.endsWith(`\\oxlint.config.js`)||e===`oxlint.config.ts`||e===`oxlint.config.js`}function m(e){return/^[A-Za-z]:/.test(e)||e.includes(`\\`)}function h(r){return r.startsWith(`file://`)?(0,e.dirname)((0,n.fileURLToPath)(r)):m(r)?(0,t.dirname)(r):(0,e.dirname)(r)}function g(e){let t=e.split(`
|
|
2
|
+
`);for(let e=0;e<t.length;e++){let n=t[e];if(!n)continue;let r=f(n);if(r&&p(r))return h(r)}}function _(){let e=Error().stack;if(e)return g(e)}exports.defineOxlintConfig=d,exports.extractDirFromFilePath=h,exports.extractFilePathFromStackLine=f,exports.inferCallerDir=_,exports.inferDirFromStack=g,exports.isOxlintConfigPath=p,exports.oxlintDefaults=r,exports.typescriptEslintDefaultOverrides=a,exports.typescriptEslintRecommendedDefaults=i,exports.unicornDefaults=o;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region src/types/config.types.d.ts
|
|
2
|
+
type OxlintSeverity = 'off' | 'warn' | 'error';
|
|
3
|
+
type OxlintRuleConfig = OxlintSeverity | [OxlintSeverity, ...unknown[]];
|
|
4
|
+
type OxlintRules = Record<string, OxlintRuleConfig>;
|
|
5
|
+
type OxlintConfigOverride = {
|
|
6
|
+
files: string[];
|
|
7
|
+
rules?: OxlintRules;
|
|
8
|
+
};
|
|
9
|
+
type OxlintConfig = {
|
|
10
|
+
extends?: OxlintConfig[];
|
|
11
|
+
plugins?: string[];
|
|
12
|
+
jsPlugins?: string[];
|
|
13
|
+
rules?: OxlintRules;
|
|
14
|
+
overrides?: OxlintConfigOverride[];
|
|
15
|
+
ignorePatterns?: string[];
|
|
16
|
+
};
|
|
17
|
+
type OxlintConfigOptions = {
|
|
18
|
+
rules?: OxlintRules;
|
|
19
|
+
overrides?: OxlintConfigOverride[];
|
|
20
|
+
ignorePatterns?: string[];
|
|
21
|
+
plugins?: string[];
|
|
22
|
+
jsPlugins?: string[];
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/defaults/define-oxlint-config.config.d.ts
|
|
26
|
+
declare function defineOxlintConfig(options?: OxlintConfigOptions): OxlintConfig;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/defaults/oxlint-defaults.config.d.ts
|
|
29
|
+
declare const oxlintDefaults: Record<string, OxlintRuleConfig>;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/defaults/typescript-eslint-defaults.config.d.ts
|
|
32
|
+
declare const typescriptEslintRecommendedDefaults: Record<string, OxlintRuleConfig>;
|
|
33
|
+
declare const typescriptEslintDefaultOverrides: OxlintConfigOverride[];
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/defaults/unicorn-defaults.config.d.ts
|
|
36
|
+
declare const unicornDefaults: Record<string, OxlintRuleConfig>;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/utils/infer-caller-dir.utils.d.ts
|
|
39
|
+
declare function extractFilePathFromStackLine(line: string): string | null;
|
|
40
|
+
declare function isOxlintConfigPath(filePath: string): boolean;
|
|
41
|
+
declare function extractDirFromFilePath(filePath: string): string;
|
|
42
|
+
declare function inferDirFromStack(stack: string): string | undefined;
|
|
43
|
+
declare function inferCallerDir(): string | undefined;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { OxlintConfig, OxlintConfigOptions, OxlintConfigOverride, OxlintRuleConfig, OxlintRules, OxlintSeverity, defineOxlintConfig, extractDirFromFilePath, extractFilePathFromStackLine, inferCallerDir, inferDirFromStack, isOxlintConfigPath, oxlintDefaults, typescriptEslintDefaultOverrides, typescriptEslintRecommendedDefaults, unicornDefaults };
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region src/types/config.types.d.ts
|
|
2
|
+
type OxlintSeverity = 'off' | 'warn' | 'error';
|
|
3
|
+
type OxlintRuleConfig = OxlintSeverity | [OxlintSeverity, ...unknown[]];
|
|
4
|
+
type OxlintRules = Record<string, OxlintRuleConfig>;
|
|
5
|
+
type OxlintConfigOverride = {
|
|
6
|
+
files: string[];
|
|
7
|
+
rules?: OxlintRules;
|
|
8
|
+
};
|
|
9
|
+
type OxlintConfig = {
|
|
10
|
+
extends?: OxlintConfig[];
|
|
11
|
+
plugins?: string[];
|
|
12
|
+
jsPlugins?: string[];
|
|
13
|
+
rules?: OxlintRules;
|
|
14
|
+
overrides?: OxlintConfigOverride[];
|
|
15
|
+
ignorePatterns?: string[];
|
|
16
|
+
};
|
|
17
|
+
type OxlintConfigOptions = {
|
|
18
|
+
rules?: OxlintRules;
|
|
19
|
+
overrides?: OxlintConfigOverride[];
|
|
20
|
+
ignorePatterns?: string[];
|
|
21
|
+
plugins?: string[];
|
|
22
|
+
jsPlugins?: string[];
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/defaults/define-oxlint-config.config.d.ts
|
|
26
|
+
declare function defineOxlintConfig(options?: OxlintConfigOptions): OxlintConfig;
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region src/defaults/oxlint-defaults.config.d.ts
|
|
29
|
+
declare const oxlintDefaults: Record<string, OxlintRuleConfig>;
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/defaults/typescript-eslint-defaults.config.d.ts
|
|
32
|
+
declare const typescriptEslintRecommendedDefaults: Record<string, OxlintRuleConfig>;
|
|
33
|
+
declare const typescriptEslintDefaultOverrides: OxlintConfigOverride[];
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region src/defaults/unicorn-defaults.config.d.ts
|
|
36
|
+
declare const unicornDefaults: Record<string, OxlintRuleConfig>;
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/utils/infer-caller-dir.utils.d.ts
|
|
39
|
+
declare function extractFilePathFromStackLine(line: string): string | null;
|
|
40
|
+
declare function isOxlintConfigPath(filePath: string): boolean;
|
|
41
|
+
declare function extractDirFromFilePath(filePath: string): string;
|
|
42
|
+
declare function inferDirFromStack(stack: string): string | undefined;
|
|
43
|
+
declare function inferCallerDir(): string | undefined;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { OxlintConfig, OxlintConfigOptions, OxlintConfigOverride, OxlintRuleConfig, OxlintRules, OxlintSeverity, defineOxlintConfig, extractDirFromFilePath, extractFilePathFromStackLine, inferCallerDir, inferDirFromStack, isOxlintConfigPath, oxlintDefaults, typescriptEslintDefaultOverrides, typescriptEslintRecommendedDefaults, unicornDefaults };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{dirname as e}from"node:path";import{dirname as t}from"node:path/win32";import{fileURLToPath as n}from"node:url";const r={"max-lines":[`error`,{max:400,skipBlankLines:!0,skipComments:!0}],"max-lines-per-function":[`error`,{max:200,skipBlankLines:!0,skipComments:!0}],"no-useless-rename":`error`,"sort-imports":[`error`,{ignoreDeclarationSort:!0,ignoreMemberSort:!1,ignoreCase:!0}]},i={"typescript/no-explicit-any":`error`,"typescript/no-non-null-assertion":`error`,"typescript/no-extra-non-null-assertion":`error`,"typescript/no-misused-new":`error`,"typescript/no-this-alias":`error`,"typescript/no-unnecessary-type-constraint":`error`,"typescript/no-unsafe-argument":`error`,"typescript/no-unsafe-assignment":`error`,"typescript/no-unsafe-call":`error`,"typescript/no-unsafe-member-access":`error`,"typescript/no-unsafe-return":`error`,"typescript/no-require-imports":`error`,"typescript/triple-slash-reference":`error`},a=[{files:[`**/*.cjs`],rules:{"typescript/no-require-imports":`off`}}],o={"unicorn/prefer-node-protocol":`error`,"unicorn/no-empty-file":`error`},s=[`**/node_modules/**`,`**/dist/**`,`**/out/**`,`**/.next/**`,`**/coverage/**`,`**/.bun/**`,`**/tailwind/*.mjs`,`**/tsup.config.bundled_*.mjs`],c={...r,...i,...o},l=[`typescript`,`unicorn`,`import`],u=[...a];function d(e={}){let{rules:t,overrides:n,ignorePatterns:r,plugins:i,jsPlugins:a}=e;return{ignorePatterns:[...s,...r??[]],plugins:[...l,...i??[]],jsPlugins:a??[...l],rules:{...c,...t},overrides:[...u,...n??[]]}}function f(e){for(let t of[/\((file:\/\/[^):\s]+):\d+:\d+\)/,/\(([^):\s]+):\d+:\d+\)/,/at\s+(file:\/\/[^):\s]+):\d+:\d+/,/at\s+([^):\s]+):\d+:\d+/,/at\s+async\s+(file:\/\/[^):\s]+):\d+:\d+/,/at\s+async\s+([^):\s]+):\d+:\d+/]){let n=e.match(t);if(n?.[1])return n[1]}return null}function p(e){return e.endsWith(`/oxlint.config.ts`)||e.endsWith(`\\oxlint.config.ts`)||e.endsWith(`/oxlint.config.js`)||e.endsWith(`\\oxlint.config.js`)||e===`oxlint.config.ts`||e===`oxlint.config.js`}function m(e){return/^[A-Za-z]:/.test(e)||e.includes(`\\`)}function h(r){return r.startsWith(`file://`)?e(n(r)):m(r)?t(r):e(r)}function g(e){let t=e.split(`
|
|
2
|
+
`);for(let e=0;e<t.length;e++){let n=t[e];if(!n)continue;let r=f(n);if(r&&p(r))return h(r)}}function _(){let e=Error().stack;if(e)return g(e)}export{d as defineOxlintConfig,h as extractDirFromFilePath,f as extractFilePathFromStackLine,_ as inferCallerDir,g as inferDirFromStack,p as isOxlintConfigPath,r as oxlintDefaults,a as typescriptEslintDefaultOverrides,i as typescriptEslintRecommendedDefaults,o as unicornDefaults};
|
package/package.json
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@longzai-intelligence-oxlint/core",
|
|
3
|
+
"version": "0.0.29",
|
|
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
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsdown",
|
|
24
|
+
"build:prod": "NODE_ENV=production tsdown",
|
|
25
|
+
"prepublishOnly": "bun run build:prod",
|
|
26
|
+
"dev": "tsdown --watch",
|
|
27
|
+
"clean": "rimraf dist tsconfig/.cache",
|
|
28
|
+
"test": "vitest run",
|
|
29
|
+
"test:watch": "vitest",
|
|
30
|
+
"test:coverage": "vitest run --coverage",
|
|
31
|
+
"lint": "oxlint && oxfmt --check",
|
|
32
|
+
"lint:fix": "oxlint --fix && oxfmt",
|
|
33
|
+
"typecheck": "bun run typecheck:app && bun run typecheck:node && bun run typecheck:test",
|
|
34
|
+
"typecheck:app": "tsgo --noEmit -p tsconfig/app.json",
|
|
35
|
+
"typecheck:node": "tsgo --noEmit -p tsconfig/node.json",
|
|
36
|
+
"typecheck:test": "tsgo --noEmit -p tsconfig/test.json"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@longzai-intelligence-oxlint/oxlint-config": "0.0.29",
|
|
40
|
+
"@longzai-intelligence-oxlint/plugin-architecture": "0.0.29",
|
|
41
|
+
"@longzai-intelligence-oxlint/plugin-code-style": "0.0.29",
|
|
42
|
+
"@longzai-intelligence-oxlint/plugin-package-json": "0.0.29",
|
|
43
|
+
"@longzai-intelligence-oxlint/plugin-perfectionist": "0.0.29",
|
|
44
|
+
"@longzai-intelligence-oxlint/plugin-schema-type-separation": "0.0.29",
|
|
45
|
+
"@longzai-intelligence-oxlint/plugin-stylistic": "0.0.29",
|
|
46
|
+
"@longzai-intelligence-oxlint/plugin-tsdoc": "0.0.29",
|
|
47
|
+
"@longzai-intelligence-oxlint/plugin-typescript-eslint": "0.0.29",
|
|
48
|
+
"@longzai-intelligence-oxlint/plugin-zod": "0.0.29",
|
|
49
|
+
"@longzai-intelligence/tsdown-config": "0.0.1",
|
|
50
|
+
"@longzai-intelligence/typescript-config": "0.0.3",
|
|
51
|
+
"@longzai-intelligence/vitest-config": "0.0.12",
|
|
52
|
+
"@oxlint/plugins": "^1.66.0",
|
|
53
|
+
"@types/node": "^25.9.1",
|
|
54
|
+
"@typescript/native-preview": "beta",
|
|
55
|
+
"@vitest/coverage-v8": "^4.1.7",
|
|
56
|
+
"oxlint": "^1.66.0",
|
|
57
|
+
"rimraf": "^6.1.3",
|
|
58
|
+
"tsdown": "^0.21.10",
|
|
59
|
+
"typescript": "^6.0.3",
|
|
60
|
+
"vitest": "^4.1.7"
|
|
61
|
+
},
|
|
62
|
+
"peerDependencies": {
|
|
63
|
+
"oxlint": ">=1.0.0"
|
|
64
|
+
}
|
|
65
|
+
}
|