@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 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
- if (pluginName && allPlugins[pluginName]?.rules?.[ruleName]) {
277
- allPlugins[pluginName].rules[ruleName] = createNonFixableRule(allPlugins[pluginName].rules[ruleName]);
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
- if (pluginName && allPlugins[pluginName]?.rules?.[ruleName]) {
242
- allPlugins[pluginName].rules[ruleName] = createNonFixableRule(allPlugins[pluginName].rules[ruleName]);
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)) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Utility to disable autofix for specific ESLint rules",
4
4
  "type": "module",
5
5
  "private": false,
6
- "version": "1.1.0",
6
+ "version": "1.1.1",
7
7
  "engines": {
8
8
  "node": ">=18"
9
9
  },