@longzai-intelligence/oxlint-core 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.
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`);function r(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 i(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 a(e){return/^[A-Za-z]:/.test(e)||e.includes(`\\`)}function o(r){return r.startsWith(`file://`)?(0,e.dirname)((0,n.fileURLToPath)(r)):a(r)?(0,t.dirname)(r):(0,e.dirname)(r)}function s(e){let t=e.split(`
2
+ `);for(let e=0;e<t.length;e++){let n=t[e];if(!n)continue;let a=r(n);if(a&&i(a))return o(a)}}function c(){let e=Error().stack;if(e)return s(e)}exports.extractDirFromFilePath=o,exports.extractFilePathFromStackLine=r,exports.inferCallerDir=c,exports.inferDirFromStack=s,exports.isOxlintConfigPath=i;
@@ -0,0 +1,25 @@
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?: unknown[];
11
+ plugins?: string[];
12
+ jsPlugins?: string[];
13
+ rules?: OxlintRules;
14
+ overrides?: OxlintConfigOverride[];
15
+ ignorePatterns?: string[];
16
+ };
17
+ //#endregion
18
+ //#region src/utils/infer-caller-dir.utils.d.ts
19
+ declare function extractFilePathFromStackLine(line: string): string | null;
20
+ declare function isOxlintConfigPath(filePath: string): boolean;
21
+ declare function extractDirFromFilePath(filePath: string): string;
22
+ declare function inferDirFromStack(stack: string): string | undefined;
23
+ declare function inferCallerDir(): string | undefined;
24
+ //#endregion
25
+ export { OxlintConfig, OxlintConfigOverride, OxlintRuleConfig, OxlintRules, OxlintSeverity, extractDirFromFilePath, extractFilePathFromStackLine, inferCallerDir, inferDirFromStack, isOxlintConfigPath };
@@ -0,0 +1,25 @@
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?: unknown[];
11
+ plugins?: string[];
12
+ jsPlugins?: string[];
13
+ rules?: OxlintRules;
14
+ overrides?: OxlintConfigOverride[];
15
+ ignorePatterns?: string[];
16
+ };
17
+ //#endregion
18
+ //#region src/utils/infer-caller-dir.utils.d.ts
19
+ declare function extractFilePathFromStackLine(line: string): string | null;
20
+ declare function isOxlintConfigPath(filePath: string): boolean;
21
+ declare function extractDirFromFilePath(filePath: string): string;
22
+ declare function inferDirFromStack(stack: string): string | undefined;
23
+ declare function inferCallerDir(): string | undefined;
24
+ //#endregion
25
+ export { OxlintConfig, OxlintConfigOverride, OxlintRuleConfig, OxlintRules, OxlintSeverity, extractDirFromFilePath, extractFilePathFromStackLine, inferCallerDir, inferDirFromStack, isOxlintConfigPath };
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";function r(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 i(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 a(e){return/^[A-Za-z]:/.test(e)||e.includes(`\\`)}function o(r){return r.startsWith(`file://`)?e(n(r)):a(r)?t(r):e(r)}function s(e){let t=e.split(`
2
+ `);for(let e=0;e<t.length;e++){let n=t[e];if(!n)continue;let a=r(n);if(a&&i(a))return o(a)}}function c(){let e=Error().stack;if(e)return s(e)}export{o as extractDirFromFilePath,r as extractFilePathFromStackLine,c as inferCallerDir,s as inferDirFromStack,i as isOxlintConfigPath};
package/package.json ADDED
@@ -0,0 +1,75 @@
1
+ {
2
+ "name": "@longzai-intelligence/oxlint-core",
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
+ },
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": "bun run lint:oxlint",
32
+ "lint:oxlint": "oxlint",
33
+ "lint:eslint": "eslint .",
34
+ "lint:fix": "bun run oxc:fix",
35
+ "lint:fix:oxlint": "oxlint --fix",
36
+ "lint:fix:eslint": "eslint . --fix",
37
+ "typecheck": "bun run typecheck:app && bun run typecheck:node && bun run typecheck:test",
38
+ "typecheck:app": "tsc --noEmit -p tsconfig/app.json",
39
+ "typecheck:node": "tsc --noEmit -p tsconfig/node.json",
40
+ "typecheck:test": "tsc --noEmit -p tsconfig/test.json",
41
+ "lint:file": "bun run lint:file:oxlint",
42
+ "lint:file:oxlint": "oxlint",
43
+ "lint:file:eslint": "eslint",
44
+ "fmt": "oxfmt",
45
+ "fmt:check": "oxfmt --check",
46
+ "oxc": "bun run lint:oxlint && bun run fmt:check",
47
+ "oxc:fix": "bun run lint:fix:oxlint && bun run fmt"
48
+ },
49
+ "devDependencies": {
50
+ "@longzai-intelligence/eslint-preset-library": "0.2.13",
51
+ "@longzai-intelligence/oxlint-config": "0.0.1",
52
+ "@longzai-intelligence/oxlint-plugin-architecture": "0.0.1",
53
+ "@longzai-intelligence/oxlint-plugin-code-style": "0.0.1",
54
+ "@longzai-intelligence/oxlint-plugin-package-json": "0.0.1",
55
+ "@longzai-intelligence/oxlint-plugin-perfectionist": "0.0.1",
56
+ "@longzai-intelligence/oxlint-plugin-schema-type-separation": "0.0.1",
57
+ "@longzai-intelligence/oxlint-plugin-stylistic": "0.0.1",
58
+ "@longzai-intelligence/oxlint-plugin-tsdoc": "0.0.1",
59
+ "@longzai-intelligence/oxlint-plugin-typescript-eslint": "0.0.1",
60
+ "@longzai-intelligence/oxlint-plugin-zod": "0.0.1",
61
+ "@longzai-intelligence/tsdown-config": "0.0.1",
62
+ "@longzai-intelligence/typescript-config": "0.0.3",
63
+ "@longzai-intelligence/vitest-config": "0.0.10",
64
+ "@oxlint/plugins": "^1.64.0",
65
+ "@types/node": "^25.7.0",
66
+ "oxlint": "^1.64.0",
67
+ "rimraf": "^6.1.3",
68
+ "tsdown": "^0.21.10",
69
+ "typescript": "^6.0.3",
70
+ "vitest": "^4.1.6"
71
+ },
72
+ "peerDependencies": {
73
+ "oxlint": ">=1.0.0"
74
+ }
75
+ }