tailwind-lint 0.11.1 → 0.11.2
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 +13 -7
- package/dist/{linter-BBFc8gnJ.cjs → linter-B9R7nuem.cjs} +22 -5
- package/dist/linter.cjs +1 -1
- package/dist/linter.d.cts +1 -0
- package/package.json +9 -9
package/dist/cli.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const require_linter = require("./linter-
|
|
2
|
+
const require_linter = require("./linter-B9R7nuem.cjs");
|
|
3
3
|
let node_path = require("node:path");
|
|
4
4
|
node_path = require_linter.__toESM(node_path, 1);
|
|
5
5
|
let ansis = require("ansis");
|
|
@@ -37,7 +37,7 @@ function toJsonDiagnostic(diagnostic) {
|
|
|
37
37
|
source: diagnostic.source
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
function createJsonOutput({ files, totalFilesProcessed, cwd, configPath, autoDiscover, fix, patterns }) {
|
|
40
|
+
function createJsonOutput({ files, totalFilesProcessed, skippedFiles = [], cwd, configPath, autoDiscover, fix, patterns }) {
|
|
41
41
|
let errors = 0;
|
|
42
42
|
let warnings = 0;
|
|
43
43
|
let fixed = 0;
|
|
@@ -71,7 +71,8 @@ function createJsonOutput({ files, totalFilesProcessed, cwd, configPath, autoDis
|
|
|
71
71
|
fix,
|
|
72
72
|
patterns
|
|
73
73
|
},
|
|
74
|
-
files: mappedFiles
|
|
74
|
+
files: mappedFiles,
|
|
75
|
+
skippedFiles
|
|
75
76
|
};
|
|
76
77
|
}
|
|
77
78
|
function createJsonErrorOutput({ error, cwd, configPath, autoDiscover, fix, patterns }) {
|
|
@@ -92,7 +93,8 @@ function createJsonErrorOutput({ error, cwd, configPath, autoDiscover, fix, patt
|
|
|
92
93
|
fix,
|
|
93
94
|
patterns
|
|
94
95
|
},
|
|
95
|
-
files: []
|
|
96
|
+
files: [],
|
|
97
|
+
skippedFiles: []
|
|
96
98
|
};
|
|
97
99
|
}
|
|
98
100
|
//#endregion
|
|
@@ -250,11 +252,13 @@ ${ansis.default.bold.cyan("Notes:")}
|
|
|
250
252
|
}
|
|
251
253
|
});
|
|
252
254
|
if (process.stdout.isTTY && !resolved.verbose && !isJsonOutput) process.stdout.write(`\r${" ".repeat(80)}\r`);
|
|
255
|
+
if (results.skippedFiles.length > 0 && !isJsonOutput) for (const skipped of results.skippedFiles) console.log(ansis.default.yellow(`⚠ Skipped ${truncateFilename(skipped)} (exceeds size limit)`));
|
|
253
256
|
if (results.totalFilesProcessed === 0) {
|
|
254
257
|
if (isJsonOutput) console.log(JSON.stringify(createJsonOutput({
|
|
255
258
|
...resolved,
|
|
256
259
|
files: [],
|
|
257
|
-
totalFilesProcessed: 0
|
|
260
|
+
totalFilesProcessed: 0,
|
|
261
|
+
skippedFiles: results.skippedFiles
|
|
258
262
|
})));
|
|
259
263
|
else {
|
|
260
264
|
console.log();
|
|
@@ -266,7 +270,8 @@ ${ansis.default.bold.cyan("Notes:")}
|
|
|
266
270
|
if (isJsonOutput) console.log(JSON.stringify(createJsonOutput({
|
|
267
271
|
...resolved,
|
|
268
272
|
files: [],
|
|
269
|
-
totalFilesProcessed: results.totalFilesProcessed
|
|
273
|
+
totalFilesProcessed: results.totalFilesProcessed,
|
|
274
|
+
skippedFiles: results.skippedFiles
|
|
270
275
|
})));
|
|
271
276
|
else console.log(ansis.default.green.bold("✔ No issues found"));
|
|
272
277
|
process.exit(0);
|
|
@@ -274,7 +279,8 @@ ${ansis.default.bold.cyan("Notes:")}
|
|
|
274
279
|
if (isJsonOutput) console.log(JSON.stringify(createJsonOutput({
|
|
275
280
|
...resolved,
|
|
276
281
|
files: results.files,
|
|
277
|
-
totalFilesProcessed: results.totalFilesProcessed
|
|
282
|
+
totalFilesProcessed: results.totalFilesProcessed,
|
|
283
|
+
skippedFiles: results.skippedFiles
|
|
278
284
|
})));
|
|
279
285
|
else await displayResults(results.files, resolved.fix);
|
|
280
286
|
const hasErrors = results.files.some((file) => file.diagnostics.some((d) => d.severity === require_linter.SEVERITY.ERROR));
|
|
@@ -214,6 +214,13 @@ function fileExists(filePath) {
|
|
|
214
214
|
return false;
|
|
215
215
|
}
|
|
216
216
|
}
|
|
217
|
+
function getFileSize(filePath) {
|
|
218
|
+
try {
|
|
219
|
+
return node_fs.statSync(filePath).size;
|
|
220
|
+
} catch {
|
|
221
|
+
return 0;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
217
224
|
function readFileSync(filePath) {
|
|
218
225
|
if (!filePath || typeof filePath !== "string") throw new TypeError("File path must be a non-empty string");
|
|
219
226
|
return node_fs.readFileSync(filePath, "utf-8");
|
|
@@ -948,17 +955,27 @@ async function lint({ cwd, patterns, configPath, autoDiscover, fix = false, verb
|
|
|
948
955
|
const state = await initializeState(cwd, configPath, verbose);
|
|
949
956
|
const discoveredFiles = await discoverFiles(cwd, patterns, configPath, autoDiscover);
|
|
950
957
|
const files = state.configPath && isCssConfigFile(state.configPath) && fileExists(state.configPath) ? [...new Set([node_path.relative(cwd, state.configPath), ...discoveredFiles])].sort((a, b) => a.localeCompare(b)) : discoveredFiles;
|
|
958
|
+
const skippedFiles = [];
|
|
959
|
+
const lintableFiles = files.filter((file) => {
|
|
960
|
+
if (getFileSize(node_path.isAbsolute(file) ? file : node_path.resolve(cwd, file)) > 524288) {
|
|
961
|
+
skippedFiles.push(file);
|
|
962
|
+
return false;
|
|
963
|
+
}
|
|
964
|
+
return true;
|
|
965
|
+
});
|
|
951
966
|
if (verbose) {
|
|
952
|
-
console.log(ansis.default.cyan.bold(`→ Discovered ${
|
|
967
|
+
console.log(ansis.default.cyan.bold(`→ Discovered ${lintableFiles.length} file${lintableFiles.length !== 1 ? "s" : ""} to lint`));
|
|
953
968
|
console.log();
|
|
954
969
|
}
|
|
955
|
-
if (
|
|
970
|
+
if (lintableFiles.length === 0) return {
|
|
956
971
|
files: [],
|
|
957
|
-
totalFilesProcessed: 0
|
|
972
|
+
totalFilesProcessed: 0,
|
|
973
|
+
skippedFiles
|
|
958
974
|
};
|
|
959
975
|
return {
|
|
960
|
-
files: (await processFiles(state, cwd,
|
|
961
|
-
totalFilesProcessed:
|
|
976
|
+
files: (await processFiles(state, cwd, lintableFiles, fix, onProgress)).filter((result) => result.diagnostics.length > 0 || result.fixed),
|
|
977
|
+
totalFilesProcessed: lintableFiles.length,
|
|
978
|
+
skippedFiles
|
|
962
979
|
};
|
|
963
980
|
}
|
|
964
981
|
//#endregion
|
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-B9R7nuem.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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tailwind-lint",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.2",
|
|
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",
|
|
@@ -59,23 +59,23 @@
|
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
61
|
"@tailwindcss/language-service": "^0.14.29",
|
|
62
|
-
"ansis": "^4.3.
|
|
63
|
-
"commander": "^
|
|
62
|
+
"ansis": "^4.3.1",
|
|
63
|
+
"commander": "^15.0.0",
|
|
64
64
|
"postcss": "^8.5.15",
|
|
65
|
-
"tinyglobby": "^0.2.
|
|
65
|
+
"tinyglobby": "^0.2.17",
|
|
66
66
|
"vscode-languageserver-textdocument": "^1.0.12"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@types/node": "^25.9.1",
|
|
70
|
-
"oxfmt": "^0.
|
|
71
|
-
"oxlint": "^1.
|
|
72
|
-
"tsdown": "^0.22.
|
|
70
|
+
"oxfmt": "^0.53.0",
|
|
71
|
+
"oxlint": "^1.68.0",
|
|
72
|
+
"tsdown": "^0.22.2",
|
|
73
73
|
"typescript": "^6.0.3",
|
|
74
|
-
"vitest": "^4.1.
|
|
74
|
+
"vitest": "^4.1.8"
|
|
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.5.1"
|
|
81
81
|
}
|