@pandacss/eslint-plugin 0.3.2 → 2.0.0-beta.5
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/{LICENSE → LICENSE.md} +1 -1
- package/README.md +219 -0
- package/dist/chunk-EYWJRDIR.js +1173 -0
- package/dist/index.d.ts +199 -0
- package/dist/index.js +143 -2535
- package/dist/oxlint.d.ts +12 -0
- package/dist/oxlint.js +11 -0
- package/dist/shared-B-c4H6nv.d.ts +126 -0
- package/package.json +45 -32
- package/dist/chunk-KBOB3H6E.mjs +0 -20
- package/dist/index.mjs +0 -2834
- package/dist/utils/worker.js +0 -4103
- package/dist/utils/worker.mjs +0 -4090
package/dist/oxlint.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { R as RuleModuleLike } from './shared-B-c4H6nv.js';
|
|
2
|
+
import '@pandacss/compiler';
|
|
3
|
+
import '@pandacss/config';
|
|
4
|
+
|
|
5
|
+
declare const _default: {
|
|
6
|
+
meta: {
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
rules: Record<string, RuleModuleLike>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export { _default as default };
|
package/dist/oxlint.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createPandaPlugin
|
|
3
|
+
} from "./chunk-EYWJRDIR.js";
|
|
4
|
+
|
|
5
|
+
// src/oxlint.ts
|
|
6
|
+
var configPath = process.env.PANDA_CONFIG_PATH;
|
|
7
|
+
var { rules } = await createPandaPlugin(configPath ? { configPath } : {});
|
|
8
|
+
var oxlint_default = { meta: { name: "@pandacss" }, rules };
|
|
9
|
+
export {
|
|
10
|
+
oxlint_default as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { Compiler, FileInspectionResult, createCompilerFromSnapshot, SourceRange } from '@pandacss/compiler';
|
|
2
|
+
import { LoadConfigResult } from '@pandacss/config';
|
|
3
|
+
|
|
4
|
+
interface InspectionCacheEntry {
|
|
5
|
+
sourceKey: string;
|
|
6
|
+
result: FileInspectionResult;
|
|
7
|
+
}
|
|
8
|
+
declare class Inspector {
|
|
9
|
+
#private;
|
|
10
|
+
inspect(compiler: Compiler, path: string, source: string): FileInspectionResult;
|
|
11
|
+
clear(compiler?: Compiler): void;
|
|
12
|
+
}
|
|
13
|
+
declare function sourceCacheKey(source: string): string;
|
|
14
|
+
|
|
15
|
+
interface PandaLintSettings {
|
|
16
|
+
configPath?: string;
|
|
17
|
+
cwd: string;
|
|
18
|
+
strictDiagnostics: boolean;
|
|
19
|
+
}
|
|
20
|
+
interface RuleContextLike {
|
|
21
|
+
cwd?: string;
|
|
22
|
+
settings?: Record<string, unknown>;
|
|
23
|
+
}
|
|
24
|
+
declare function resolvePandaSettings(context: RuleContextLike): PandaLintSettings;
|
|
25
|
+
|
|
26
|
+
interface ProjectContext {
|
|
27
|
+
compiler: Compiler;
|
|
28
|
+
configPath: string;
|
|
29
|
+
dependencies: string[];
|
|
30
|
+
}
|
|
31
|
+
interface ProjectCacheOptions {
|
|
32
|
+
load?: (settings: PandaLintSettings) => Promise<LoadConfigResult>;
|
|
33
|
+
createCompiler?: typeof createCompilerFromSnapshot;
|
|
34
|
+
}
|
|
35
|
+
declare class ProjectCache {
|
|
36
|
+
#private;
|
|
37
|
+
constructor(options?: ProjectCacheOptions);
|
|
38
|
+
get(settings: PandaLintSettings): Promise<ProjectContext>;
|
|
39
|
+
clear(): void;
|
|
40
|
+
}
|
|
41
|
+
declare function projectCacheKey(settings: PandaLintSettings): string;
|
|
42
|
+
|
|
43
|
+
interface SourceCodeLike {
|
|
44
|
+
text?: string;
|
|
45
|
+
getText?: () => string;
|
|
46
|
+
}
|
|
47
|
+
interface LintRuleContextLike extends RuleContextLike {
|
|
48
|
+
filename?: string;
|
|
49
|
+
physicalFilename?: string;
|
|
50
|
+
sourceCode?: SourceCodeLike;
|
|
51
|
+
getFilename?: () => string;
|
|
52
|
+
getPhysicalFilename?: () => string;
|
|
53
|
+
getSourceCode?: () => SourceCodeLike;
|
|
54
|
+
}
|
|
55
|
+
interface LintInspection {
|
|
56
|
+
project: ProjectContext;
|
|
57
|
+
settings: PandaLintSettings;
|
|
58
|
+
path: string;
|
|
59
|
+
source: string;
|
|
60
|
+
result: FileInspectionResult;
|
|
61
|
+
}
|
|
62
|
+
interface LinterOptions {
|
|
63
|
+
projectCache?: ProjectCache;
|
|
64
|
+
inspector?: Inspector;
|
|
65
|
+
}
|
|
66
|
+
declare class Linter {
|
|
67
|
+
#private;
|
|
68
|
+
constructor(options?: LinterOptions);
|
|
69
|
+
getProject(context: LintRuleContextLike): Promise<ProjectContext>;
|
|
70
|
+
inspect(context: LintRuleContextLike): Promise<LintInspection>;
|
|
71
|
+
inspectProject(project: ProjectContext, path: string, source: string): FileInspectionResult;
|
|
72
|
+
clear(): void;
|
|
73
|
+
}
|
|
74
|
+
declare function getContextFilename(context: LintRuleContextLike): string;
|
|
75
|
+
declare function getContextSource(context: LintRuleContextLike): string;
|
|
76
|
+
|
|
77
|
+
interface RuleFixer {
|
|
78
|
+
replaceTextRange(range: [number, number], text: string): unknown;
|
|
79
|
+
}
|
|
80
|
+
interface SuggestionDescriptor {
|
|
81
|
+
desc: string;
|
|
82
|
+
fix: (fixer: RuleFixer) => unknown;
|
|
83
|
+
}
|
|
84
|
+
interface ReportDescriptor {
|
|
85
|
+
messageId: string;
|
|
86
|
+
data?: Record<string, string>;
|
|
87
|
+
loc?: {
|
|
88
|
+
start: {
|
|
89
|
+
line: number;
|
|
90
|
+
column: number;
|
|
91
|
+
};
|
|
92
|
+
end: {
|
|
93
|
+
line: number;
|
|
94
|
+
column: number;
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
suggest?: SuggestionDescriptor[];
|
|
98
|
+
fix?: (fixer: RuleFixer) => unknown;
|
|
99
|
+
}
|
|
100
|
+
interface RuleContextWithReport extends LintRuleContextLike {
|
|
101
|
+
report: (descriptor: ReportDescriptor) => void;
|
|
102
|
+
options?: readonly unknown[];
|
|
103
|
+
}
|
|
104
|
+
interface RuleModuleLike {
|
|
105
|
+
meta: {
|
|
106
|
+
type: 'problem' | 'suggestion' | 'layout';
|
|
107
|
+
docs: {
|
|
108
|
+
description: string;
|
|
109
|
+
url?: string;
|
|
110
|
+
};
|
|
111
|
+
schema: unknown[];
|
|
112
|
+
messages: Record<string, string>;
|
|
113
|
+
hasSuggestions?: boolean;
|
|
114
|
+
fixable?: 'code' | 'whitespace';
|
|
115
|
+
};
|
|
116
|
+
create: (context: RuleContextWithReport) => Record<string, () => void>;
|
|
117
|
+
}
|
|
118
|
+
type Inspect = (context: LintRuleContextLike) => FileInspectionResult | undefined;
|
|
119
|
+
/** Full source text from a rule context (ESLint exposes `.text`, oxlint `getText()`). */
|
|
120
|
+
declare function getSourceText(context: RuleContextWithReport): string;
|
|
121
|
+
/** UTF-8 byte offset (Panda spans) → string index (ESLint fix ranges). */
|
|
122
|
+
declare function byteToIndex(text: string, byteOffset: number): number;
|
|
123
|
+
/** ESLint columns are 0-based; Panda source ranges are 1-based. */
|
|
124
|
+
declare function toEslintLoc(range: SourceRange): ReportDescriptor['loc'];
|
|
125
|
+
|
|
126
|
+
export { type Inspect as I, Linter as L, type ProjectContext as P, type RuleModuleLike as R, type SourceCodeLike as S, type RuleContextWithReport as a, type InspectionCacheEntry as b, Inspector as c, type LintRuleContextLike as d, type LintInspection as e, type LinterOptions as f, getContextFilename as g, getContextSource as h, type ProjectCacheOptions as i, ProjectCache as j, type PandaLintSettings as k, type RuleContextLike as l, type RuleFixer as m, type SuggestionDescriptor as n, type ReportDescriptor as o, projectCacheKey as p, getSourceText as q, resolvePandaSettings as r, sourceCacheKey as s, byteToIndex as t, toEslintLoc as u };
|
package/package.json
CHANGED
|
@@ -1,52 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pandacss/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
3
|
+
"version": "2.0.0-beta.5",
|
|
4
|
+
"description": "ESLint rules for Panda CSS",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"eslint",
|
|
7
|
+
"eslintplugin",
|
|
8
|
+
"eslint-plugin",
|
|
9
|
+
"panda",
|
|
10
|
+
"pandacss",
|
|
11
|
+
"css-in-js"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
13
16
|
"exports": {
|
|
14
17
|
".": {
|
|
15
18
|
"source": "./src/index.ts",
|
|
16
19
|
"types": "./dist/index.d.ts",
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./oxlint": {
|
|
23
|
+
"source": "./src/oxlint.ts",
|
|
24
|
+
"types": "./dist/oxlint.d.ts",
|
|
25
|
+
"default": "./dist/oxlint.js"
|
|
22
26
|
},
|
|
23
27
|
"./package.json": "./package.json"
|
|
24
28
|
},
|
|
29
|
+
"author": "Segun Adebayo <joseshegs@gmail.com>",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"sideEffects": false,
|
|
32
|
+
"homepage": "https://panda-css.com",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "git+https://github.com/chakra-ui/panda.git",
|
|
36
|
+
"directory": "packages/eslint-plugin"
|
|
37
|
+
},
|
|
38
|
+
"publishConfig": {
|
|
39
|
+
"access": "public"
|
|
40
|
+
},
|
|
25
41
|
"files": [
|
|
26
42
|
"dist"
|
|
27
43
|
],
|
|
28
44
|
"dependencies": {
|
|
29
|
-
"@pandacss/
|
|
30
|
-
"@pandacss/
|
|
31
|
-
"@pandacss/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"@typescript-eslint/
|
|
35
|
-
"
|
|
36
|
-
"micromatch": "^4.0.8",
|
|
37
|
-
"synckit": "^0.9.0"
|
|
45
|
+
"@pandacss/compiler": "2.0.0-beta.5",
|
|
46
|
+
"@pandacss/compiler-shared": "2.0.0-beta.5",
|
|
47
|
+
"@pandacss/config": "2.0.0-beta.5"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@typescript-eslint/parser": "8.58.2",
|
|
51
|
+
"eslint": "9.39.1"
|
|
38
52
|
},
|
|
39
53
|
"peerDependencies": {
|
|
40
|
-
"eslint": "
|
|
54
|
+
"eslint": ">=9"
|
|
41
55
|
},
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"typescript": "^5.7.2"
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=22"
|
|
45
58
|
},
|
|
46
59
|
"scripts": {
|
|
47
|
-
"build": "tsup",
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
60
|
+
"build": "tsup src/index.ts src/oxlint.ts --format=esm --platform=node --dts",
|
|
61
|
+
"build:fast": "tsup src/index.ts src/oxlint.ts --format=esm --platform=node --no-dts",
|
|
62
|
+
"dev": "pnpm build:fast --watch",
|
|
63
|
+
"test": "vitest run"
|
|
51
64
|
}
|
|
52
65
|
}
|
package/dist/chunk-KBOB3H6E.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2
|
-
var __esm = (fn, res) => function __init() {
|
|
3
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
4
|
-
};
|
|
5
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
6
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
// ../node_modules/.pnpm/tsup@8.3.6_postcss@8.5.6_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js
|
|
10
|
-
var init_esm_shims = __esm({
|
|
11
|
-
"../node_modules/.pnpm/tsup@8.3.6_postcss@8.5.6_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
12
|
-
"use strict";
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
__esm,
|
|
18
|
-
__commonJS,
|
|
19
|
-
init_esm_shims
|
|
20
|
-
};
|