@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
|
package/lib/rules/parse-rules.js
CHANGED
|
@@ -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 (
|
|
125
|
+
if (rule.includes('/') && parseState(rule, value))
|
|
127
126
|
newRules[cut(rule)] = 'on';
|
|
128
127
|
|
|
129
128
|
newRules[rule] = value;
|
package/package.json
CHANGED