tailwind-lint 0.11.0 → 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 CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_linter = require("./linter-BygZ0yGf.cjs");
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
@@ -122,7 +124,7 @@ function resolveOptions(files, options) {
122
124
  };
123
125
  }
124
126
  function truncateFilename(filename) {
125
- return filename.length > MAX_FILENAME_DISPLAY_LENGTH ? `...${filename.slice(-MAX_FILENAME_DISPLAY_LENGTH)}` : filename;
127
+ return filename.length > MAX_FILENAME_DISPLAY_LENGTH ? `...${filename.slice(-50)}` : filename;
126
128
  }
127
129
  async function displayResults(files, fixMode) {
128
130
  let totalErrors = 0;
@@ -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");
@@ -469,6 +476,7 @@ function createEditorState(cwd) {
469
476
  * Error thrown when adapter fails to load required modules
470
477
  */
471
478
  var AdapterLoadError = class extends Error {
479
+ version;
472
480
  constructor(version, cause) {
473
481
  super(`Failed to load ${version} adapter: ${cause.message}`);
474
482
  this.version = version;
@@ -947,17 +955,27 @@ async function lint({ cwd, patterns, configPath, autoDiscover, fix = false, verb
947
955
  const state = await initializeState(cwd, configPath, verbose);
948
956
  const discoveredFiles = await discoverFiles(cwd, patterns, configPath, autoDiscover);
949
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
+ });
950
966
  if (verbose) {
951
- console.log(ansis.default.cyan.bold(`→ Discovered ${files.length} file${files.length !== 1 ? "s" : ""} to lint`));
967
+ console.log(ansis.default.cyan.bold(`→ Discovered ${lintableFiles.length} file${lintableFiles.length !== 1 ? "s" : ""} to lint`));
952
968
  console.log();
953
969
  }
954
- if (files.length === 0) return {
970
+ if (lintableFiles.length === 0) return {
955
971
  files: [],
956
- totalFilesProcessed: 0
972
+ totalFilesProcessed: 0,
973
+ skippedFiles
957
974
  };
958
975
  return {
959
- files: (await processFiles(state, cwd, files, fix, onProgress)).filter((result) => result.diagnostics.length > 0 || result.fixed),
960
- totalFilesProcessed: files.length
976
+ files: (await processFiles(state, cwd, lintableFiles, fix, onProgress)).filter((result) => result.diagnostics.length > 0 || result.fixed),
977
+ totalFilesProcessed: lintableFiles.length,
978
+ skippedFiles
961
979
  };
962
980
  }
963
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-BygZ0yGf.cjs");
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
@@ -371,6 +371,7 @@ interface LintOptions {
371
371
  interface LintResult {
372
372
  files: LintFileResult[];
373
373
  totalFilesProcessed: number;
374
+ skippedFiles: string[];
374
375
  }
375
376
  //#endregion
376
377
  //#region src/linter.d.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-lint",
3
- "version": "0.11.0",
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.2.0",
63
- "commander": "^14.0.3",
64
- "postcss": "^8.5.10",
65
- "tinyglobby": "^0.2.16",
62
+ "ansis": "^4.3.1",
63
+ "commander": "^15.0.0",
64
+ "postcss": "^8.5.15",
65
+ "tinyglobby": "^0.2.17",
66
66
  "vscode-languageserver-textdocument": "^1.0.12"
67
67
  },
68
68
  "devDependencies": {
69
- "@types/node": "^25.6.0",
70
- "oxfmt": "^0.46.0",
71
- "oxlint": "^1.61.0",
72
- "tsdown": "^0.21.10",
69
+ "@types/node": "^25.9.1",
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.5"
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@10.33.2"
80
+ "packageManager": "pnpm@11.5.1"
81
81
  }