oxlint-tailwindcss 1.3.0 → 1.3.1
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/README.md +4 -4
- package/dist/index.cjs +67 -0
- package/dist/index.mjs +67 -0
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -930,10 +930,10 @@ The class parser correctly handles:
|
|
|
930
930
|
|
|
931
931
|
- **`enforce-canonical`**: Named classes are canonicalized via the precomputed map (covers
|
|
932
932
|
everything in `getClassList()` plus a curated list of legacy v3 spellings like `break-words`,
|
|
933
|
-
`flex-grow`, `start-N`, `bg-gradient-to
|
|
934
|
-
canonicalized dynamically via the worker. Some valid v4 classes
|
|
935
|
-
`getClassList()` and have no canonical rewrite (e.g. `border-1` is valid as a
|
|
936
|
-
value but isn't enumerated) are left untouched.
|
|
933
|
+
`flex-grow`, `start-N`, `bg-gradient-to-*`, `bg-left-top` → `bg-top-left`). Arbitrary/CSS-var
|
|
934
|
+
forms (`p-[2px]`, `bg-(--c)`) are canonicalized dynamically via the worker. Some valid v4 classes
|
|
935
|
+
that don't appear in `getClassList()` and have no canonical rewrite (e.g. `border-1` is valid as a
|
|
936
|
+
dynamic numeric value but isn't enumerated) are left untouched.
|
|
937
937
|
- **`no-conflicting-classes`**: Uses exact CSS property name matching plus composition heuristics:
|
|
938
938
|
CSS-var composition (`shadow` + `ring`), narrowing-override (later class is a strict subset of
|
|
939
939
|
earlier — handles `size-4 h-6`, `rounded-t-lg rounded-tl-sm`, `truncate text-clip`), complementary
|
package/dist/index.cjs
CHANGED
|
@@ -1309,6 +1309,39 @@ async function main() {
|
|
|
1309
1309
|
const dash = cls.lastIndexOf('-');
|
|
1310
1310
|
if (dash > 0) knownPrefixes.add(cls.slice(0, dash));
|
|
1311
1311
|
}
|
|
1312
|
+
// Curated static utilities valid in v4 but absent from getClassList() (#37).
|
|
1313
|
+
// These are special-cased in Tailwind's compiler, so they appear in neither
|
|
1314
|
+
// getClassList() NOR the utility registry (\`utilities.keys('static')\`) — only
|
|
1315
|
+
// an explicit probe surfaces them:
|
|
1316
|
+
// - \`@container-size\` (\`container-type: size\`) — sibling of the enumerated
|
|
1317
|
+
// \`@container\` / \`@container-normal\`; was flagged as a typo of \`contain-size\`.
|
|
1318
|
+
// - \`filter-none\` / \`backdrop-filter-none\` (\`filter: none\`) — the reset
|
|
1319
|
+
// utilities; their functional bases enumerate values but omit \`none\`.
|
|
1320
|
+
// - \`max-w-screen\` (\`max-width: 100vw\`).
|
|
1321
|
+
// Validated via candidatesToCss (self-prunes on any Tailwind version that doesn't
|
|
1322
|
+
// emit them) and their CSS is captured so the cssProps phase below treats them
|
|
1323
|
+
// exactly like their getClassList siblings — otherwise no-conflicting-classes
|
|
1324
|
+
// would flag \`@container @container-normal\` but silently accept
|
|
1325
|
+
// \`@container @container-size\`. Named forms (\`@container-size/main\`) are covered
|
|
1326
|
+
// by the slash-modifier path in cache.isValid once the base lands in validClasses.
|
|
1327
|
+
const staticExtras = [
|
|
1328
|
+
'@container-size',
|
|
1329
|
+
'filter-none',
|
|
1330
|
+
'backdrop-filter-none',
|
|
1331
|
+
'max-w-screen',
|
|
1332
|
+
].filter((c) => !validSet.has(c));
|
|
1333
|
+
const staticExtraCss = {};
|
|
1334
|
+
if (staticExtras.length > 0) {
|
|
1335
|
+
const staticResults = ds.candidatesToCss(staticExtras.map(pfx));
|
|
1336
|
+
for (let i = 0; i < staticExtras.length; i++) {
|
|
1337
|
+
if (staticResults[i] != null) {
|
|
1338
|
+
validClasses.push(staticExtras[i]);
|
|
1339
|
+
validSet.add(staticExtras[i]);
|
|
1340
|
+
staticExtraCss[staticExtras[i]] = staticResults[i];
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1312
1345
|
const extraCandidates = [];
|
|
1313
1346
|
const breakpoints = ['sm', 'md', 'lg', 'xl', '2xl'];
|
|
1314
1347
|
for (const prefix of knownPrefixes) {
|
|
@@ -1330,6 +1363,27 @@ async function main() {
|
|
|
1330
1363
|
}
|
|
1331
1364
|
}
|
|
1332
1365
|
|
|
1366
|
+
// Negative variants of utilities that support them (#37). getClassList()
|
|
1367
|
+
// enumerates negatives for most (\`-m-4\`, \`-translate-x-2\`) but omits a few
|
|
1368
|
+
// (\`-col-1\`, \`-row-1\`, \`-hue-rotate-45\`, \`-backdrop-hue-rotate-45\`). Probe
|
|
1369
|
+
// \`-<prefix>-1\` for every known prefix lacking negative coverage; candidatesToCss
|
|
1370
|
+
// self-prunes utilities that reject negatives (\`-p-1\` → null), so only genuinely
|
|
1371
|
+
// negative-capable prefixes land in validClasses, giving isValid's / getOrder's
|
|
1372
|
+
// numeric-prefix heuristic the \`-<prefix>\` it needs to accept any \`-<prefix>-<n>\`.
|
|
1373
|
+
const negativeProbes = [];
|
|
1374
|
+
for (const prefix of knownPrefixes) {
|
|
1375
|
+
if (!knownPrefixes.has('-' + prefix)) negativeProbes.push('-' + prefix + '-1');
|
|
1376
|
+
}
|
|
1377
|
+
if (negativeProbes.length > 0) {
|
|
1378
|
+
const negResults = ds.candidatesToCss(negativeProbes.map(pfx));
|
|
1379
|
+
for (let i = 0; i < negativeProbes.length; i++) {
|
|
1380
|
+
if (negResults[i] != null && !validSet.has(negativeProbes[i])) {
|
|
1381
|
+
validClasses.push(negativeProbes[i]);
|
|
1382
|
+
validSet.add(negativeProbes[i]);
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1333
1387
|
// Marker classes: group/peer don't produce CSS but enable group-hover:/peer-checked: variants
|
|
1334
1388
|
const allVariants = ds.getVariants();
|
|
1335
1389
|
for (const v of allVariants) {
|
|
@@ -1376,6 +1430,11 @@ async function main() {
|
|
|
1376
1430
|
'decoration-clone', 'decoration-slice',
|
|
1377
1431
|
'bg-gradient-to-t', 'bg-gradient-to-tr', 'bg-gradient-to-r', 'bg-gradient-to-br',
|
|
1378
1432
|
'bg-gradient-to-b', 'bg-gradient-to-bl', 'bg-gradient-to-l', 'bg-gradient-to-tl',
|
|
1433
|
+
// v3 background/object-position spellings reordered in v4 (#37):
|
|
1434
|
+
// \`bg-left-top\` -> \`bg-top-left\`. canonicalizeCandidates rewrites them, so
|
|
1435
|
+
// enforce-canonical suggests the v4 form and no-unknown-classes accepts them.
|
|
1436
|
+
'bg-left-top', 'bg-right-top', 'bg-left-bottom', 'bg-right-bottom',
|
|
1437
|
+
'object-left-top', 'object-right-top', 'object-left-bottom', 'object-right-bottom',
|
|
1379
1438
|
];
|
|
1380
1439
|
for (const cls of validClasses) {
|
|
1381
1440
|
if (cls.startsWith('inset-s-')) legacyCandidates.push('start-' + cls.slice(8));
|
|
@@ -1504,6 +1563,14 @@ async function main() {
|
|
|
1504
1563
|
}
|
|
1505
1564
|
}
|
|
1506
1565
|
|
|
1566
|
+
// cssProps for the curated static extras (#37) so they participate in conflict
|
|
1567
|
+
// detection exactly like their getClassList siblings (e.g. \`@container-size\` and
|
|
1568
|
+
// \`@container\` both declaring \`container-type\`).
|
|
1569
|
+
for (const name in staticExtraCss) {
|
|
1570
|
+
const props = extractRootCssProps(staticExtraCss[name], pfx(name));
|
|
1571
|
+
if (props.length > 0) cssProps[name] = props;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1507
1574
|
// Variant ordering from the design system
|
|
1508
1575
|
const variantOrder = {};
|
|
1509
1576
|
const variants = ds.getVariants();
|
package/dist/index.mjs
CHANGED
|
@@ -1313,6 +1313,39 @@ async function main() {
|
|
|
1313
1313
|
const dash = cls.lastIndexOf('-');
|
|
1314
1314
|
if (dash > 0) knownPrefixes.add(cls.slice(0, dash));
|
|
1315
1315
|
}
|
|
1316
|
+
// Curated static utilities valid in v4 but absent from getClassList() (#37).
|
|
1317
|
+
// These are special-cased in Tailwind's compiler, so they appear in neither
|
|
1318
|
+
// getClassList() NOR the utility registry (\`utilities.keys('static')\`) — only
|
|
1319
|
+
// an explicit probe surfaces them:
|
|
1320
|
+
// - \`@container-size\` (\`container-type: size\`) — sibling of the enumerated
|
|
1321
|
+
// \`@container\` / \`@container-normal\`; was flagged as a typo of \`contain-size\`.
|
|
1322
|
+
// - \`filter-none\` / \`backdrop-filter-none\` (\`filter: none\`) — the reset
|
|
1323
|
+
// utilities; their functional bases enumerate values but omit \`none\`.
|
|
1324
|
+
// - \`max-w-screen\` (\`max-width: 100vw\`).
|
|
1325
|
+
// Validated via candidatesToCss (self-prunes on any Tailwind version that doesn't
|
|
1326
|
+
// emit them) and their CSS is captured so the cssProps phase below treats them
|
|
1327
|
+
// exactly like their getClassList siblings — otherwise no-conflicting-classes
|
|
1328
|
+
// would flag \`@container @container-normal\` but silently accept
|
|
1329
|
+
// \`@container @container-size\`. Named forms (\`@container-size/main\`) are covered
|
|
1330
|
+
// by the slash-modifier path in cache.isValid once the base lands in validClasses.
|
|
1331
|
+
const staticExtras = [
|
|
1332
|
+
'@container-size',
|
|
1333
|
+
'filter-none',
|
|
1334
|
+
'backdrop-filter-none',
|
|
1335
|
+
'max-w-screen',
|
|
1336
|
+
].filter((c) => !validSet.has(c));
|
|
1337
|
+
const staticExtraCss = {};
|
|
1338
|
+
if (staticExtras.length > 0) {
|
|
1339
|
+
const staticResults = ds.candidatesToCss(staticExtras.map(pfx));
|
|
1340
|
+
for (let i = 0; i < staticExtras.length; i++) {
|
|
1341
|
+
if (staticResults[i] != null) {
|
|
1342
|
+
validClasses.push(staticExtras[i]);
|
|
1343
|
+
validSet.add(staticExtras[i]);
|
|
1344
|
+
staticExtraCss[staticExtras[i]] = staticResults[i];
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
}
|
|
1348
|
+
|
|
1316
1349
|
const extraCandidates = [];
|
|
1317
1350
|
const breakpoints = ['sm', 'md', 'lg', 'xl', '2xl'];
|
|
1318
1351
|
for (const prefix of knownPrefixes) {
|
|
@@ -1334,6 +1367,27 @@ async function main() {
|
|
|
1334
1367
|
}
|
|
1335
1368
|
}
|
|
1336
1369
|
|
|
1370
|
+
// Negative variants of utilities that support them (#37). getClassList()
|
|
1371
|
+
// enumerates negatives for most (\`-m-4\`, \`-translate-x-2\`) but omits a few
|
|
1372
|
+
// (\`-col-1\`, \`-row-1\`, \`-hue-rotate-45\`, \`-backdrop-hue-rotate-45\`). Probe
|
|
1373
|
+
// \`-<prefix>-1\` for every known prefix lacking negative coverage; candidatesToCss
|
|
1374
|
+
// self-prunes utilities that reject negatives (\`-p-1\` → null), so only genuinely
|
|
1375
|
+
// negative-capable prefixes land in validClasses, giving isValid's / getOrder's
|
|
1376
|
+
// numeric-prefix heuristic the \`-<prefix>\` it needs to accept any \`-<prefix>-<n>\`.
|
|
1377
|
+
const negativeProbes = [];
|
|
1378
|
+
for (const prefix of knownPrefixes) {
|
|
1379
|
+
if (!knownPrefixes.has('-' + prefix)) negativeProbes.push('-' + prefix + '-1');
|
|
1380
|
+
}
|
|
1381
|
+
if (negativeProbes.length > 0) {
|
|
1382
|
+
const negResults = ds.candidatesToCss(negativeProbes.map(pfx));
|
|
1383
|
+
for (let i = 0; i < negativeProbes.length; i++) {
|
|
1384
|
+
if (negResults[i] != null && !validSet.has(negativeProbes[i])) {
|
|
1385
|
+
validClasses.push(negativeProbes[i]);
|
|
1386
|
+
validSet.add(negativeProbes[i]);
|
|
1387
|
+
}
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
|
|
1337
1391
|
// Marker classes: group/peer don't produce CSS but enable group-hover:/peer-checked: variants
|
|
1338
1392
|
const allVariants = ds.getVariants();
|
|
1339
1393
|
for (const v of allVariants) {
|
|
@@ -1380,6 +1434,11 @@ async function main() {
|
|
|
1380
1434
|
'decoration-clone', 'decoration-slice',
|
|
1381
1435
|
'bg-gradient-to-t', 'bg-gradient-to-tr', 'bg-gradient-to-r', 'bg-gradient-to-br',
|
|
1382
1436
|
'bg-gradient-to-b', 'bg-gradient-to-bl', 'bg-gradient-to-l', 'bg-gradient-to-tl',
|
|
1437
|
+
// v3 background/object-position spellings reordered in v4 (#37):
|
|
1438
|
+
// \`bg-left-top\` -> \`bg-top-left\`. canonicalizeCandidates rewrites them, so
|
|
1439
|
+
// enforce-canonical suggests the v4 form and no-unknown-classes accepts them.
|
|
1440
|
+
'bg-left-top', 'bg-right-top', 'bg-left-bottom', 'bg-right-bottom',
|
|
1441
|
+
'object-left-top', 'object-right-top', 'object-left-bottom', 'object-right-bottom',
|
|
1383
1442
|
];
|
|
1384
1443
|
for (const cls of validClasses) {
|
|
1385
1444
|
if (cls.startsWith('inset-s-')) legacyCandidates.push('start-' + cls.slice(8));
|
|
@@ -1508,6 +1567,14 @@ async function main() {
|
|
|
1508
1567
|
}
|
|
1509
1568
|
}
|
|
1510
1569
|
|
|
1570
|
+
// cssProps for the curated static extras (#37) so they participate in conflict
|
|
1571
|
+
// detection exactly like their getClassList siblings (e.g. \`@container-size\` and
|
|
1572
|
+
// \`@container\` both declaring \`container-type\`).
|
|
1573
|
+
for (const name in staticExtraCss) {
|
|
1574
|
+
const props = extractRootCssProps(staticExtraCss[name], pfx(name));
|
|
1575
|
+
if (props.length > 0) cssProps[name] = props;
|
|
1576
|
+
}
|
|
1577
|
+
|
|
1511
1578
|
// Variant ordering from the design system
|
|
1512
1579
|
const variantOrder = {};
|
|
1513
1580
|
const variants = ds.getVariants();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oxlint-tailwindcss",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Tailwind CSS linting rules for oxlint",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"css",
|
|
@@ -51,13 +51,13 @@
|
|
|
51
51
|
"prepublishOnly": "pnpm run build"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@tailwindcss/node": "^4.3.
|
|
55
|
-
"tailwindcss": "^4.3.
|
|
54
|
+
"@tailwindcss/node": "^4.3.1",
|
|
55
|
+
"tailwindcss": "^4.3.1"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@oxlint/plugins": "catalog:",
|
|
59
59
|
"@tailwindcss/typography": "^0.5.20",
|
|
60
|
-
"@types/node": "^25.9.
|
|
60
|
+
"@types/node": "^25.9.3",
|
|
61
61
|
"@typescript/native-preview": "7.0.0-dev.20260608.1",
|
|
62
62
|
"oxlint": "catalog:",
|
|
63
63
|
"tailwindcss-animate": "^1.0.7",
|