oxlint-tailwindcss 1.15.1 → 1.17.0
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/config.cjs +2 -4
- package/dist/config.d.cts +9 -4
- package/dist/config.d.mts +9 -4
- package/dist/config.mjs +2 -4
- package/dist/index.cjs +190 -144
- package/dist/index.d.cts +0 -3
- package/dist/index.d.mts +0 -4
- package/dist/index.mjs +191 -146
- package/package.json +4 -4
package/dist/config.cjs
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
let node_url = require("node:url");
|
|
6
|
-
|
|
6
|
+
// src/recommended.ts
|
|
7
7
|
/**
|
|
8
8
|
* The recommended rules at their severities: what `oxlint-tailwindcss/config`
|
|
9
9
|
* turns on. A static map, so the config entry never loads the plugin itself;
|
|
@@ -29,8 +29,7 @@ const RECOMMENDED_RULES = {
|
|
|
29
29
|
"tailwindcss/no-unnecessary-arbitrary-value": "warn",
|
|
30
30
|
"tailwindcss/no-unnecessary-whitespace": "warn"
|
|
31
31
|
};
|
|
32
|
-
|
|
33
|
-
//#region src/config.ts
|
|
32
|
+
// src/config.ts
|
|
34
33
|
/**
|
|
35
34
|
* `oxlint-tailwindcss/config`: the plugin and its recommended rules as an
|
|
36
35
|
* oxlint config object, for `extends` in an `oxlint.config.ts` and in the
|
|
@@ -79,6 +78,5 @@ function tailwindcss(options = {}) {
|
|
|
79
78
|
rules: options.recommended === false ? {} : { ...RECOMMENDED_RULES }
|
|
80
79
|
};
|
|
81
80
|
}
|
|
82
|
-
//#endregion
|
|
83
81
|
exports.default = tailwindcss;
|
|
84
82
|
exports.tailwindcss = tailwindcss;
|
package/dist/config.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types.d.ts
|
|
2
1
|
interface ExtractorExclusions {
|
|
3
2
|
/** Default attribute names to exclude */
|
|
4
3
|
attributes?: string[];
|
|
@@ -86,11 +85,18 @@ interface PluginSettings {
|
|
|
86
85
|
tags?: string[];
|
|
87
86
|
/** Additional regex patterns (as strings) for variable names to scan (added to defaults) */
|
|
88
87
|
variablePatterns?: string[];
|
|
88
|
+
/**
|
|
89
|
+
* Regex patterns (as strings) for variables that hold a lookup table: an
|
|
90
|
+
* object literal whose VALUES are class strings, e.g.
|
|
91
|
+
* `const TONE_CLASSES = { warning: "text-amber-700", ok: "text-green-700" }`.
|
|
92
|
+
* `variablePatterns` reads an object's KEYS as conditional classes
|
|
93
|
+
* (`{ "bg-red-500": isError }`), so it can't read these. Nested tables are
|
|
94
|
+
* read value by value. Empty by default.
|
|
95
|
+
*/
|
|
96
|
+
lookupTablePatterns?: string[];
|
|
89
97
|
/** Remove specific items from the built-in defaults */
|
|
90
98
|
exclude?: ExtractorExclusions;
|
|
91
99
|
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/config.d.ts
|
|
94
100
|
export type TailwindcssConfigOptions = {
|
|
95
101
|
/**
|
|
96
102
|
* Turn on the recommended rules at their severities (default `true`).
|
|
@@ -110,5 +116,4 @@ export type TailwindcssConfig = {
|
|
|
110
116
|
* a missing entry point on every file, far from the line that caused it.
|
|
111
117
|
*/
|
|
112
118
|
export declare function tailwindcss(options?: TailwindcssConfigOptions): TailwindcssConfig;
|
|
113
|
-
//#endregion
|
|
114
119
|
export { type CalleeExtractorKind, type EntryPointMapping, type ExtractorExclusions, type PluginSettings, tailwindcss as default };
|
package/dist/config.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region src/types.d.ts
|
|
2
1
|
interface ExtractorExclusions {
|
|
3
2
|
/** Default attribute names to exclude */
|
|
4
3
|
attributes?: string[];
|
|
@@ -86,11 +85,18 @@ interface PluginSettings {
|
|
|
86
85
|
tags?: string[];
|
|
87
86
|
/** Additional regex patterns (as strings) for variable names to scan (added to defaults) */
|
|
88
87
|
variablePatterns?: string[];
|
|
88
|
+
/**
|
|
89
|
+
* Regex patterns (as strings) for variables that hold a lookup table: an
|
|
90
|
+
* object literal whose VALUES are class strings, e.g.
|
|
91
|
+
* `const TONE_CLASSES = { warning: "text-amber-700", ok: "text-green-700" }`.
|
|
92
|
+
* `variablePatterns` reads an object's KEYS as conditional classes
|
|
93
|
+
* (`{ "bg-red-500": isError }`), so it can't read these. Nested tables are
|
|
94
|
+
* read value by value. Empty by default.
|
|
95
|
+
*/
|
|
96
|
+
lookupTablePatterns?: string[];
|
|
89
97
|
/** Remove specific items from the built-in defaults */
|
|
90
98
|
exclude?: ExtractorExclusions;
|
|
91
99
|
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/config.d.ts
|
|
94
100
|
export type TailwindcssConfigOptions = {
|
|
95
101
|
/**
|
|
96
102
|
* Turn on the recommended rules at their severities (default `true`).
|
|
@@ -110,5 +116,4 @@ export type TailwindcssConfig = {
|
|
|
110
116
|
* a missing entry point on every file, far from the line that caused it.
|
|
111
117
|
*/
|
|
112
118
|
export declare function tailwindcss(options?: TailwindcssConfigOptions): TailwindcssConfig;
|
|
113
|
-
//#endregion
|
|
114
119
|
export { type CalleeExtractorKind, type EntryPointMapping, type ExtractorExclusions, type PluginSettings, tailwindcss as default };
|
package/dist/config.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
|
-
|
|
2
|
+
// src/recommended.ts
|
|
3
3
|
/**
|
|
4
4
|
* The recommended rules at their severities: what `oxlint-tailwindcss/config`
|
|
5
5
|
* turns on. A static map, so the config entry never loads the plugin itself;
|
|
@@ -25,8 +25,7 @@ const RECOMMENDED_RULES = {
|
|
|
25
25
|
"tailwindcss/no-unnecessary-arbitrary-value": "warn",
|
|
26
26
|
"tailwindcss/no-unnecessary-whitespace": "warn"
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
//#region src/config.ts
|
|
28
|
+
// src/config.ts
|
|
30
29
|
/**
|
|
31
30
|
* `oxlint-tailwindcss/config`: the plugin and its recommended rules as an
|
|
32
31
|
* oxlint config object, for `extends` in an `oxlint.config.ts` and in the
|
|
@@ -75,5 +74,4 @@ function tailwindcss(options = {}) {
|
|
|
75
74
|
rules: options.recommended === false ? {} : { ...RECOMMENDED_RULES }
|
|
76
75
|
};
|
|
77
76
|
}
|
|
78
|
-
//#endregion
|
|
79
77
|
export { tailwindcss as default, tailwindcss };
|