@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.
@@ -0,0 +1,214 @@
1
+ import { L as Linter, R as RuleModuleLike, I as Inspect, a as RuleContextWithReport } from './shared-BdjJwg93.js';
2
+ export { c as LintInspection, b as LintRuleContextLike, d as LinterOptions, h as PandaLintSettings, f as ProjectCache, P as ProjectCacheOptions, l as ReportDescriptor, i as RuleContextLike, j as RuleFixer, S as SourceCodeLike, k as SuggestionDescriptor, n as byteToIndex, g as getContextFilename, e as getContextSource, m as getSourceText, p as projectCacheKey, r as resolvePandaSettings, t as toEslintLoc } from './shared-BdjJwg93.js';
3
+ import { Project } from '@pandacss/compiler/tooling';
4
+ export { FileInspectionCacheEntry as InspectionCacheEntry, FileInspector as Inspector, sourceCacheKey } from '@pandacss/compiler/tooling';
5
+ import { Span, Diagnostic, Deprecation, TokenSuggestion, FileInspectionResult } from '@pandacss/compiler';
6
+
7
+ interface RangeLike {
8
+ span: Span;
9
+ }
10
+ declare class RangeIndex<T extends RangeLike> {
11
+ #private;
12
+ constructor(items: readonly T[]);
13
+ at(offset: number): T | undefined;
14
+ enclosing(span: Span): T | undefined;
15
+ exact(span: Span): T | undefined;
16
+ all(): readonly T[];
17
+ }
18
+
19
+ /** Flat-config plugin meta, shared by every entry point. */
20
+ declare const pluginMeta: {
21
+ name: string;
22
+ version: string;
23
+ };
24
+ interface PandaPluginOptions {
25
+ cwd?: string;
26
+ configPath?: string;
27
+ linter?: Linter;
28
+ }
29
+ interface PandaProject {
30
+ linter: Linter;
31
+ project: Project;
32
+ }
33
+ interface PandaPlugin {
34
+ rules: Record<string, RuleModuleLike>;
35
+ }
36
+ /** Preload one Panda project (config load + compiler) for a `(cwd, configPath)`. */
37
+ declare function loadPandaProject(options?: PandaPluginOptions): Promise<PandaProject>;
38
+ /** Bind every rule to an already-loaded project so rule visitors stay synchronous. */
39
+ declare function bindRules(linter: Linter, project: Project): Record<string, RuleModuleLike>;
40
+ declare function createPandaPlugin(options?: PandaPluginOptions): Promise<PandaPlugin>;
41
+
42
+ /** Flat-config plugin key; rule ids are `@pandacss/<rule>`. */
43
+ declare const PLUGIN_NAMESPACE = "@pandacss";
44
+ type RuleSeverity = 'off' | 'warn' | 'error';
45
+ type RuleEntry = RuleSeverity | [RuleSeverity, Record<string, unknown>];
46
+ interface RecommendedOptions extends PandaPluginOptions {
47
+ /** File globs to lint; defaults to source extensions. */
48
+ files?: string[];
49
+ }
50
+ interface PandaFlatConfig {
51
+ files: string[];
52
+ plugins: Record<string, {
53
+ meta: {
54
+ name: string;
55
+ version?: string;
56
+ };
57
+ rules: Record<string, RuleModuleLike>;
58
+ }>;
59
+ rules: Record<string, RuleEntry>;
60
+ settings?: {
61
+ panda: {
62
+ configPath: string;
63
+ };
64
+ };
65
+ }
66
+ /**
67
+ * Build the recommended flat config. Async because it preloads the Panda
68
+ * project (config load + compiler) so rule visitors can run synchronously.
69
+ *
70
+ * Scopes itself to JS/TS/JSX via `files` but sets no parser — use your
71
+ * project's existing parser setup so ESLint can parse the files.
72
+ *
73
+ * ```ts
74
+ * import panda from '@pandacss/eslint-plugin'
75
+ *
76
+ * export default [
77
+ * await panda.configs.recommended({ configPath: './panda.config.ts' }),
78
+ * ]
79
+ * ```
80
+ */
81
+ declare function recommended(options?: RecommendedOptions): Promise<PandaFlatConfig>;
82
+ declare const configs: {
83
+ recommended: typeof recommended;
84
+ };
85
+
86
+ declare const consistentPropertyStyleRuleName = "consistent-property-style";
87
+ interface ConsistentPropertyStyleRuleOptions {
88
+ inspect: Inspect;
89
+ /** `shorthand alias -> canonical property`, from `spec.utilities.shorthands`. */
90
+ shorthands: Record<string, string>;
91
+ }
92
+ declare function createConsistentPropertyStyleRule(options: ConsistentPropertyStyleRuleOptions): RuleModuleLike;
93
+
94
+ declare const extractionDiagnosticsRuleName = "extraction-diagnostics";
95
+ interface ExtractionDiagnosticsRuleOptions {
96
+ inspect: Inspect;
97
+ }
98
+ declare function createExtractionDiagnosticsRule(options: ExtractionDiagnosticsRuleOptions): RuleModuleLike;
99
+ declare function reportDiagnostics(context: RuleContextWithReport, diagnostics: readonly Diagnostic[]): void;
100
+
101
+ declare const noInvalidTokenPathsRuleName = "no-invalid-token-paths";
102
+ interface TokenRuleOptions {
103
+ inspect: Inspect;
104
+ }
105
+ declare function createNoInvalidTokenPathsRule(options: TokenRuleOptions): RuleModuleLike;
106
+
107
+ declare const fileNotIncludedRuleName = "file-not-included";
108
+ interface FileNotIncludedRuleOptions {
109
+ inspect: Inspect;
110
+ isSourceFile: (path: string) => boolean;
111
+ }
112
+ declare function createFileNotIncludedRule(options: FileNotIncludedRuleOptions): RuleModuleLike;
113
+
114
+ declare const noDebugRuleName = "no-debug";
115
+ interface NoDebugRuleOptions {
116
+ inspect: Inspect;
117
+ }
118
+ declare function createNoDebugRule(options: NoDebugRuleOptions): RuleModuleLike;
119
+
120
+ declare const noDeprecatedRuleName = "no-deprecated";
121
+ type DeprecationKind = 'tokens' | 'utilities' | 'recipes' | 'patterns';
122
+ interface NoDeprecatedRuleOptions {
123
+ inspect: Inspect;
124
+ /** Token path → deprecation. */
125
+ tokens: Record<string, Deprecation>;
126
+ /** Canonical property → deprecation. */
127
+ utilities: Record<string, Deprecation>;
128
+ /** Recipe name → deprecation. */
129
+ recipes: Record<string, Deprecation>;
130
+ /** Pattern name → deprecation. */
131
+ patterns: Record<string, Deprecation>;
132
+ }
133
+ declare function createNoDeprecatedRule(options: NoDeprecatedRuleOptions): RuleModuleLike;
134
+
135
+ declare const noImportantRuleName = "no-important";
136
+ declare function createNoImportantRule(options: {
137
+ inspect: Inspect;
138
+ }): RuleModuleLike;
139
+
140
+ declare const noInvalidNestingRuleName = "no-invalid-nesting";
141
+ declare function createNoInvalidNestingRule(options: {
142
+ inspect: Inspect;
143
+ }): RuleModuleLike;
144
+
145
+ declare const noPrimitiveTokenRuleName = "no-primitive-token";
146
+ interface NoPrimitiveTokenRuleOptions {
147
+ inspect: Inspect;
148
+ /** Semantic tokens that carry the same value as a full token path. */
149
+ suggestSemanticTokens: (path: string) => TokenSuggestion[];
150
+ }
151
+ interface ReportConfig$1 extends NoPrimitiveTokenRuleOptions {
152
+ /** Categories to enforce; `undefined` means every category with semantic tokens. */
153
+ categories?: ReadonlySet<string>;
154
+ allow: ReadonlySet<string>;
155
+ }
156
+ declare function reportPrimitiveTokenViolations(context: RuleContextWithReport, inspection: FileInspectionResult, config: ReportConfig$1): void;
157
+ declare function createNoPrimitiveTokenRule(options: NoPrimitiveTokenRuleOptions): RuleModuleLike;
158
+
159
+ declare const noMarginPropertiesRuleName = "no-margin-properties";
160
+ declare function createNoMarginPropertiesRule(options: {
161
+ inspect: Inspect;
162
+ }): RuleModuleLike;
163
+
164
+ declare const noPhysicalPropertiesRuleName = "no-physical-properties";
165
+ declare function createNoPhysicalPropertiesRule(options: {
166
+ inspect: Inspect;
167
+ }): RuleModuleLike;
168
+
169
+ declare const noShorthandLonghandMixRuleName = "no-shorthand-longhand-mix";
170
+ declare function createNoShorthandLonghandMixRule(options: {
171
+ inspect: Inspect;
172
+ }): RuleModuleLike;
173
+
174
+ declare const preferTokenRuleName = "prefer-token";
175
+ type SuggestTokens = (prop: string, value: string) => TokenSuggestion[];
176
+ interface PreferTokenRuleOptions {
177
+ inspect: Inspect;
178
+ /** Property (canonical) → its token category, or `undefined` if not token-backed. */
179
+ categoryOf: (prop: string) => string | undefined;
180
+ /** Whether `value` on `prop` resolved to a raw value rather than a token var. */
181
+ isHardcodedValue: (prop: string, value: string) => boolean;
182
+ /** Tokens that carry a value, ranked (safe equivalents first). */
183
+ suggest: SuggestTokens;
184
+ }
185
+ /** Flatten the string leaves of a folded style value (handles conditions/arrays). */
186
+ declare function collectStrings(value: unknown, out: string[]): void;
187
+ interface ReportConfig {
188
+ categoryOf: (prop: string) => string | undefined;
189
+ isHardcodedValue: (prop: string, value: string) => boolean;
190
+ suggest: SuggestTokens;
191
+ /** Categories to enforce; `undefined` means every token-backed category. */
192
+ categories?: ReadonlySet<string>;
193
+ allow: ReadonlySet<string>;
194
+ }
195
+ /** Shared engine: flag utility entries whose value is raw where a token exists. */
196
+ declare function reportTokenViolations(context: RuleContextWithReport, inspection: FileInspectionResult, config: ReportConfig): void;
197
+ declare function createPreferTokenRule(options: PreferTokenRuleOptions): RuleModuleLike;
198
+
199
+ declare const preferTextStyleRuleName = "prefer-text-style";
200
+ declare function createPreferTextStyleRule(options: {
201
+ inspect: Inspect;
202
+ }): RuleModuleLike;
203
+
204
+ declare const _default: {
205
+ meta: {
206
+ name: string;
207
+ version: string;
208
+ };
209
+ configs: {
210
+ recommended: typeof recommended;
211
+ };
212
+ };
213
+
214
+ export { type ConsistentPropertyStyleRuleOptions, type DeprecationKind, type ExtractionDiagnosticsRuleOptions, type FileNotIncludedRuleOptions, Inspect, Linter, type NoDebugRuleOptions, type NoDeprecatedRuleOptions, type NoPrimitiveTokenRuleOptions, PLUGIN_NAMESPACE, type PandaFlatConfig, type PandaPlugin, type PandaPluginOptions, type PandaProject, type PreferTokenRuleOptions, RangeIndex, type RangeLike, type RecommendedOptions, RuleContextWithReport, RuleModuleLike, type SuggestTokens, type TokenRuleOptions, bindRules, collectStrings, configs, consistentPropertyStyleRuleName, createConsistentPropertyStyleRule, createExtractionDiagnosticsRule, createFileNotIncludedRule, createNoDebugRule, createNoDeprecatedRule, createNoImportantRule, createNoInvalidNestingRule, createNoInvalidTokenPathsRule, createNoMarginPropertiesRule, createNoPhysicalPropertiesRule, createNoPrimitiveTokenRule, createNoShorthandLonghandMixRule, createPandaPlugin, createPreferTextStyleRule, createPreferTokenRule, _default as default, extractionDiagnosticsRuleName, fileNotIncludedRuleName, loadPandaProject, noDebugRuleName, noDeprecatedRuleName, noImportantRuleName, noInvalidNestingRuleName, noInvalidTokenPathsRuleName, noMarginPropertiesRuleName, noPhysicalPropertiesRuleName, noPrimitiveTokenRuleName, noShorthandLonghandMixRuleName, pluginMeta, preferTextStyleRuleName, preferTokenRuleName, recommended, reportDiagnostics, reportPrimitiveTokenViolations, reportTokenViolations };