@putout/engine-loader 12.3.0 → 12.4.0

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/README.md CHANGED
@@ -32,6 +32,25 @@ module.exports.rules = {
32
32
  };
33
33
  ```
34
34
 
35
+ When you want to make it disabled by default, use:
36
+
37
+ ```js
38
+ module.exports.rules = {
39
+ 'remove-unused-variables': ['off', require('@putout/plugin-remove-unused-variables')],
40
+ };
41
+ ```
42
+
43
+ So when someone using your plugin, he needs to enable it:
44
+
45
+ ```json
46
+ {
47
+ "rules": {
48
+ "nested/remove-unused-variables": "on"
49
+ },
50
+ "plugins": ["nested"]
51
+ }
52
+ ```
53
+
35
54
  ## Env Variables
36
55
 
37
56
  When you need to get things working with Yarn PnP, and using custom `plugins` `formatters` or `processors`, add env variable
@@ -8,6 +8,7 @@ const supportedKeys = [
8
8
  'exclude',
9
9
  'rules',
10
10
  'declare',
11
+ 'scan',
11
12
  ];
12
13
 
13
14
  module.exports = ({plugin, rule}) => {
@@ -18,9 +18,8 @@ module.exports = (plugins) => {
18
18
  if (isArray(plugin)) {
19
19
  const [pluginName, fn] = plugin;
20
20
 
21
- if (isOff(fn)) {
21
+ if (isOff(fn))
22
22
  continue;
23
- }
24
23
 
25
24
  if (isOn(fn)) {
26
25
  result.push([pluginName]);
@@ -117,13 +117,12 @@ function validateState(rule, value) {
117
117
  }
118
118
 
119
119
  const cut = (a) => a.split('/')[0];
120
- const isExclude = (a) => a.includes('babel');
121
120
 
122
121
  function parseSubrules(rules) {
123
122
  const newRules = {};
124
123
 
125
124
  for (const [rule, value] of entries(rules)) {
126
- if (!isExclude(rule) && rule.includes('/') && parseState(rule, value))
125
+ if (rule.includes('/') && parseState(rule, value))
127
126
  newRules[cut(rule)] = 'on';
128
127
 
129
128
  newRules[rule] = value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/engine-loader",
3
- "version": "12.3.0",
3
+ "version": "12.4.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "load plugins and prepare them to run",