stylelint-find-new-rules 4.1.1 → 4.1.2

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.
@@ -11,7 +11,10 @@ const getAllRules = (config) => {
11
11
  if (config.plugins) {
12
12
  [config.plugins].flat().forEach((plugin) => {
13
13
  let pluginRules;
14
- pluginRules = require(plugin); // eslint-disable-line import/no-dynamic-require, global-require
14
+
15
+ // @see https://github.com/stylelint/stylelint/blob/15.10.3/lib/augmentConfig.js#L315
16
+ // eslint-disable-next-line import/no-dynamic-require, global-require
17
+ pluginRules = typeof plugin === 'string' ? require(plugin) : plugin;
15
18
  pluginRules = pluginRules.default || pluginRules; // - ES6 or CommonJS modules
16
19
  pluginRules = [pluginRules].flat();
17
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stylelint-find-new-rules",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "Find stylelint rules that you don't have in your config",
5
5
  "homepage": "https://github.com/Donov4n/stylelint-find-new-rules",
6
6
  "license": "MIT",