@icebreakers/stylelint-config 2.0.2 → 2.0.4
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.js +1 -1
- package/dist/index.js +9 -5
- package/package.json +4 -3
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -86,11 +86,11 @@ function normalizeExtends(base) {
|
|
|
86
86
|
var requireFromConfig = createRequire(import.meta.url);
|
|
87
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]+)*)*$/;
|
|
88
88
|
function resolvePresetPath(specifier) {
|
|
89
|
-
const disableImportMetaResolve = process.env
|
|
89
|
+
const disableImportMetaResolve = process.env["ICEBREAKER_STYLELINT_DISABLE_IMPORT_META_RESOLVE"] === "1";
|
|
90
90
|
if (!disableImportMetaResolve && typeof import.meta.resolve === "function") {
|
|
91
91
|
try {
|
|
92
92
|
const resolved = import.meta.resolve(specifier);
|
|
93
|
-
return
|
|
93
|
+
return fileURLToPath(resolved);
|
|
94
94
|
} catch {
|
|
95
95
|
}
|
|
96
96
|
}
|
|
@@ -135,6 +135,7 @@ function resolveRules(options) {
|
|
|
135
135
|
const ignoreAtRules = resolveIgnoreList("atRules", options?.ignores);
|
|
136
136
|
const rules = {
|
|
137
137
|
"function-name-case": null,
|
|
138
|
+
"media-feature-range-notation": "prefix",
|
|
138
139
|
"selector-class-pattern": [
|
|
139
140
|
new RegExp(BEM_OOCSS_CLASS_NAME_PATTERN),
|
|
140
141
|
{
|
|
@@ -177,10 +178,13 @@ function resolveRules(options) {
|
|
|
177
178
|
return rules;
|
|
178
179
|
}
|
|
179
180
|
function createIcebreakerStylelintConfig(options = {}) {
|
|
181
|
+
const extendsConfig = resolveExtends(options);
|
|
182
|
+
const overrides = resolveOverrides(options);
|
|
183
|
+
const rules = resolveRules(options);
|
|
180
184
|
return {
|
|
181
|
-
extends:
|
|
182
|
-
overrides
|
|
183
|
-
rules
|
|
185
|
+
...extendsConfig !== void 0 ? { extends: extendsConfig } : {},
|
|
186
|
+
overrides,
|
|
187
|
+
rules
|
|
184
188
|
};
|
|
185
189
|
}
|
|
186
190
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/stylelint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.0.4",
|
|
5
5
|
"description": "Stylelint preset from Icebreaker's dev-configs",
|
|
6
6
|
"author": "ice breaker <1324318532@qq.com>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"dist"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"comment-json": "^4.
|
|
42
|
+
"comment-json": "^4.6.2",
|
|
43
43
|
"postcss-html": "^1.8.1",
|
|
44
44
|
"stylelint-config-recess-order": "^7.6.1",
|
|
45
45
|
"stylelint-config-recommended-scss": "^17.0.0",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"test": "vitest run",
|
|
57
57
|
"test:dev": "vitest",
|
|
58
58
|
"release": "pnpm publish",
|
|
59
|
-
"sync": "cnpm sync @icebreakers/stylelint-config"
|
|
59
|
+
"sync": "cnpm sync @icebreakers/stylelint-config",
|
|
60
|
+
"typecheck": "tsc --noEmit"
|
|
60
61
|
}
|
|
61
62
|
}
|