@icebreakers/stylelint-config 2.0.0 → 2.0.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/index.js +10 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
// src/config.ts
|
|
2
2
|
import { createRequire } from "module";
|
|
3
|
+
import process from "process";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
3
5
|
|
|
4
6
|
// src/constants.ts
|
|
5
7
|
var PRESET_STANDARD_SCSS = "stylelint-config-standard-scss";
|
|
@@ -84,6 +86,14 @@ function normalizeExtends(base) {
|
|
|
84
86
|
var requireFromConfig = createRequire(import.meta.url);
|
|
85
87
|
var BEM_OOCSS_CLASS_NAME_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*(?:__[a-z0-9]+(?:-[a-z0-9]+)*)*(?:--[a-z0-9]+(?:-[a-z0-9]+)*)*$/;
|
|
86
88
|
function resolvePresetPath(specifier) {
|
|
89
|
+
const disableImportMetaResolve = process.env.ICEBREAKER_STYLELINT_DISABLE_IMPORT_META_RESOLVE === "1";
|
|
90
|
+
if (!disableImportMetaResolve && typeof import.meta.resolve === "function") {
|
|
91
|
+
try {
|
|
92
|
+
const resolved = import.meta.resolve(specifier);
|
|
93
|
+
return resolved.startsWith("file:") ? fileURLToPath(resolved) : resolved;
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
}
|
|
87
97
|
try {
|
|
88
98
|
return requireFromConfig.resolve(specifier);
|
|
89
99
|
} catch {
|
package/package.json
CHANGED