@icebreakers/stylelint-config 2.2.0 → 2.2.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.d.ts CHANGED
@@ -2,18 +2,19 @@
2
2
  interface StylelintRuleOptions {
3
3
  [key: string]: unknown;
4
4
  }
5
- type StylelintRuleSetting = null | undefined | string | number | boolean | RegExp | StylelintRuleOptions | [unknown] | [unknown, StylelintRuleOptions];
5
+ type StylelintPlugin = string | object;
6
+ type StylelintRuleSetting = null | undefined | string | number | boolean | RegExp | StylelintRuleOptions | [unknown] | [unknown, StylelintRuleOptions] | unknown[];
6
7
  interface StylelintOverride {
7
8
  files: string | string[];
8
9
  name?: string;
9
10
  customSyntax?: any;
10
11
  extends?: string | string[];
11
- plugins?: string | object | Array<string | object>;
12
+ plugins?: StylelintPlugin | StylelintPlugin[];
12
13
  rules?: Record<string, StylelintRuleSetting>;
13
14
  }
14
15
  interface StylelintConfig {
15
16
  extends?: string | string[];
16
- plugins?: string | object | Array<string | object>;
17
+ plugins?: StylelintPlugin | StylelintPlugin[];
17
18
  overrides?: StylelintOverride[];
18
19
  rules?: Record<string, StylelintRuleSetting>;
19
20
  customSyntax?: any;
package/dist/index.js CHANGED
@@ -104,8 +104,11 @@ function resolveOverrides(options) {
104
104
  if (!overrides || overrides.length === 0) return [];
105
105
  return [...overrides];
106
106
  }
107
+ function normalizePlugins(plugins) {
108
+ return toArray(plugins);
109
+ }
107
110
  function resolvePlugins(options) {
108
- return toArray(options?.plugins);
111
+ return normalizePlugins(options?.plugins);
109
112
  }
110
113
  function resolveIgnoreFiles(options) {
111
114
  return normalizeExtends(unique([...options?.miniProgram ? MINI_PROGRAM_IGNORE_FILES : [], ...toArray(options?.ignoreFiles)]));
@@ -152,7 +155,7 @@ function createIcebreakerStylelintConfig(options = {}) {
152
155
  ...extendsConfig !== void 0 ? { extends: extendsConfig } : {},
153
156
  ...options.customSyntax !== void 0 ? { customSyntax: options.customSyntax } : {},
154
157
  ...ignoreFiles !== void 0 ? { ignoreFiles } : {},
155
- plugins: [...tailwindcssPreset.plugins ?? [], ...plugins],
158
+ plugins: [...normalizePlugins(tailwindcssPreset.plugins), ...plugins],
156
159
  overrides,
157
160
  rules: {
158
161
  ...tailwindcssPreset.rules ?? {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/stylelint-config",
3
3
  "type": "module",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "description": "Stylelint preset from Icebreaker's dev-configs",
6
6
  "author": "ice breaker <1324318532@qq.com>",
7
7
  "license": "MIT",
@@ -47,7 +47,7 @@
47
47
  "stylelint-config-recommended-scss": "^17.0.0",
48
48
  "stylelint-config-recommended-vue": "^1.6.1",
49
49
  "stylelint-config-standard-scss": "^17.0.0",
50
- "stylelint-plugin-tailwindcss": "1.0.1"
50
+ "stylelint-plugin-tailwindcss": "1.0.2"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public",