pasika 0.10.154 → 0.10.156
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/dist/eslint/pasika/index.d.ts +6 -0
- package/dist/eslint/pasika/index.js +152 -39
- package/package.json +1 -1
|
@@ -122,6 +122,7 @@ declare const nextjsPackageJsonRules: {
|
|
|
122
122
|
declare const tailwindRules: {
|
|
123
123
|
"at-rule-spacing": _eslint_css.CSSRuleDefinition;
|
|
124
124
|
"theme-reset": _eslint_css.CSSRuleDefinition;
|
|
125
|
+
"tailwind-default-comment": _eslint_css.CSSRuleDefinition;
|
|
125
126
|
"theme-token-order": _eslint_css.CSSRuleDefinition;
|
|
126
127
|
"theme-mode": _eslint_css.CSSRuleDefinition;
|
|
127
128
|
"color-role-usage": _eslint_css.CSSRuleDefinition;
|
|
@@ -139,6 +140,8 @@ declare const tailwindRules: {
|
|
|
139
140
|
"unused-css-definition": _eslint_css.CSSRuleDefinition;
|
|
140
141
|
"unique-css-definition": _eslint_css.CSSRuleDefinition;
|
|
141
142
|
"unique-css-token-value": _eslint_css.CSSRuleDefinition;
|
|
143
|
+
"no-attribute-selector": _eslint_css.CSSRuleDefinition;
|
|
144
|
+
"no-simple-class-rule": _eslint_css.CSSRuleDefinition;
|
|
142
145
|
"no-utility-alias": _eslint_css.CSSRuleDefinition;
|
|
143
146
|
};
|
|
144
147
|
|
|
@@ -166,6 +169,7 @@ declare const pasikaPlugin: {
|
|
|
166
169
|
"vitest-coverage": _eslint_json.JSONRuleDefinition;
|
|
167
170
|
"at-rule-spacing": _eslint_css.CSSRuleDefinition;
|
|
168
171
|
"theme-reset": _eslint_css.CSSRuleDefinition;
|
|
172
|
+
"tailwind-default-comment": _eslint_css.CSSRuleDefinition;
|
|
169
173
|
"theme-token-order": _eslint_css.CSSRuleDefinition;
|
|
170
174
|
"theme-mode": _eslint_css.CSSRuleDefinition;
|
|
171
175
|
"color-role-usage": _eslint_css.CSSRuleDefinition;
|
|
@@ -183,6 +187,8 @@ declare const pasikaPlugin: {
|
|
|
183
187
|
"unused-css-definition": _eslint_css.CSSRuleDefinition;
|
|
184
188
|
"unique-css-definition": _eslint_css.CSSRuleDefinition;
|
|
185
189
|
"unique-css-token-value": _eslint_css.CSSRuleDefinition;
|
|
190
|
+
"no-attribute-selector": _eslint_css.CSSRuleDefinition;
|
|
191
|
+
"no-simple-class-rule": _eslint_css.CSSRuleDefinition;
|
|
186
192
|
"no-utility-alias": _eslint_css.CSSRuleDefinition;
|
|
187
193
|
"doc-kind-suffix": _eslint_markdown.MarkdownRuleDefinition;
|
|
188
194
|
"title-matches-file-name": _eslint_markdown.MarkdownRuleDefinition;
|
|
@@ -5408,8 +5408,8 @@ import ts9 from "typescript";
|
|
|
5408
5408
|
import { readFileSync as readFileSync9 } from "fs";
|
|
5409
5409
|
import ts8 from "typescript";
|
|
5410
5410
|
var MIN_SHARED_CLASSES = 5;
|
|
5411
|
-
function moduleInfo(file, index,
|
|
5412
|
-
if (
|
|
5411
|
+
function moduleInfo(file, index, cache7) {
|
|
5412
|
+
if (cache7.has(file)) return cache7.get(file);
|
|
5413
5413
|
try {
|
|
5414
5414
|
const source = ts8.createSourceFile(
|
|
5415
5415
|
file,
|
|
@@ -5458,10 +5458,10 @@ function moduleInfo(file, index, cache6) {
|
|
|
5458
5458
|
}
|
|
5459
5459
|
}
|
|
5460
5460
|
}
|
|
5461
|
-
|
|
5461
|
+
cache7.set(file, result);
|
|
5462
5462
|
return result;
|
|
5463
5463
|
} catch {
|
|
5464
|
-
|
|
5464
|
+
cache7.set(file, void 0);
|
|
5465
5465
|
return void 0;
|
|
5466
5466
|
}
|
|
5467
5467
|
}
|
|
@@ -5490,11 +5490,11 @@ function staticText(expression, info, visited) {
|
|
|
5490
5490
|
}
|
|
5491
5491
|
return void 0;
|
|
5492
5492
|
}
|
|
5493
|
-
function resolveExport(file, name, index,
|
|
5493
|
+
function resolveExport(file, name, index, cache7, seen) {
|
|
5494
5494
|
const key = `${file}\0${name}`;
|
|
5495
5495
|
if (seen.has(key)) return void 0;
|
|
5496
5496
|
seen.add(key);
|
|
5497
|
-
const info = moduleInfo(file, index,
|
|
5497
|
+
const info = moduleInfo(file, index, cache7);
|
|
5498
5498
|
if (!info) return void 0;
|
|
5499
5499
|
const localName = info.exports.get(name);
|
|
5500
5500
|
if (localName) {
|
|
@@ -5505,21 +5505,21 @@ function resolveExport(file, name, index, cache6, seen) {
|
|
|
5505
5505
|
if (classes.length >= MIN_SHARED_CLASSES) return { origin: file, name: localName, classes };
|
|
5506
5506
|
}
|
|
5507
5507
|
const imported = info.imports.get(localName);
|
|
5508
|
-
if (imported) return resolveExport(imported.file, imported.name, index,
|
|
5508
|
+
if (imported) return resolveExport(imported.file, imported.name, index, cache7, seen);
|
|
5509
5509
|
}
|
|
5510
5510
|
for (const reexport of info.reexports) {
|
|
5511
5511
|
if (reexport.exported !== name) continue;
|
|
5512
|
-
const target = resolveExport(reexport.file, reexport.name, index,
|
|
5512
|
+
const target = resolveExport(reexport.file, reexport.name, index, cache7, seen);
|
|
5513
5513
|
if (target) return target;
|
|
5514
5514
|
}
|
|
5515
5515
|
for (const target of info.stars) {
|
|
5516
|
-
const found = resolveExport(target, name, index,
|
|
5516
|
+
const found = resolveExport(target, name, index, cache7, seen);
|
|
5517
5517
|
if (found) return found;
|
|
5518
5518
|
}
|
|
5519
5519
|
return void 0;
|
|
5520
5520
|
}
|
|
5521
|
-
function usagesInFile(file, index,
|
|
5522
|
-
const info = moduleInfo(file, index,
|
|
5521
|
+
function usagesInFile(file, index, cache7) {
|
|
5522
|
+
const info = moduleInfo(file, index, cache7);
|
|
5523
5523
|
if (!info) return [];
|
|
5524
5524
|
const result = [];
|
|
5525
5525
|
const visit = (node) => {
|
|
@@ -5537,7 +5537,7 @@ function usagesInFile(file, index, cache6) {
|
|
|
5537
5537
|
const collect = (part) => {
|
|
5538
5538
|
if (ts8.isIdentifier(part)) {
|
|
5539
5539
|
const imported = info.imports.get(part.text);
|
|
5540
|
-
const resolved = imported ? resolveExport(imported.file, imported.name, index,
|
|
5540
|
+
const resolved = imported ? resolveExport(imported.file, imported.name, index, cache7, /* @__PURE__ */ new Set()) : void 0;
|
|
5541
5541
|
if (resolved) {
|
|
5542
5542
|
const symbol = `${resolved.origin}\0${resolved.name}`;
|
|
5543
5543
|
if (!identified.has(symbol)) {
|
|
@@ -5575,11 +5575,11 @@ function usagesInFile(file, index, cache6) {
|
|
|
5575
5575
|
return result;
|
|
5576
5576
|
}
|
|
5577
5577
|
function sharedClassReuses(index) {
|
|
5578
|
-
const
|
|
5578
|
+
const cache7 = /* @__PURE__ */ new Map();
|
|
5579
5579
|
const bySymbol = /* @__PURE__ */ new Map();
|
|
5580
5580
|
for (const file of [...index.modules.keys()].sort()) {
|
|
5581
5581
|
if (!/\.(?:tsx|jsx)$/u.test(file) || /\.(?:test|spec)\.(?:tsx|jsx)$/u.test(file)) continue;
|
|
5582
|
-
for (const occurrence of usagesInFile(file, index,
|
|
5582
|
+
for (const occurrence of usagesInFile(file, index, cache7)) {
|
|
5583
5583
|
const members = bySymbol.get(occurrence.symbol) ?? [];
|
|
5584
5584
|
members.push(occurrence);
|
|
5585
5585
|
bySymbol.set(occurrence.symbol, members);
|
|
@@ -11046,6 +11046,55 @@ var globalStylesheetRule = {
|
|
|
11046
11046
|
}
|
|
11047
11047
|
};
|
|
11048
11048
|
|
|
11049
|
+
// eslint/rules/tailwind/no-attribute-selector.ts
|
|
11050
|
+
var noAttributeSelectorRule = {
|
|
11051
|
+
meta: {
|
|
11052
|
+
schema: [],
|
|
11053
|
+
type: "problem",
|
|
11054
|
+
docs: {
|
|
11055
|
+
description: "Disallow CSS attribute selectors; use Tailwind utilities on elements instead."
|
|
11056
|
+
}
|
|
11057
|
+
},
|
|
11058
|
+
create(context) {
|
|
11059
|
+
return {
|
|
11060
|
+
AttributeSelector(node) {
|
|
11061
|
+
context.report({
|
|
11062
|
+
node,
|
|
11063
|
+
message: "CSS attribute selectors are forbidden. Apply Tailwind utilities on the element instead."
|
|
11064
|
+
});
|
|
11065
|
+
}
|
|
11066
|
+
};
|
|
11067
|
+
}
|
|
11068
|
+
};
|
|
11069
|
+
|
|
11070
|
+
// eslint/rules/tailwind/no-simple-class-rule.ts
|
|
11071
|
+
var noSimpleClassRule = {
|
|
11072
|
+
meta: {
|
|
11073
|
+
schema: [],
|
|
11074
|
+
type: "problem",
|
|
11075
|
+
docs: {
|
|
11076
|
+
description: "Require Tailwind utilities on elements instead of simple CSS class rules."
|
|
11077
|
+
}
|
|
11078
|
+
},
|
|
11079
|
+
create(context) {
|
|
11080
|
+
return {
|
|
11081
|
+
Rule(node) {
|
|
11082
|
+
const prelude = node.prelude;
|
|
11083
|
+
if (prelude.type !== "SelectorList") return;
|
|
11084
|
+
for (const selector of prelude.children) {
|
|
11085
|
+
if (selector.type !== "Selector" || selector.children.length !== 1) continue;
|
|
11086
|
+
if (selector.children[0]?.type !== "ClassSelector") continue;
|
|
11087
|
+
context.report({
|
|
11088
|
+
node,
|
|
11089
|
+
message: "Simple CSS class rules are forbidden. Apply Tailwind utilities directly on the element instead."
|
|
11090
|
+
});
|
|
11091
|
+
return;
|
|
11092
|
+
}
|
|
11093
|
+
}
|
|
11094
|
+
};
|
|
11095
|
+
}
|
|
11096
|
+
};
|
|
11097
|
+
|
|
11049
11098
|
// eslint/rules/tailwind/no-utility-alias.ts
|
|
11050
11099
|
function plainUtilityAlias(utility, textOf) {
|
|
11051
11100
|
const children = blockChildren2(utility);
|
|
@@ -11393,9 +11442,67 @@ var stylesheetOrderingRule = {
|
|
|
11393
11442
|
}
|
|
11394
11443
|
};
|
|
11395
11444
|
|
|
11445
|
+
// eslint/rules/tailwind/tailwind-default-comment.ts
|
|
11446
|
+
import { readFileSync as readFileSync16 } from "fs";
|
|
11447
|
+
import { createRequire } from "module";
|
|
11448
|
+
import { generate as generate4 } from "@eslint/css-tree";
|
|
11449
|
+
var cache6 = /* @__PURE__ */ new Map();
|
|
11450
|
+
var COMMENT = /;\s*\/\*\s*Tailwind default\s*\*\/\s*$/u;
|
|
11451
|
+
function normalize2(value) {
|
|
11452
|
+
return value.replace(/\s+/gu, " ").trim();
|
|
11453
|
+
}
|
|
11454
|
+
function tailwindDefaults(filename) {
|
|
11455
|
+
const require3 = createRequire(filename);
|
|
11456
|
+
let file;
|
|
11457
|
+
try {
|
|
11458
|
+
file = require3.resolve("tailwindcss/theme.css");
|
|
11459
|
+
} catch {
|
|
11460
|
+
return /* @__PURE__ */ new Map();
|
|
11461
|
+
}
|
|
11462
|
+
const existing = cache6.get(file);
|
|
11463
|
+
if (existing) return existing;
|
|
11464
|
+
const defaults = /* @__PURE__ */ new Map();
|
|
11465
|
+
for (const match of readFileSync16(file, "utf8").matchAll(/^\s*(?<token>--[\w-]+):\s*(?<value>[^;\r\n]+);/gmu)) {
|
|
11466
|
+
const { token, value } = match.groups ?? {};
|
|
11467
|
+
if (token && value) defaults.set(token, normalize2(value));
|
|
11468
|
+
}
|
|
11469
|
+
cache6.set(file, defaults);
|
|
11470
|
+
return defaults;
|
|
11471
|
+
}
|
|
11472
|
+
var tailwindDefaultCommentRule = {
|
|
11473
|
+
meta: {
|
|
11474
|
+
schema: [],
|
|
11475
|
+
type: "problem",
|
|
11476
|
+
docs: {
|
|
11477
|
+
description: "Require an inline Tailwind default comment on re-declared theme tokens matching installed Tailwind defaults."
|
|
11478
|
+
}
|
|
11479
|
+
},
|
|
11480
|
+
create(context) {
|
|
11481
|
+
const defaults = tailwindDefaults(context.filename);
|
|
11482
|
+
const lines = context.sourceCode.text.split(/\r?\n/u);
|
|
11483
|
+
return {
|
|
11484
|
+
"StyleSheet:exit"(sheet) {
|
|
11485
|
+
for (const theme of atrulesNamed(sheet, "theme")) {
|
|
11486
|
+
for (const child of blockChildren2(theme)) {
|
|
11487
|
+
if (child.type !== "Declaration" || !child.loc) continue;
|
|
11488
|
+
const expected = defaults.get(child.property);
|
|
11489
|
+
if (expected === void 0 || normalize2(generate4(child.value)) !== expected) continue;
|
|
11490
|
+
const line = lines[child.loc.end.line - 1] ?? "";
|
|
11491
|
+
if (COMMENT.test(line)) continue;
|
|
11492
|
+
context.report({
|
|
11493
|
+
node: child,
|
|
11494
|
+
message: `Tailwind default token ${child.property} MUST end with /* Tailwind default */ on the declaration line.`
|
|
11495
|
+
});
|
|
11496
|
+
}
|
|
11497
|
+
}
|
|
11498
|
+
}
|
|
11499
|
+
};
|
|
11500
|
+
}
|
|
11501
|
+
};
|
|
11502
|
+
|
|
11396
11503
|
// eslint/rules/tailwind/theme-mode.ts
|
|
11397
11504
|
import path75 from "path";
|
|
11398
|
-
import { generate as
|
|
11505
|
+
import { generate as generate5 } from "@eslint/css-tree";
|
|
11399
11506
|
var MODE_NAME = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
|
|
11400
11507
|
var MODE_REFERENCE = /(?:^|[^a-z0-9-])(?<name>[a-z][a-z0-9]*(?:-[a-z0-9]+)*):(?=[a-z[(])/gu;
|
|
11401
11508
|
var MODE_ATTRIBUTE = /data-theme\s*=\s*["'](?<name>[a-z][a-z0-9]*(?:-[a-z0-9]+)*)["']/gu;
|
|
@@ -11442,7 +11549,7 @@ var themeModeRule = {
|
|
|
11442
11549
|
const registered = /* @__PURE__ */ new Set();
|
|
11443
11550
|
for (const variant of atrulesNamed(node, "custom-variant")) {
|
|
11444
11551
|
if (variant.type !== "Atrule") continue;
|
|
11445
|
-
const prelude = variant.prelude ?
|
|
11552
|
+
const prelude = variant.prelude ? generate5(variant.prelude) : "";
|
|
11446
11553
|
const name = variantName(prelude);
|
|
11447
11554
|
if (!name) continue;
|
|
11448
11555
|
if (!isModeVariant(name, prelude)) continue;
|
|
@@ -11471,14 +11578,14 @@ var themeModeRule = {
|
|
|
11471
11578
|
const globalRegistrations = current === globalFile ? registered : registeredModes(read(globalFile));
|
|
11472
11579
|
for (const variant of atrulesNamed(node, "variant")) {
|
|
11473
11580
|
if (variant.type !== "Atrule" || !variant.prelude) continue;
|
|
11474
|
-
const name = variantName(
|
|
11581
|
+
const name = variantName(generate5(variant.prelude));
|
|
11475
11582
|
if (name && (name === "dark" || name.startsWith("theme-") || globalRegistrations.has(name) || modeHints.has(name)) && !globalRegistrations.has(name)) {
|
|
11476
11583
|
context.report({ node: variant, message: MISSING_CSS_VARIANT(name) });
|
|
11477
11584
|
}
|
|
11478
11585
|
}
|
|
11479
11586
|
for (const rule of rules(node)) {
|
|
11480
11587
|
if (rule.type !== "Rule") continue;
|
|
11481
|
-
const selector =
|
|
11588
|
+
const selector = generate5(rule.prelude);
|
|
11482
11589
|
if (/\[\s*data-theme(?:\s*[~|^$*]?=|\s*\])/u.test(selector)) {
|
|
11483
11590
|
context.report({ node: rule, message: SELECTOR_OVERRIDE });
|
|
11484
11591
|
} else if (/\.dark(?![\w-])/u.test(selector)) {
|
|
@@ -11487,7 +11594,7 @@ var themeModeRule = {
|
|
|
11487
11594
|
}
|
|
11488
11595
|
walkNodes(node, (child) => {
|
|
11489
11596
|
if (child.type !== "Atrule" || child.name !== "media" || !child.prelude) return;
|
|
11490
|
-
if (/\bprefers-color-scheme\b/u.test(
|
|
11597
|
+
if (/\bprefers-color-scheme\b/u.test(generate5(child.prelude))) {
|
|
11491
11598
|
context.report({ node: child, message: SYSTEM_OVERRIDE });
|
|
11492
11599
|
}
|
|
11493
11600
|
});
|
|
@@ -11517,10 +11624,10 @@ var themeModeRule = {
|
|
|
11517
11624
|
|
|
11518
11625
|
// eslint/rules/tailwind/theme-reset.ts
|
|
11519
11626
|
import path76 from "path";
|
|
11520
|
-
import { generate as
|
|
11627
|
+
import { generate as generate6 } from "@eslint/css-tree";
|
|
11521
11628
|
function isThemeReset(node) {
|
|
11522
11629
|
if (!node) return false;
|
|
11523
|
-
if (node.type === "Declaration") return node.property === "--*" &&
|
|
11630
|
+
if (node.type === "Declaration") return node.property === "--*" && generate6(node.value).trim() === "initial";
|
|
11524
11631
|
if (node.type === "Raw") return /(?:^|[;{])\s*--\*\s*:\s*initial\s*(?:;|$)/u.test(node.value);
|
|
11525
11632
|
return false;
|
|
11526
11633
|
}
|
|
@@ -11576,7 +11683,7 @@ import path78 from "path";
|
|
|
11576
11683
|
|
|
11577
11684
|
// eslint/rules/tailwind/css-consumers.ts
|
|
11578
11685
|
import path77 from "path";
|
|
11579
|
-
import { generate as
|
|
11686
|
+
import { generate as generate7, parse as parse7 } from "@eslint/css-tree";
|
|
11580
11687
|
import * as ts17 from "typescript";
|
|
11581
11688
|
function contains2(text, name) {
|
|
11582
11689
|
return new RegExp(`(?<![\\w-])${escapeRegExp(name)}(?![\\w-])`, "u").test(text);
|
|
@@ -11680,7 +11787,7 @@ function inferCssConsumerPaths(options) {
|
|
|
11680
11787
|
const ast = parse7(src.content, { positions: true, parseAtrulePrelude: false });
|
|
11681
11788
|
if (ast.type !== "StyleSheet") continue;
|
|
11682
11789
|
for (const node of ast.children) {
|
|
11683
|
-
if (node.type !== "Atrule" || node.name !== "layer" || !node.loc || !node.prelude ||
|
|
11790
|
+
if (node.type !== "Atrule" || node.name !== "layer" || !node.loc || !node.prelude || generate7(node.prelude).trim() !== "base") {
|
|
11684
11791
|
continue;
|
|
11685
11792
|
}
|
|
11686
11793
|
const body = src.content.slice(node.loc.start.offset, node.loc.end.offset);
|
|
@@ -12953,7 +13060,7 @@ var utilityMappingRule = {
|
|
|
12953
13060
|
import { spawnSync as spawnSync3 } from "child_process";
|
|
12954
13061
|
import { existsSync as existsSync13 } from "fs";
|
|
12955
13062
|
import path83 from "path";
|
|
12956
|
-
import { generate as
|
|
13063
|
+
import { generate as generate8, parse as parse8, toPlainObject as toPlainObject2 } from "@eslint/css-tree";
|
|
12957
13064
|
function numericPart(value) {
|
|
12958
13065
|
const match = /^(?<negative>-?)(?<number>(?:\d+(?:\.\d+)?|\.\d+))(?<unit>%|px|rem|em|vw|vh|dvw|dvh|ch|fr|s|ms|deg|turn)?$/u.exec(
|
|
12959
13066
|
value
|
|
@@ -13059,10 +13166,10 @@ function compiledOperation(compiled, index) {
|
|
|
13059
13166
|
(child) => child.type === "Declaration" && child.property === "--tw-shadow"
|
|
13060
13167
|
);
|
|
13061
13168
|
if (shadow?.type === "Declaration") {
|
|
13062
|
-
return { property: "box-shadow", value:
|
|
13169
|
+
return { property: "box-shadow", value: generate8(shadow.value).trim() };
|
|
13063
13170
|
}
|
|
13064
13171
|
}
|
|
13065
|
-
return { property: declaration.property, value:
|
|
13172
|
+
return { property: declaration.property, value: generate8(declaration.value).trim() };
|
|
13066
13173
|
}
|
|
13067
13174
|
function propertyPrefix(property) {
|
|
13068
13175
|
return property.replace(/^-+/u, "").replace(/^background-/u, "bg-");
|
|
@@ -13145,6 +13252,7 @@ var utilityNameParityRule = {
|
|
|
13145
13252
|
var tailwindRules = {
|
|
13146
13253
|
"at-rule-spacing": atRuleSpacingRule,
|
|
13147
13254
|
"theme-reset": themeResetRule,
|
|
13255
|
+
"tailwind-default-comment": tailwindDefaultCommentRule,
|
|
13148
13256
|
"theme-token-order": themeTokenOrderRule,
|
|
13149
13257
|
"theme-mode": themeModeRule,
|
|
13150
13258
|
"color-role-usage": colorRoleUsageRule,
|
|
@@ -13162,6 +13270,8 @@ var tailwindRules = {
|
|
|
13162
13270
|
"unused-css-definition": unusedCssDefinitionRule,
|
|
13163
13271
|
"unique-css-definition": uniqueCssDefinitionRule,
|
|
13164
13272
|
"unique-css-token-value": uniqueCssTokenValueRule,
|
|
13273
|
+
"no-attribute-selector": noAttributeSelectorRule,
|
|
13274
|
+
"no-simple-class-rule": noSimpleClassRule,
|
|
13165
13275
|
"no-utility-alias": noUtilityAliasRule
|
|
13166
13276
|
};
|
|
13167
13277
|
|
|
@@ -13316,8 +13426,8 @@ var uiStateRule = {
|
|
|
13316
13426
|
};
|
|
13317
13427
|
|
|
13318
13428
|
// eslint/rules/unknown-utility.ts
|
|
13319
|
-
import { existsSync as existsSync14, readdirSync as readdirSync6, readFileSync as
|
|
13320
|
-
import { createRequire } from "module";
|
|
13429
|
+
import { existsSync as existsSync14, readdirSync as readdirSync6, readFileSync as readFileSync17, statSync as statSync6 } from "fs";
|
|
13430
|
+
import { createRequire as createRequire2 } from "module";
|
|
13321
13431
|
import path85 from "path";
|
|
13322
13432
|
var PREFIX_NAMESPACES = {
|
|
13323
13433
|
bg: ["color", "background-image"],
|
|
@@ -13572,7 +13682,7 @@ var STATIC_COLOR_SPECIALS = /* @__PURE__ */ new Set(["transparent", "current", "
|
|
|
13572
13682
|
var NUMERIC_TOKEN_RE = /^-?(?:\d+\.?\d*|\.\d+)(?:%|px|rem|em)?$/;
|
|
13573
13683
|
var SIDE_WIDTH_TOKEN_RE = /^(?:x|y|t|r|b|l|s|e)-(?:\d+\.?\d*|\.\d+)(?:%|px|rem|em)?$/;
|
|
13574
13684
|
var OFFSET_TOKEN_RE = /^offset-(?:\d+\.?\d*|\.\d+)(?:%|px|rem|em)?$/;
|
|
13575
|
-
var require2 =
|
|
13685
|
+
var require2 = createRequire2(import.meta.url);
|
|
13576
13686
|
var tailwindMerge;
|
|
13577
13687
|
function getTailwindMerge() {
|
|
13578
13688
|
if (tailwindMerge !== void 0) return tailwindMerge ?? void 0;
|
|
@@ -13631,7 +13741,7 @@ function resolvePackageStylesheet(fromFile, specifier) {
|
|
|
13631
13741
|
const manifestPath = path85.join(packageRoot, "package.json");
|
|
13632
13742
|
if (existsSync14(manifestPath)) {
|
|
13633
13743
|
try {
|
|
13634
|
-
const manifest =
|
|
13744
|
+
const manifest = readFileSync17(manifestPath, "utf8");
|
|
13635
13745
|
const stylesheet = /"style"\s*:\s*"(?<file>[^"]+\.css)"/.exec(manifest)?.groups?.file;
|
|
13636
13746
|
const main = /"main"\s*:\s*"(?<file>[^"]+\.css)"/.exec(manifest)?.groups?.file;
|
|
13637
13747
|
const target = stylesheet ?? main;
|
|
@@ -13651,7 +13761,7 @@ function inventoryStylesheetFiles(projectFiles) {
|
|
|
13651
13761
|
for (const file of projectFiles) {
|
|
13652
13762
|
let css2;
|
|
13653
13763
|
try {
|
|
13654
|
-
css2 =
|
|
13764
|
+
css2 = readFileSync17(file, "utf8");
|
|
13655
13765
|
} catch {
|
|
13656
13766
|
continue;
|
|
13657
13767
|
}
|
|
@@ -13718,7 +13828,7 @@ function readInventory(files) {
|
|
|
13718
13828
|
for (const file of files) {
|
|
13719
13829
|
let css2;
|
|
13720
13830
|
try {
|
|
13721
|
-
css2 =
|
|
13831
|
+
css2 = readFileSync17(file, "utf8");
|
|
13722
13832
|
} catch {
|
|
13723
13833
|
continue;
|
|
13724
13834
|
}
|
|
@@ -13997,7 +14107,7 @@ var valueExtractionRule = {
|
|
|
13997
14107
|
};
|
|
13998
14108
|
|
|
13999
14109
|
// eslint/rules/vulyk/tracked-docs.ts
|
|
14000
|
-
import { existsSync as existsSync15, readFileSync as
|
|
14110
|
+
import { existsSync as existsSync15, readFileSync as readFileSync18 } from "fs";
|
|
14001
14111
|
import path88 from "path";
|
|
14002
14112
|
var PASIKA_REPO = "Bredansky/pasika";
|
|
14003
14113
|
var BASE_REQUIRED_TRACKED_DOCS = [
|
|
@@ -14040,7 +14150,7 @@ var trackedDocsRule = {
|
|
|
14040
14150
|
});
|
|
14041
14151
|
return;
|
|
14042
14152
|
}
|
|
14043
|
-
const config =
|
|
14153
|
+
const config = readFileSync18(configPath, "utf8");
|
|
14044
14154
|
if (!config.includes(PASIKA_REPO)) {
|
|
14045
14155
|
context.report({
|
|
14046
14156
|
node,
|
|
@@ -14364,14 +14474,14 @@ var zodSchemaValidationRule = {
|
|
|
14364
14474
|
};
|
|
14365
14475
|
|
|
14366
14476
|
// eslint/ts-alignment.ts
|
|
14367
|
-
import { readFileSync as
|
|
14368
|
-
import { createRequire as
|
|
14477
|
+
import { readFileSync as readFileSync19 } from "fs";
|
|
14478
|
+
import { createRequire as createRequire3 } from "module";
|
|
14369
14479
|
import { join } from "path";
|
|
14370
|
-
var ownRequire =
|
|
14480
|
+
var ownRequire = createRequire3(import.meta.url);
|
|
14371
14481
|
var majorOf = (version) => Number(version.split(".")[0]);
|
|
14372
14482
|
function versionOf(packagePath) {
|
|
14373
14483
|
try {
|
|
14374
|
-
const parsed = JSON.parse(
|
|
14484
|
+
const parsed = JSON.parse(readFileSync19(packagePath, "utf8"));
|
|
14375
14485
|
if (typeof parsed !== "object" || parsed === null || !("version" in parsed)) return null;
|
|
14376
14486
|
return typeof parsed.version === "string" ? parsed.version : null;
|
|
14377
14487
|
} catch {
|
|
@@ -14387,7 +14497,7 @@ function resolveTypescriptAlignment() {
|
|
|
14387
14497
|
}
|
|
14388
14498
|
let resolved = null;
|
|
14389
14499
|
try {
|
|
14390
|
-
const consumerRequire =
|
|
14500
|
+
const consumerRequire = createRequire3(join(process.cwd(), "package.json"));
|
|
14391
14501
|
resolved = versionOf(consumerRequire.resolve("typescript/package.json"));
|
|
14392
14502
|
} catch {
|
|
14393
14503
|
resolved = null;
|
|
@@ -14568,6 +14678,9 @@ var tailwindImportGraph = {
|
|
|
14568
14678
|
languageOptions: { tolerant: true },
|
|
14569
14679
|
rules: {
|
|
14570
14680
|
"pasika/at-rule-spacing": "error",
|
|
14681
|
+
"pasika/no-attribute-selector": "error",
|
|
14682
|
+
"pasika/no-simple-class-rule": "error",
|
|
14683
|
+
"pasika/tailwind-default-comment": "error",
|
|
14571
14684
|
"pasika/unused-css-definition": "error",
|
|
14572
14685
|
"pasika/css-entry-point": "error",
|
|
14573
14686
|
"pasika/feature-css-placement": "error",
|