stylelint-config-inspector 2.3.2 → 2.3.3

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.
Files changed (45) hide show
  1. package/.remarkrc.mjs +9 -0
  2. package/README.md +2 -0
  3. package/dist/cli.cjs +46 -8
  4. package/dist/cli.cjs.map +1 -1
  5. package/dist/cli.mjs +46 -8
  6. package/dist/cli.mjs.map +1 -1
  7. package/dist/nitro.json +1 -1
  8. package/dist/public/200.html +1 -1
  9. package/dist/public/404.html +1 -1
  10. package/dist/public/_nuxt/BG8RThME.js +1 -0
  11. package/dist/public/_nuxt/BOTxb_Tf.js +1 -0
  12. package/dist/public/_nuxt/BRAxAp2P.js +1 -0
  13. package/dist/public/_nuxt/{7D0DbyYU.js → B_EQLqN6.js} +1 -1
  14. package/dist/public/_nuxt/{DnbyOYzK.js → BhAtDtkD.js} +1 -1
  15. package/dist/public/_nuxt/C5Bg1PZi.js +1 -0
  16. package/dist/public/_nuxt/{CTlsJWmu.js → CRalrgW8.js} +3 -3
  17. package/dist/public/_nuxt/{B_--1KNk.js → D6fk1agw.js} +2 -2
  18. package/dist/public/_nuxt/{CylubNoK.js → DLNrKDe5.js} +1 -1
  19. package/dist/public/_nuxt/DXuC58iQ.js +1 -0
  20. package/dist/public/_nuxt/DYK0VwDN.js +1 -0
  21. package/dist/public/_nuxt/DusisEyH.js +1 -0
  22. package/dist/public/_nuxt/{CwpEErv4.js → DvuBpx-x.js} +3 -3
  23. package/dist/public/_nuxt/{CNcjyXqQ.js → IbiyzGrr.js} +1 -1
  24. package/dist/public/_nuxt/PnIxnNo9.js +1 -0
  25. package/dist/public/_nuxt/RuleList.QG5M7cTF.css +1 -0
  26. package/dist/public/_nuxt/V5SopCgz.js +1 -0
  27. package/dist/public/_nuxt/builds/latest.json +1 -1
  28. package/dist/public/_nuxt/builds/meta/163a5255-1f6f-4e70-99a4-8b3d32cbba2b.json +1 -0
  29. package/dist/public/_nuxt/entry.uDIoEhfx.css +1 -0
  30. package/dist/public/index.html +1 -1
  31. package/package.json +28 -92
  32. package/prettier.config.mjs +8 -0
  33. package/stylelint.config.mjs +7 -1279
  34. package/dist/public/_nuxt/AZzY_dlm.js +0 -1
  35. package/dist/public/_nuxt/BODynBkg.js +0 -1
  36. package/dist/public/_nuxt/Bi3wFMiD.js +0 -1
  37. package/dist/public/_nuxt/CMLop-UK.js +0 -1
  38. package/dist/public/_nuxt/DPS593LP.js +0 -1
  39. package/dist/public/_nuxt/DVycKPW-.js +0 -1
  40. package/dist/public/_nuxt/Dwb58Uvi.js +0 -1
  41. package/dist/public/_nuxt/Dx9mJWQW.js +0 -1
  42. package/dist/public/_nuxt/MP0zp0f7.js +0 -1
  43. package/dist/public/_nuxt/RuleList.D_Xl00T3.css +0 -1
  44. package/dist/public/_nuxt/builds/meta/ae984270-210f-4368-bbdf-917b20a8bcb4.json +0 -1
  45. package/dist/public/_nuxt/entry.D_oaAR-A.css +0 -1
package/.remarkrc.mjs ADDED
@@ -0,0 +1,9 @@
1
+ import { createConfig } from "remark-config-nick2bad4u";
2
+
3
+ /** @type {import("remark-config-nick2bad4u").RemarkConfig} */
4
+ const remarkConfig = createConfig({
5
+ settings: {},
6
+ plugins: [],
7
+ });
8
+
9
+ export default remarkConfig;
package/README.md CHANGED
@@ -79,7 +79,9 @@ Run `npx stylelint-config-inspector --help` for all options.
79
79
  ## Contributors ✨
80
80
 
81
81
  <!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
82
+
82
83
  [![All Contributors.](https://img.shields.io/badge/all_contributors-39-orange.svg?style=flat-square)](#contributors-)
84
+
83
85
  <!-- ALL-CONTRIBUTORS-BADGE:END -->
84
86
 
85
87
  Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
package/dist/cli.cjs CHANGED
@@ -4006,6 +4006,7 @@ const REGEXP_SPECIAL_CHARS_RE = /[.*+?^${}()|[\]\\]/g;
4006
4006
  const AT_PREFIX_RE = /^@/;
4007
4007
  const STYLELINT_PLUGIN_PREFIX_RE = /^stylelint-plugin-/;
4008
4008
  const STYLELINT_PACKAGE_PREFIX_RE = /^stylelint-/;
4009
+ const STYLELINT_CONFIG_PACKAGE_IMPORT_RE = /^(?:stylelint-config(?:-|$)|@[^/]+\/stylelint-config(?:-|$))/;
4009
4010
  const SCOPED_STYLELINT_PLUGIN_PACKAGE_RE = /^(@[^/]+)\/stylelint-plugin(?:-(.+))?$/;
4010
4011
  const SCOPED_STYLELINT_PACKAGE_RE = /^(@[^/]+)\/stylelint-(.+)$/;
4011
4012
  const GENERIC_PLUGIN_PREFIXES = new Set([
@@ -4268,15 +4269,50 @@ async function resolvePackageEntryPath(packageRoot) {
4268
4269
  if (await exists(entryPath)) return entryPath;
4269
4270
  }
4270
4271
  }
4271
- async function loadExtendsConfig(resolvedSpecifier, configBasePath) {
4272
- const entryPath = resolvedSpecifier.resolvedPath ?? (resolvedSpecifier.packageRoot ? await resolvePackageEntryPath(resolvedSpecifier.packageRoot) : void 0);
4273
- if (!entryPath) return void 0;
4272
+ async function resolveExtendsEntryPath(resolvedSpecifier) {
4273
+ return resolvedSpecifier.resolvedPath ?? (resolvedSpecifier.packageRoot ? await resolvePackageEntryPath(resolvedSpecifier.packageRoot) : void 0);
4274
+ }
4275
+ async function loadExtendsConfigWithDependencies(resolvedSpecifier, configBasePath) {
4276
+ const entryPath = await resolveExtendsEntryPath(resolvedSpecifier);
4277
+ if (!entryPath) return { dependencies: [] };
4274
4278
  try {
4275
- return (await loadConfigFromPath(entryPath, configBasePath)).config;
4279
+ const loaded = await loadConfigFromPath(entryPath, configBasePath);
4280
+ return {
4281
+ config: loaded.config,
4282
+ dependencies: loaded.dependencies,
4283
+ entryPath
4284
+ };
4276
4285
  } catch {
4277
- return;
4286
+ return {
4287
+ dependencies: [entryPath],
4288
+ entryPath
4289
+ };
4278
4290
  }
4279
4291
  }
4292
+ async function loadExtendsConfig(resolvedSpecifier, configBasePath) {
4293
+ return (await loadExtendsConfigWithDependencies(resolvedSpecifier, configBasePath)).config;
4294
+ }
4295
+ function addDependency(dependencies, dependency, basePath) {
4296
+ dependencies.add(normalize$3((0, node_path.isAbsolute)(dependency) ? dependency : resolve$2(basePath, dependency)));
4297
+ }
4298
+ async function collectExtendsDependencies(configs, workspaceBasePath, configBasePath) {
4299
+ const dependencies = /* @__PURE__ */ new Set();
4300
+ const visited = /* @__PURE__ */ new Set();
4301
+ async function visit(specifier, basePath) {
4302
+ const resolvedSpecifier = await resolveExtendsSpecifier(specifier, basePath, workspaceBasePath);
4303
+ const cacheKey = resolvedSpecifier.resolvedPath ?? resolvedSpecifier.packageRoot ?? `${basePath}:${specifier}`;
4304
+ if (visited.has(cacheKey)) return;
4305
+ visited.add(cacheKey);
4306
+ const loaded = await loadExtendsConfigWithDependencies(resolvedSpecifier, basePath);
4307
+ loaded.dependencies.forEach((dependency) => addDependency(dependencies, dependency, basePath));
4308
+ const directExtends = toStringArray(loaded.config?.extends);
4309
+ if (!directExtends || !loaded.entryPath) return;
4310
+ const nestedBasePath = dirname$2(loaded.entryPath);
4311
+ for (const nestedSpecifier of directExtends) await visit(nestedSpecifier, nestedBasePath);
4312
+ }
4313
+ for (const config of configs) for (const specifier of config.extends ?? []) await visit(specifier, configBasePath);
4314
+ return [...dependencies].toSorted((left, right) => left.localeCompare(right));
4315
+ }
4280
4316
  async function readExtendsPackageMetadata(resolvedSpecifier) {
4281
4317
  const packageRoot = resolvedSpecifier.packageRoot;
4282
4318
  const packageName = resolvedSpecifier.packageName;
@@ -4783,6 +4819,7 @@ async function loadConfigFromPath(configPath, basePath) {
4783
4819
  const { mod, dependencies } = await (0, bundle_require.bundleRequire)({
4784
4820
  filepath: configPath,
4785
4821
  cwd: basePath,
4822
+ notExternal: [STYLELINT_CONFIG_PACKAGE_IMPORT_RE],
4786
4823
  tsconfig: false
4787
4824
  });
4788
4825
  const configValue = mod.default ?? mod;
@@ -4840,11 +4877,10 @@ var StylelintInspectorAdapter = class {
4840
4877
  if (configPath) try {
4841
4878
  const loaded = await loadConfigFromPath(configPath, basePath);
4842
4879
  config = loaded.config;
4843
- if (options.userConfigPath) loaded.dependencies.forEach((dep) => dependencies.add(dep));
4844
- else dependencies.add(configPath);
4880
+ loaded.dependencies.forEach((dependency) => addDependency(dependencies, dependency, basePath));
4845
4881
  } catch (error) {
4846
4882
  if (options.userConfigPath) throw error;
4847
- dependencies.add(configPath);
4883
+ addDependency(dependencies, configPath, basePath);
4848
4884
  diagnostics.push("Could not parse discovered config directly; using resolved output only for config item extraction.");
4849
4885
  }
4850
4886
  const resolveOptions = { cwd: basePath };
@@ -4879,6 +4915,7 @@ var StylelintInspectorAdapter = class {
4879
4915
  };
4880
4916
  const configs = extractConfigs(resolved, config);
4881
4917
  const configBasePath = configPath ? dirname$2(configPath) : basePath;
4918
+ (await collectExtendsDependencies(configs, basePath, configBasePath)).forEach((dependency) => addDependency(dependencies, dependency, basePath));
4882
4919
  const [rules, stylelintIgnore, extendsInfo] = await Promise.all([
4883
4920
  buildRuleCatalog(configs, resolved),
4884
4921
  readStylelintIgnoreInfo(basePath),
@@ -5434,6 +5471,7 @@ async function createWsServer(options) {
5434
5471
  ignoreInitial: true,
5435
5472
  cwd: basePath
5436
5473
  });
5474
+ if (resolvedConfigPath.configPath) watcher.add(resolvedConfigPath.configPath);
5437
5475
  watcher.on("change", (path) => {
5438
5476
  payload = void 0;
5439
5477
  console.log();