{"id":36384352,"url":"https://github.com/MorevM/eslint-disable-autofix","last_synced_at":"2026-01-13T02:00:39.812Z","repository":{"id":294935822,"uuid":"988581814","full_name":"MorevM/eslint-disable-autofix","owner":"MorevM","description":"Utility to disable autofix for specific ESLint rules","archived":false,"fork":false,"pushed_at":"2025-09-27T12:06:26.000Z","size":859,"stargazers_count":2,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-02T15:18:29.145Z","etag":null,"topics":["autofix","eslint","eslint-plugin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@morev/eslint-disable-autofix","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MorevM.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-05-22T19:02:14.000Z","updated_at":"2025-06-30T02:39:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"6c7a3e8b-a4d7-4725-9717-6a8ce1f2f88b","html_url":"https://github.com/MorevM/eslint-disable-autofix","commit_stats":null,"previous_names":["morevm/eslint-disable-autofix"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/MorevM/eslint-disable-autofix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorevM%2Feslint-disable-autofix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorevM%2Feslint-disable-autofix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorevM%2Feslint-disable-autofix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorevM%2Feslint-disable-autofix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MorevM","download_url":"https://codeload.github.com/MorevM/eslint-disable-autofix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MorevM%2Feslint-disable-autofix/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28369835,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T00:51:29.220Z","status":"online","status_checked_at":"2026-01-13T02:00:06.734Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autofix","eslint","eslint-plugin"],"created_at":"2026-01-11T15:00:24.016Z","updated_at":"2026-01-13T02:00:39.805Z","avatar_url":"https://github.com/MorevM.png","language":"TypeScript","funding_links":[],"categories":["Tools"],"sub_categories":["Testing Tools"],"readme":"\u003c!-- markdownlint-disable-next-line md033 --\u003e\n\u003cimg src=\"./.github/assets/banner.svg\" alt=\"Promo image of @morev/eslint-disable-autofix package\" width=\"830\" height=\"465\" /\u003e\n\n![Stability of \"master\" branch](https://img.shields.io/github/actions/workflow/status/MorevM/eslint-disable-autofix/build.yaml?branch=master)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Last commit](https://img.shields.io/github/last-commit/morevm/eslint-disable-autofix)\n![Release version](https://img.shields.io/github/v/release/morevm/eslint-disable-autofix?include_prereleases)\n![GitHub Release Date](https://img.shields.io/github/release-date/morevm/eslint-disable-autofix)\n![Keywords](https://img.shields.io/github/package-json/keywords/morevm/eslint-disable-autofix)\n\n# @morev/eslint-disable-autofix\n\nThis utility allows you to disable autofix for specific ESLint rules by using a custom prefix in your configurations. \\\nIt's useful when you want a rule to remain active for linting purposes but prevent ESLint from automatically fixing it.\n\n---\n\n\u003e [!NOTE]\n\u003e This is a temporary solution until [this RFC](https://github.com/eslint/rfcs/pull/134) is accepted\n\u003e and a final implementation is made that closes [this issue](https://github.com/eslint/eslint/issues/18696) -\n\u003e after that the feature for disabling autofix for rules will be in the ESLint core.\n\u003e\n\u003e I am working on RFC development and final implementation in the core myself,\n\u003e but the process will take some time, and the problem is already there.\n\u003e\n\u003e I'll probably be able to implement this as a polyfill for the final solution,\n\u003e once [the RFC](https://github.com/eslint/rfcs/pull/134) discussion reaches\n\u003e a consensus on a public API.\n\n---\n\n\u003e [!IMPORTANT]\n\u003e\n\u003e * Only works with ESLint v9 and its flat config format;\n\u003e * You have to restart ESLint server after adding/removing `no-autofix/` prefix to take effect.\n\n---\n\n## Why?\n\nSome rules support autofixing, which is often convenient, but in certain cases\nthe fixes may be broken, unsafe, or simply undesirable. \\\nIdeally, unsafe autofixes should be treated as suggestions, and broken fixes should be reported.\n\nHowever, ESLint is a large ecosystem, and some useful plugins are no longer actively maintained. \\\nEven in actively maintained projects, users may want to disable autofixing for specific rules\ndue to project-specific or personal preferences.\n\n## Installation\n\n```bash\npnpm add -D @morev/eslint-disable-autofix\n```\n\n```bash\nyarn add @morev/eslint-disable-autofix -D\n```\n\n```bash\nnpm install -D @morev/eslint-disable-autofix\n```\n\n## Usage\n\n### Basic usage\n\nIn your `eslint.config.js` (only flat config is supported):\n\n```js\nimport { disableAutofix } from '@morev/eslint-disable-autofix';\nimport somePlugin from 'some-eslint-plugin';\n\nexport default disableAutofix([\n  {\n    plugins: {\n      'some-plugin': somePlugin,\n    },\n    rules: {\n      // Disable autofix for a core rule\n      'no-autofix/no-var': 'error',\n      // Disable autofix for a third-party rule\n      'no-autofix/some-plugin/some-rule': 'warn',\n    },\n  },\n]);\n```\n\n### Custom prefix\n\nIf you'd prefer a custom prefix other than `no-autofix/`, use the factory:\n\n```js\nimport { createDisableAutofix } from '@morev/eslint-disable-autofix';\n\nconst disableAutofix = createDisableAutofix({\n  prefix: 'disable-autofix',\n});\n\nexport default disableAutofix([\n  {\n    rules: {\n      'disable-autofix/no-var': 'error',\n    },\n  },\n]);\n```\n\n## How it works internally\n\n1. Scans passed ESLint configurations for rules with a specified prefix;\n1. Strips the prefix to keep the original name of the rule;\n1. Patches rules from ESLint core or third-party plugins directly to disable autofix.\n\nUnder the hood, it uses [`eslint-rule-composer`](https://github.com/not-an-aardvark/eslint-rule-composer)\nto wrap rules with autofix disabled.\n\n\u003e[!CAUTION]\n\u003e Direct patching is quite risky and hacky, it relies on non-public ESLint API. \\\n\u003e While it's currently the only way to access certain rule internals,\n\u003e it may break in future ESLint versions.\n\n## Alternatives\n\nI've been using [eslint-plugin-no-autofix](https://github.com/aladdin-add/eslint-plugin/tree/master/packages/no-autofix)\nfor a long time and haven't had much trouble with it, however recently problems have arisen:\n\n1. Some popular plugins (like [eslint-plugin-unicorn](https://github.com/sindresorhus/eslint-plugin-unicorn)\n   or [eslint-stylistic](https://github.com/eslint-stylistic/eslint-stylistic))\n   switch to the ESM-only distribution format and\n   [eslint-plugin-no-autofix](https://github.com/aladdin-add/eslint-plugin/tree/master/packages/no-autofix) doesn't work with it.\n   The [issue have no response](https://github.com/aladdin-add/eslint-plugin/issues/104),\n   so I've decided to create my own solution that works in a different way.\n1. I'm getting tired of rules being renamed just to make them work. \\\n   Say I need to disable a rule with autofix turned off for a single file - I write `/* eslint-disable no-autofix/unicorn/no-lonely-if */`. \\\n   Later, the broken autofix in the original rule gets fixed, I re-enable the main rule,\n   and now the directive no longer applies, which leads to unexpected changes I didn't want.\n\n   Patching the original rules instead of creating new ones might be a bit riskier technically,\n   but from a developer experience perspective, it's definitely cleaner and more intuitive.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMorevM%2Feslint-disable-autofix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMorevM%2Feslint-disable-autofix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMorevM%2Feslint-disable-autofix/lists"}