@pandacss/eslint-plugin 0.3.1 → 2.0.0-beta.4

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.
@@ -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-DREIC7ND.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,51 +1,65 @@
1
1
  {
2
2
  "name": "@pandacss/eslint-plugin",
3
- "version": "0.3.1",
4
- "description": "Eslint plugin for Panda CSS",
5
- "author": "Abraham Aremu <anubra266@gmail.com>",
6
- "main": "dist/index.js",
7
- "module": "dist/index.mjs",
8
- "types": "dist/index.d.ts",
9
- "sideEffects": false,
10
- "publishConfig": {
11
- "access": "public"
12
- },
3
+ "version": "2.0.0-beta.4",
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
- "require": "./dist/index.js",
18
- "import": {
19
- "types": "./dist/index.d.mts",
20
- "default": "./dist/index.mjs"
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/config": "^0.53.2",
30
- "@pandacss/generator": "^0.53.2",
31
- "@pandacss/node": "^0.53.2",
32
- "@pandacss/shared": "^0.53.2",
33
- "@typescript-eslint/utils": "^8.21.0",
34
- "hookable": "^5.5.3",
35
- "micromatch": "^4.0.8",
36
- "synckit": "^0.9.0"
45
+ "@pandacss/compiler-shared": "2.0.0-beta.4",
46
+ "@pandacss/config": "2.0.0-beta.4",
47
+ "@pandacss/compiler": "2.0.0-beta.4"
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
- "devDependencies": {
42
- "@types/micromatch": "^4.0.10",
43
- "typescript": "^5.7.2"
56
+ "engines": {
57
+ "node": ">=22"
44
58
  },
45
59
  "scripts": {
46
- "build": "tsup",
47
- "dev": "tsup --watch",
48
- "deps": "pnpm up '@pandacss/*' --latest",
49
- "typecheck": "tsc --noEmit"
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
  }
@@ -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
- };