tailwind-lint 0.12.0 → 0.12.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/dist/cli.cjs
CHANGED
|
@@ -121,7 +121,8 @@ const SEVERITY = {
|
|
|
121
121
|
const TAILWIND_V4_IMPORT_REGEX = /@import\s+["']tailwindcss(?:["'\s/]|$)/;
|
|
122
122
|
const TAILWIND_VITE_PLUGIN_REGEX = /(?:from\s+["']@tailwindcss\/vite["']|require\(\s*["']@tailwindcss\/vite["']\s*\)|import\(\s*["']@tailwindcss\/vite["']\s*\))/;
|
|
123
123
|
function getLanguageId(filePath) {
|
|
124
|
-
|
|
124
|
+
const ext = filePath.substring(filePath.lastIndexOf(".")).toLowerCase();
|
|
125
|
+
return LANGUAGE_MAP[ext] || "html";
|
|
125
126
|
}
|
|
126
127
|
//#endregion
|
|
127
128
|
//#region src/code-actions.ts
|
|
@@ -488,7 +489,8 @@ var AdapterLoadError = class extends Error {
|
|
|
488
489
|
const require$4 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href || __filename);
|
|
489
490
|
async function loadV3ClassMetadata(state, cwd, verbose = false) {
|
|
490
491
|
try {
|
|
491
|
-
const
|
|
492
|
+
const tailwindPath = require$4.resolve("tailwindcss", { paths: [cwd] });
|
|
493
|
+
const tailwindcss = require$4(tailwindPath);
|
|
492
494
|
try {
|
|
493
495
|
const tailwindDir = node_path.dirname(require$4.resolve("tailwindcss/package.json", { paths: [cwd] }));
|
|
494
496
|
const contextUtils = require$4(node_path.join(tailwindDir, "lib", "lib", "setupContextUtils"));
|
|
@@ -554,7 +556,8 @@ function extractConfigMetadata(state) {
|
|
|
554
556
|
const require$3 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href || __filename);
|
|
555
557
|
async function loadV4DesignSystem(state, cwd, configPath, verbose = false) {
|
|
556
558
|
try {
|
|
557
|
-
const
|
|
559
|
+
const tailwindPath = require$3.resolve("tailwindcss", { paths: [cwd] });
|
|
560
|
+
const tailwindcss = require$3(tailwindPath);
|
|
558
561
|
if (tailwindcss !== null && tailwindcss !== void 0 && (typeof tailwindcss === "object" || typeof tailwindcss === "function") && "__unstable__loadDesignSystem" in tailwindcss && typeof tailwindcss.__unstable__loadDesignSystem === "function") {
|
|
559
562
|
let cssContent;
|
|
560
563
|
const basePath = node_path.dirname(configPath);
|
|
@@ -779,7 +782,8 @@ async function createState(cwd, configPath, verbose = false) {
|
|
|
779
782
|
const resolvedConfigPath = await findTailwindConfigPath(cwd, configPath);
|
|
780
783
|
if (!resolvedConfigPath) throw new Error("Could not find Tailwind config file. Expected one of:\n • Tailwind v4 (CSS): app.css, index.css, tailwind.css in project root or src/\n • Tailwind v4 (Vite): vite.config.* with @tailwindcss/vite\n • Tailwind v3 (JS): tailwind.config.js, tailwind.config.ts\nRun 'npx tailwindcss init' to create a config file.");
|
|
781
784
|
const isCssConfig = isCssConfigFile(resolvedConfigPath);
|
|
782
|
-
const
|
|
785
|
+
const tailwindPath = resolveTailwindPath(cwd, node_path.dirname(resolvedConfigPath));
|
|
786
|
+
const tailwindcss = require$1(tailwindPath);
|
|
783
787
|
const version = getTailwindVersion(cwd);
|
|
784
788
|
const isV4 = isV4Config(version);
|
|
785
789
|
if (verbose) {
|
|
@@ -868,7 +872,7 @@ async function discoverFilesFromConfig(cwd, configPath) {
|
|
|
868
872
|
const includeConfigFile = (files) => {
|
|
869
873
|
if (!fileExists(configFilePath)) return files;
|
|
870
874
|
const relativeConfigPath = node_path.relative(discoveryCwd, configFilePath);
|
|
871
|
-
return [
|
|
875
|
+
return [.../* @__PURE__ */ new Set([relativeConfigPath, ...files])].sort((a, b) => a.localeCompare(b));
|
|
872
876
|
};
|
|
873
877
|
const resolveDiscoveredFiles = (files) => discoveryCwd === cwd ? files : files.map((file) => node_path.resolve(discoveryCwd, file)).sort((a, b) => a.localeCompare(b));
|
|
874
878
|
const { include, exclude } = extractSourcePatterns(cssContent);
|
|
@@ -885,7 +889,7 @@ async function discoverFilesFromConfig(cwd, configPath) {
|
|
|
885
889
|
if (!importSource.disableAutoSource) autoPatterns = importSource.roots.length > 0 ? importSource.roots.map((root) => resolveFromConfig(normalizeSourcePattern(root))) : [DEFAULT_FILE_PATTERN];
|
|
886
890
|
const autoFiles = autoPatterns.length > 0 ? await expandPatterns(discoveryCwd, autoPatterns, extraIgnore) : [];
|
|
887
891
|
const explicitFiles = explicitSourcePatterns.length > 0 ? await expandPatterns(discoveryCwd, explicitSourcePatterns, resolvedExclude) : [];
|
|
888
|
-
return resolveDiscoveredFiles(includeConfigFile([
|
|
892
|
+
return resolveDiscoveredFiles(includeConfigFile([.../* @__PURE__ */ new Set([...autoFiles, ...explicitFiles])].sort((a, b) => a.localeCompare(b))));
|
|
889
893
|
}
|
|
890
894
|
function normalizeSourcePattern(pattern) {
|
|
891
895
|
if (GLOB_PATTERN_REGEX.test(pattern) || node_path.extname(pattern)) return pattern;
|
package/dist/linter.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_linter = require("./linter-
|
|
2
|
+
const require_linter = require("./linter-BP0uKBfa.cjs");
|
|
3
3
|
exports.extractImportSourceDirectives = require_linter.extractImportSourceDirectives;
|
|
4
4
|
exports.extractSourcePatterns = require_linter.extractSourcePatterns;
|
|
5
5
|
exports.lint = require_linter.lint;
|
package/dist/linter.d.cts
CHANGED
|
@@ -383,14 +383,6 @@ declare function extractImportSourceDirectives(cssContent: string): {
|
|
|
383
383
|
roots: string[];
|
|
384
384
|
disableAutoSource: boolean;
|
|
385
385
|
};
|
|
386
|
-
declare function lint({
|
|
387
|
-
cwd,
|
|
388
|
-
patterns,
|
|
389
|
-
configPath,
|
|
390
|
-
autoDiscover,
|
|
391
|
-
fix,
|
|
392
|
-
verbose,
|
|
393
|
-
onProgress
|
|
394
|
-
}: LintOptions): Promise<LintResult>;
|
|
386
|
+
declare function lint({ cwd, patterns, configPath, autoDiscover, fix, verbose, onProgress }: LintOptions): Promise<LintResult>;
|
|
395
387
|
//#endregion
|
|
396
388
|
export { type LintFileResult, type LintOptions, type LintResult, extractImportSourceDirectives, extractSourcePatterns, lint };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwind-lint",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "A command-line tool that uses the Tailwind CSS IntelliSense plugin to show linting suggestions for your Tailwind CSS classes",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -61,21 +61,21 @@
|
|
|
61
61
|
"@tailwindcss/language-service": "^0.14.29",
|
|
62
62
|
"ansis": "^4.3.1",
|
|
63
63
|
"commander": "^15.0.0",
|
|
64
|
-
"postcss": "^8.5.
|
|
64
|
+
"postcss": "^8.5.19",
|
|
65
65
|
"tinyglobby": "^0.2.17",
|
|
66
66
|
"vscode-languageserver-textdocument": "^1.0.12"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
|
-
"@types/node": "^
|
|
70
|
-
"oxfmt": "^0.
|
|
71
|
-
"oxlint": "^1.
|
|
72
|
-
"tsdown": "^0.22.
|
|
73
|
-
"typescript": "^
|
|
74
|
-
"vitest": "^4.1.
|
|
69
|
+
"@types/node": "^26.1.1",
|
|
70
|
+
"oxfmt": "^0.58.0",
|
|
71
|
+
"oxlint": "^1.73.0",
|
|
72
|
+
"tsdown": "^0.22.7",
|
|
73
|
+
"typescript": "^7.0.2",
|
|
74
|
+
"vitest": "^4.1.10"
|
|
75
75
|
},
|
|
76
76
|
"engines": {
|
|
77
77
|
"node": ">=22.0.0",
|
|
78
78
|
"pnpm": ">=10.0.0"
|
|
79
79
|
},
|
|
80
|
-
"packageManager": "pnpm@11.
|
|
80
|
+
"packageManager": "pnpm@11.13.0"
|
|
81
81
|
}
|