@pandacss/eslint-plugin 0.3.1 → 2.0.0-beta.10
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-TU22IYIG.js +1261 -0
- package/dist/index.d.ts +214 -0
- package/dist/index.js +149 -10377
- 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 -31
- package/dist/chunk-Q5KKF6BL.mjs +0 -42
- package/dist/index.mjs +0 -10596
- package/dist/utils/worker.js +0 -4101
- package/dist/utils/worker.mjs +0 -4088
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-TU22IYIG.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,51 +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.10",
|
|
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
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"synckit": "^0.9.0"
|
|
45
|
+
"@pandacss/compiler": "2.0.0-beta.10",
|
|
46
|
+
"@pandacss/compiler-shared": "2.0.0-beta.10",
|
|
47
|
+
"@pandacss/config": "2.0.0-beta.10"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@typescript-eslint/parser": "8.58.2",
|
|
51
|
+
"eslint": "9.39.1"
|
|
37
52
|
},
|
|
38
53
|
"peerDependencies": {
|
|
39
|
-
"eslint": "
|
|
54
|
+
"eslint": ">=9"
|
|
40
55
|
},
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"typescript": "^5.7.2"
|
|
56
|
+
"engines": {
|
|
57
|
+
"node": ">=22"
|
|
44
58
|
},
|
|
45
59
|
"scripts": {
|
|
46
|
-
"build": "tsup",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
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"
|
|
50
64
|
}
|
|
51
65
|
}
|
package/dist/chunk-Q5KKF6BL.mjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __esm = (fn, res) => function __init() {
|
|
8
|
-
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
9
|
-
};
|
|
10
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
11
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
12
|
-
};
|
|
13
|
-
var __copyProps = (to, from, except, desc) => {
|
|
14
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
15
|
-
for (let key of __getOwnPropNames(from))
|
|
16
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
17
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
22
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
23
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
24
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
25
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
26
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
27
|
-
mod
|
|
28
|
-
));
|
|
29
|
-
|
|
30
|
-
// ../node_modules/.pnpm/tsup@8.3.6_postcss@8.4.49_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js
|
|
31
|
-
var init_esm_shims = __esm({
|
|
32
|
-
"../node_modules/.pnpm/tsup@8.3.6_postcss@8.4.49_typescript@5.7.3/node_modules/tsup/assets/esm_shims.js"() {
|
|
33
|
-
"use strict";
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
__esm,
|
|
39
|
-
__commonJS,
|
|
40
|
-
__toESM,
|
|
41
|
-
init_esm_shims
|
|
42
|
-
};
|