@pandacss/eslint-plugin 0.3.2 → 2.0.0-beta.11
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 +232 -0
- package/dist/chunk-QIP545JU.js +1261 -0
- package/dist/index.d.ts +214 -0
- package/dist/index.js +149 -2535
- package/dist/oxlint.d.ts +12 -0
- package/dist/oxlint.js +11 -0
- package/dist/shared-BdjJwg93.d.ts +109 -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-BdjJwg93.js';
|
|
2
|
+
import '@pandacss/compiler';
|
|
3
|
+
import '@pandacss/compiler/tooling';
|
|
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-QIP545JU.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,109 @@
|
|
|
1
|
+
import { FileInspectionResult, SourceRange } from '@pandacss/compiler';
|
|
2
|
+
import { Project, FileInspector } from '@pandacss/compiler/tooling';
|
|
3
|
+
|
|
4
|
+
interface PandaLintSettings {
|
|
5
|
+
configPath?: string;
|
|
6
|
+
cwd: string;
|
|
7
|
+
strictDiagnostics: boolean;
|
|
8
|
+
}
|
|
9
|
+
interface RuleContextLike {
|
|
10
|
+
cwd?: string;
|
|
11
|
+
settings?: Record<string, unknown>;
|
|
12
|
+
}
|
|
13
|
+
declare function resolvePandaSettings(context: RuleContextLike): PandaLintSettings;
|
|
14
|
+
|
|
15
|
+
interface ProjectCacheOptions {
|
|
16
|
+
createProject?: (settings: PandaLintSettings) => Promise<Project>;
|
|
17
|
+
}
|
|
18
|
+
declare class ProjectCache {
|
|
19
|
+
#private;
|
|
20
|
+
constructor(options?: ProjectCacheOptions);
|
|
21
|
+
get(settings: PandaLintSettings): Promise<Project>;
|
|
22
|
+
clear(): void;
|
|
23
|
+
}
|
|
24
|
+
declare function projectCacheKey(settings: PandaLintSettings): string;
|
|
25
|
+
|
|
26
|
+
interface SourceCodeLike {
|
|
27
|
+
text?: string;
|
|
28
|
+
getText?: () => string;
|
|
29
|
+
}
|
|
30
|
+
interface LintRuleContextLike extends RuleContextLike {
|
|
31
|
+
filename?: string;
|
|
32
|
+
physicalFilename?: string;
|
|
33
|
+
sourceCode?: SourceCodeLike;
|
|
34
|
+
getFilename?: () => string;
|
|
35
|
+
getPhysicalFilename?: () => string;
|
|
36
|
+
getSourceCode?: () => SourceCodeLike;
|
|
37
|
+
}
|
|
38
|
+
interface LintInspection {
|
|
39
|
+
project: Project;
|
|
40
|
+
settings: PandaLintSettings;
|
|
41
|
+
path: string;
|
|
42
|
+
source: string;
|
|
43
|
+
result: FileInspectionResult;
|
|
44
|
+
}
|
|
45
|
+
interface LinterOptions {
|
|
46
|
+
projectCache?: ProjectCache;
|
|
47
|
+
inspector?: FileInspector;
|
|
48
|
+
}
|
|
49
|
+
declare class Linter {
|
|
50
|
+
#private;
|
|
51
|
+
constructor(options?: LinterOptions);
|
|
52
|
+
getProject(context: LintRuleContextLike): Promise<Project>;
|
|
53
|
+
inspect(context: LintRuleContextLike): Promise<LintInspection>;
|
|
54
|
+
inspectProject(project: Project, path: string, source: string): FileInspectionResult;
|
|
55
|
+
clear(): void;
|
|
56
|
+
}
|
|
57
|
+
declare function getContextFilename(context: LintRuleContextLike): string;
|
|
58
|
+
declare function getContextSource(context: LintRuleContextLike): string;
|
|
59
|
+
|
|
60
|
+
interface RuleFixer {
|
|
61
|
+
replaceTextRange(range: [number, number], text: string): unknown;
|
|
62
|
+
}
|
|
63
|
+
interface SuggestionDescriptor {
|
|
64
|
+
desc: string;
|
|
65
|
+
fix: (fixer: RuleFixer) => unknown;
|
|
66
|
+
}
|
|
67
|
+
interface ReportDescriptor {
|
|
68
|
+
messageId: string;
|
|
69
|
+
data?: Record<string, string>;
|
|
70
|
+
loc?: {
|
|
71
|
+
start: {
|
|
72
|
+
line: number;
|
|
73
|
+
column: number;
|
|
74
|
+
};
|
|
75
|
+
end: {
|
|
76
|
+
line: number;
|
|
77
|
+
column: number;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
suggest?: SuggestionDescriptor[];
|
|
81
|
+
fix?: (fixer: RuleFixer) => unknown;
|
|
82
|
+
}
|
|
83
|
+
interface RuleContextWithReport extends LintRuleContextLike {
|
|
84
|
+
report: (descriptor: ReportDescriptor) => void;
|
|
85
|
+
options?: readonly unknown[];
|
|
86
|
+
}
|
|
87
|
+
interface RuleModuleLike {
|
|
88
|
+
meta: {
|
|
89
|
+
type: 'problem' | 'suggestion' | 'layout';
|
|
90
|
+
docs: {
|
|
91
|
+
description: string;
|
|
92
|
+
url?: string;
|
|
93
|
+
};
|
|
94
|
+
schema: unknown[];
|
|
95
|
+
messages: Record<string, string>;
|
|
96
|
+
hasSuggestions?: boolean;
|
|
97
|
+
fixable?: 'code' | 'whitespace';
|
|
98
|
+
};
|
|
99
|
+
create: (context: RuleContextWithReport) => Record<string, () => void>;
|
|
100
|
+
}
|
|
101
|
+
type Inspect = (context: LintRuleContextLike) => FileInspectionResult | undefined;
|
|
102
|
+
/** Full source text from a rule context (ESLint exposes `.text`, oxlint `getText()`). */
|
|
103
|
+
declare function getSourceText(context: RuleContextWithReport): string;
|
|
104
|
+
/** UTF-8 byte offset (Panda spans) → string index (ESLint fix ranges). */
|
|
105
|
+
declare function byteToIndex(text: string, byteOffset: number): number;
|
|
106
|
+
/** ESLint columns are 0-based; Panda source ranges are 1-based. */
|
|
107
|
+
declare function toEslintLoc(range: SourceRange): ReportDescriptor['loc'];
|
|
108
|
+
|
|
109
|
+
export { type Inspect as I, Linter as L, type ProjectCacheOptions as P, type RuleModuleLike as R, type SourceCodeLike as S, type RuleContextWithReport as a, type LintRuleContextLike as b, type LintInspection as c, type LinterOptions as d, getContextSource as e, ProjectCache as f, getContextFilename as g, type PandaLintSettings as h, type RuleContextLike as i, type RuleFixer as j, type SuggestionDescriptor as k, type ReportDescriptor as l, getSourceText as m, byteToIndex as n, projectCacheKey as p, resolvePandaSettings as r, toEslintLoc as t };
|
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.11",
|
|
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.11",
|
|
46
|
+
"@pandacss/compiler-shared": "2.0.0-beta.11",
|
|
47
|
+
"@pandacss/config": "2.0.0-beta.11"
|
|
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
|
-
};
|