tailwind-canonical 0.7.0 → 0.7.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 +12 -3
- package/dist/cli/cli.d.ts +2 -11
- package/dist/cli/cli.js +176 -471
- package/dist/cli/format.d.ts +3 -0
- package/dist/cli/format.js +11 -0
- package/dist/cli/reporters.d.ts +69 -0
- package/dist/cli/reporters.js +333 -0
- package/dist/cli/types.d.ts +16 -0
- package/dist/cli/types.js +1 -0
- package/dist/cli/watch.d.ts +11 -0
- package/dist/cli/watch.js +33 -0
- package/dist/core/analyzer.js +3 -2
- package/dist/core/class-strings.js +13 -7
- package/dist/core/config.d.ts +1 -1
- package/dist/core/config.js +25 -42
- package/dist/core/consistency.d.ts +1 -1
- package/dist/core/deduplicator.js +110 -170
- package/dist/core/merger.js +9 -3
- package/dist/core/rules.js +38 -60
- package/dist/core/scanner.js +23 -20
- package/dist/core/sorter.js +80 -7
- package/dist/core/suppressions.d.ts +1 -2
- package/dist/core/suppressions.js +17 -13
- package/dist/core/typos.js +3 -2
- package/dist/eslint/plugin.js +62 -28
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -140,6 +140,11 @@ npx tailwind-canonical --fix --reporter json ./src
|
|
|
140
140
|
npx tailwind-canonical --reporter sarif ./src > results.sarif
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
+
Each result's `artifactLocation.uri` is relative to the git root (falling back to the working
|
|
144
|
+
directory), with `uriBaseId: "%SRCROOT%"`, so Code Scanning maps it from any subdirectory.
|
|
145
|
+
Results also carry `level`, a full `region` (start/end column) and line-independent
|
|
146
|
+
`partialFingerprints`; `tool.driver.version` records the emitting version.
|
|
147
|
+
|
|
143
148
|
**GitHub Actions integration:**
|
|
144
149
|
```yaml
|
|
145
150
|
- run: npx tailwind-canonical --reporter sarif ./src > results.sarif
|
|
@@ -349,10 +354,14 @@ left-2 right-2 → inset-x-2
|
|
|
349
354
|
| `h-[64px]` | `h-16` | Spacing scale ÷4 |
|
|
350
355
|
| `w-[50%]` | `w-1/2` | Percentage fractions |
|
|
351
356
|
| `opacity-[0.5]` | `opacity-50` | Opacity scale |
|
|
352
|
-
| `text-[11px]` | `text-2xs` |
|
|
353
|
-
| `text-[8px]`–`text-[10px]` | `text-3xs` |
|
|
357
|
+
| `text-[11px]` | `text-2xs` | Requires `customTextTokens` |
|
|
358
|
+
| `text-[8px]`–`text-[10px]` | `text-3xs` | Requires `customTextTokens` |
|
|
359
|
+
|
|
360
|
+
`text-2xs` and `text-3xs` are not stock Tailwind tokens, so they are not in the built-in text size map — without config, `text-[11px]` and `text-[8px]`–`text-[10px]` are left untouched. Enable them with `customTextTokens`:
|
|
354
361
|
|
|
355
|
-
|
|
362
|
+
```ts
|
|
363
|
+
export default { customTextTokens: { 8: '3xs', 9: '3xs', 10: '3xs', 11: '2xs' } }
|
|
364
|
+
```
|
|
356
365
|
|
|
357
366
|
Non-divisible values (`h-[22px]`, `px-[7px]`) are left untouched.
|
|
358
367
|
|
package/dist/cli/cli.d.ts
CHANGED
|
@@ -1,13 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
error: (s: string) => void;
|
|
4
|
-
write: (s: string) => void;
|
|
5
|
-
};
|
|
6
|
-
export type RunResult = {
|
|
7
|
-
exitCode: number;
|
|
8
|
-
watching?: boolean;
|
|
9
|
-
};
|
|
10
|
-
type Reporter = 'text' | 'json' | 'sarif';
|
|
1
|
+
import type { Reporter, RunResult, Sink } from './types.js';
|
|
2
|
+
export type { RunResult, Sink } from './types.js';
|
|
11
3
|
type Flags = {
|
|
12
4
|
fix: boolean;
|
|
13
5
|
merge: boolean;
|
|
@@ -37,4 +29,3 @@ export declare function parseArgs(argv: string[]): Flags;
|
|
|
37
29
|
*/
|
|
38
30
|
export declare function flagWarnings(flags: Flags): string[];
|
|
39
31
|
export declare function run(argv: string[], cwd: string, sink?: Sink): Promise<RunResult>;
|
|
40
|
-
export {};
|