@morev/eslint-disable-autofix 1.1.0 → 1.1.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.cjs +15 -2
- package/dist/index.js +15 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -273,8 +273,21 @@ var internalDisableAutofix = (options) => {
|
|
|
273
273
|
eslintRules._set = Map.prototype.set.bind(eslintRules);
|
|
274
274
|
allNoAutofixRules.forEach((fullRuleName) => {
|
|
275
275
|
const [_, pluginName, ruleName] = fullRuleName.match(/(?:(.*?)\/)?(.*)/);
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
const plugin = allPlugins[pluginName];
|
|
277
|
+
if (pluginName && plugin?.rules?.[ruleName]) {
|
|
278
|
+
const patchedPlugin = {
|
|
279
|
+
...plugin,
|
|
280
|
+
rules: {
|
|
281
|
+
...plugin.rules,
|
|
282
|
+
[ruleName]: createNonFixableRule(plugin.rules[ruleName])
|
|
283
|
+
}
|
|
284
|
+
};
|
|
285
|
+
configurations.forEach((configuration) => {
|
|
286
|
+
if (configuration.plugins?.[pluginName] === plugin) {
|
|
287
|
+
configuration.plugins[pluginName] = patchedPlugin;
|
|
288
|
+
}
|
|
289
|
+
});
|
|
290
|
+
allPlugins[pluginName] = patchedPlugin;
|
|
278
291
|
return;
|
|
279
292
|
}
|
|
280
293
|
if (eslintRules.has(fullRuleName)) {
|
package/dist/index.js
CHANGED
|
@@ -238,8 +238,21 @@ var internalDisableAutofix = (options) => {
|
|
|
238
238
|
eslintRules._set = Map.prototype.set.bind(eslintRules);
|
|
239
239
|
allNoAutofixRules.forEach((fullRuleName) => {
|
|
240
240
|
const [_, pluginName, ruleName] = fullRuleName.match(/(?:(.*?)\/)?(.*)/);
|
|
241
|
-
|
|
242
|
-
|
|
241
|
+
const plugin = allPlugins[pluginName];
|
|
242
|
+
if (pluginName && plugin?.rules?.[ruleName]) {
|
|
243
|
+
const patchedPlugin = {
|
|
244
|
+
...plugin,
|
|
245
|
+
rules: {
|
|
246
|
+
...plugin.rules,
|
|
247
|
+
[ruleName]: createNonFixableRule(plugin.rules[ruleName])
|
|
248
|
+
}
|
|
249
|
+
};
|
|
250
|
+
configurations.forEach((configuration) => {
|
|
251
|
+
if (configuration.plugins?.[pluginName] === plugin) {
|
|
252
|
+
configuration.plugins[pluginName] = patchedPlugin;
|
|
253
|
+
}
|
|
254
|
+
});
|
|
255
|
+
allPlugins[pluginName] = patchedPlugin;
|
|
243
256
|
return;
|
|
244
257
|
}
|
|
245
258
|
if (eslintRules.has(fullRuleName)) {
|