stylelint-config-inspector 2.3.1 → 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.
- package/.remarkrc.mjs +9 -0
- package/README.md +2 -0
- package/dist/cli.cjs +46 -8
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.mjs +46 -8
- package/dist/cli.mjs.map +1 -1
- package/dist/nitro.json +1 -1
- package/dist/public/200.html +1 -1
- package/dist/public/404.html +1 -1
- package/dist/public/_nuxt/BG8RThME.js +1 -0
- package/dist/public/_nuxt/BOTxb_Tf.js +1 -0
- package/dist/public/_nuxt/BRAxAp2P.js +1 -0
- package/dist/public/_nuxt/{Cvh5Yzk5.js → B_EQLqN6.js} +1 -1
- package/dist/public/_nuxt/{dRgU1WmP.js → BhAtDtkD.js} +1 -1
- package/dist/public/_nuxt/C5Bg1PZi.js +1 -0
- package/dist/public/_nuxt/{DXGm3Xy7.js → CRalrgW8.js} +3 -3
- package/dist/public/_nuxt/{DKDGYXcX.js → D6fk1agw.js} +2 -2
- package/dist/public/_nuxt/{B_Ai4vLn.js → DLNrKDe5.js} +1 -1
- package/dist/public/_nuxt/DXuC58iQ.js +1 -0
- package/dist/public/_nuxt/DYK0VwDN.js +1 -0
- package/dist/public/_nuxt/DusisEyH.js +1 -0
- package/dist/public/_nuxt/DvuBpx-x.js +3 -0
- package/dist/public/_nuxt/{8fb7oYZ7.js → IbiyzGrr.js} +1 -1
- package/dist/public/_nuxt/PnIxnNo9.js +1 -0
- package/dist/public/_nuxt/RuleList.QG5M7cTF.css +1 -0
- package/dist/public/_nuxt/V5SopCgz.js +1 -0
- package/dist/public/_nuxt/builds/latest.json +1 -1
- package/dist/public/_nuxt/builds/meta/163a5255-1f6f-4e70-99a4-8b3d32cbba2b.json +1 -0
- package/dist/public/_nuxt/entry.uDIoEhfx.css +1 -0
- package/dist/public/index.html +1 -1
- package/package.json +28 -92
- package/prettier.config.mjs +8 -0
- package/stylelint.config.mjs +7 -1279
- package/dist/public/_nuxt/BAcHe6o1.js +0 -1
- package/dist/public/_nuxt/BHvHbKKE.js +0 -1
- package/dist/public/_nuxt/BsE9Cf6Q.js +0 -1
- package/dist/public/_nuxt/Bx7A0lpy.js +0 -1
- package/dist/public/_nuxt/C-qAsQUT.js +0 -1
- package/dist/public/_nuxt/C2zvjHVY.js +0 -1
- package/dist/public/_nuxt/CD-6Huh9.js +0 -3
- package/dist/public/_nuxt/CMLop-UK.js +0 -1
- package/dist/public/_nuxt/CoB_Putt.js +0 -1
- package/dist/public/_nuxt/Cz8buFOa.js +0 -1
- package/dist/public/_nuxt/RuleList.CYZAb2ne.css +0 -1
- package/dist/public/_nuxt/builds/meta/4c08e2a1-6f8e-4ac9-a9ca-a84eff6c1ede.json +0 -1
- package/dist/public/_nuxt/entry.Cbs_sV94.css +0 -1
package/.remarkrc.mjs
ADDED
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
|
[](#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
|
|
4272
|
-
|
|
4273
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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();
|