tailwind-lint 0.13.0 → 0.13.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
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- const require_linter = require("./linter-gjoSGNMw.cjs");
2
+ const require_linter = require("./linter-B-Bi_uRJ.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");
@@ -30,6 +30,7 @@ let vscode_languageserver_textdocument = require("vscode-languageserver-textdocu
30
30
  let node_module = require("node:module");
31
31
  let node_fs = require("node:fs");
32
32
  node_fs = __toESM(node_fs, 1);
33
+ let node_url = require("node:url");
33
34
  let postcss = require("postcss");
34
35
  postcss = __toESM(postcss, 1);
35
36
  let node_fs_promises = require("node:fs/promises");
@@ -545,6 +546,25 @@ function extractConfigMetadata(state) {
545
546
  //#endregion
546
547
  //#region src/adapters/v4-adapter.ts
547
548
  const require$3 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href || __filename);
549
+ function resolveModule(id, paths) {
550
+ let firstError;
551
+ for (const dir of paths) try {
552
+ return (0, node_module.createRequire)(node_path.join(dir, "noop.js")).resolve(id);
553
+ } catch (error) {
554
+ firstError ??= error;
555
+ }
556
+ throw firstError ?? /* @__PURE__ */ new Error(`Cannot find module "${id}"`);
557
+ }
558
+ async function importModule(modulePath) {
559
+ let mod;
560
+ try {
561
+ mod = await import((0, node_url.pathToFileURL)(modulePath).href);
562
+ } catch {
563
+ mod = require$3(modulePath);
564
+ }
565
+ if (mod !== null && typeof mod === "object" && "default" in mod) return mod.default;
566
+ return mod;
567
+ }
548
568
  function fromPostcss(nodes) {
549
569
  return nodes.map((node) => {
550
570
  switch (node.type) {
@@ -583,11 +603,10 @@ async function loadV4DesignSystem(state, resolvePaths, target, verbose = false)
583
603
  base: node_path.dirname(target.path),
584
604
  async loadModule(id, base, _type) {
585
605
  try {
586
- const modulePath = require$3.resolve(id, { paths: [base, ...resolvePaths] });
587
- const module = require$3(modulePath);
606
+ const modulePath = resolveModule(id, [base, ...resolvePaths]);
588
607
  return {
589
608
  base: node_path.dirname(modulePath),
590
- module
609
+ module: await importModule(modulePath)
591
610
  };
592
611
  } catch (error) {
593
612
  throw new Error(`Failed to load module "${id}": ${error instanceof Error ? error.message : String(error)}`);
package/dist/linter.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_linter = require("./linter-gjoSGNMw.cjs");
2
+ const require_linter = require("./linter-B-Bi_uRJ.cjs");
3
3
  exports.extractImportSourceDirectives = require_linter.extractImportSourceDirectives;
4
4
  exports.extractSourcePatterns = require_linter.extractSourcePatterns;
5
5
  exports.lint = require_linter.lint;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind-lint",
3
- "version": "0.13.0",
3
+ "version": "0.13.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",