@icebreakers/stylelint-config 2.0.2 → 2.0.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 (2) hide show
  1. package/dist/index.js +8 -5
  2. package/package.json +4 -3
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.ICEBREAKER_STYLELINT_DISABLE_IMPORT_META_RESOLVE === "1";
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 resolved.startsWith("file:") ? fileURLToPath(resolved) : resolved;
93
+ return fileURLToPath(resolved);
94
94
  } catch {
95
95
  }
96
96
  }
@@ -177,10 +177,13 @@ function resolveRules(options) {
177
177
  return rules;
178
178
  }
179
179
  function createIcebreakerStylelintConfig(options = {}) {
180
+ const extendsConfig = resolveExtends(options);
181
+ const overrides = resolveOverrides(options);
182
+ const rules = resolveRules(options);
180
183
  return {
181
- extends: resolveExtends(options),
182
- overrides: resolveOverrides(options),
183
- rules: resolveRules(options)
184
+ ...extendsConfig !== void 0 ? { extends: extendsConfig } : {},
185
+ overrides,
186
+ rules
184
187
  };
185
188
  }
186
189
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/stylelint-config",
3
3
  "type": "module",
4
- "version": "2.0.2",
4
+ "version": "2.0.3",
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.5.1",
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
  }