{"_id":"@elecmonkey/eslint-plugin-rslint","name":"@elecmonkey/eslint-plugin-rslint","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@elecmonkey/eslint-plugin-rslint","version":"0.1.0","description":"Turn off all ESLint rules already supported by Rslint, to avoid duplicate linting.","license":"MIT","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./package.json":"./package.json"},"scripts":{"build":"rslib build","dev":"rslib build --watch","test":"rstest run","test:watch":"rstest watch","sync":"tsx ./scripts/sync-from-rslint.ts","generate":"tsx ./scripts/generate.ts","prepublishOnly":"pnpm generate && pnpm build && pnpm test"},"keywords":["eslint","eslintplugin","eslint-plugin","rslint","Rslint"],"peerDependencies":{"@rslint/core":">=0.5.0","eslint":">=8.0.0"},"peerDependenciesMeta":{"@rslint/core":{"optional":true}},"dependencies":{"jsonc-parser":"^3.3.1"},"devDependencies":{"@microsoft/api-extractor":"^7.58.7","@rslib/core":"^0.10.0","@rslint/core":"^0.5.3","@rstest/core":"^0.0.10","@types/eslint":"^9.6.1","@types/node":"^22.10.0","eslint":"^9.17.0","tsx":"^4.19.2","typescript":"^5.7.2"},"gitHead":"995976f2b7cfc4cd094bdbc9ff88fabd451bec76","_id":"@elecmonkey/eslint-plugin-rslint@0.1.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-itd88DLzUSfLEi3HTBGR+qDh52TRH5PM9KZs3eMxFwXGrs1pZSqzONOt0xbiQdTkBA5froK/GTYLoovzPYLduw==","shasum":"e2fd9ce6b45aba5f4b6c4751012def8dc44558f6","tarball":"https://registry.npmjs.org/@elecmonkey/eslint-plugin-rslint/-/eslint-plugin-rslint-0.1.0.tgz","fileCount":5,"unpackedSize":60518,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDuMCYOYZqQ7QMfh6Sp1jnX8BXxwTTzHmOAwnUVkQTuBgIhAO1jlsvhK74NQupEIQ9gK22YgorkyrGWCWX3kF5bb0mJ"}]},"_npmUser":{"name":"elecmonkey","email":"elecmonkey@hotmail.com"},"directories":{},"maintainers":[{"name":"elecmonkey","email":"elecmonkey@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-plugin-rslint_0.1.0_1779631299346_0.4490940272451984"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-24T14:01:39.153Z","0.1.0":"2026-05-24T14:01:39.496Z","modified":"2026-05-24T14:01:39.711Z"},"maintainers":[{"name":"elecmonkey","email":"elecmonkey@hotmail.com"}],"description":"Turn off all ESLint rules already supported by Rslint, to avoid duplicate linting.","keywords":["eslint","eslintplugin","eslint-plugin","rslint","Rslint"],"license":"MIT","readme":"# @elecmonkey/eslint-plugin-rslint\n\nTurn off ESLint rules already covered by [Rslint](https://github.com/web-infra-dev/rslint), so the two linters don't double-report when used together.\n\n## Why\n\nIf you run both ESLint and Rslint, every rule that exists on both sides ends up reporting twice. This plugin ships a flat config that disables all rules Rslint can already check, leaving ESLint to focus on what Rslint doesn't yet cover.\n\nThe plugin offers the same two-track usage as `eslint-plugin-oxlint`:\n\n- **Static configs** — `rslint.configs['flat/recommended']` and friends, hard-coded from Rslint's recommended tables. Zero config; doesn't read your `rslint.config.*`. The recommended starting point.\n- **Dynamic build** — `buildFromRslintConfigFile()` loads your actual `rslint.config.{ts,mts,js,mjs}` and mirrors exactly the rules Rslint will check in your project. Use this when you customise Rslint's defaults (turn rules on/off, override severities, etc.).\n\n## Install\n\n```sh\npnpm add -D @elecmonkey/eslint-plugin-rslint\n```\n\nRequires ESLint ≥ 8 (flat config).\n\n## Usage\n\n### Use a static config (zero-config)\n\n```js\n// eslint.config.js\nimport rslint from '@elecmonkey/eslint-plugin-rslint';\n\nexport default [\n  // ... your other configs (e.g. eslint:recommended, typescript-eslint, react)\n\n  // Put this LAST so it overrides the above and turns off rules\n  // that Rslint will check anyway.\n  rslint.configs['flat/recommended'],\n];\n```\n\n### Build from your rslint.config.\\* (dynamic)\n\n```js\n// eslint.config.js\nimport { buildFromRslintConfigFile } from '@elecmonkey/eslint-plugin-rslint';\n\nexport default [\n  // ... your other configs\n\n  // Reads ./rslint.config.{ts,mts,js,mjs} from cwd and produces\n  // an `off` for every rule your Rslint config has enabled.\n  ...(await buildFromRslintConfigFile()),\n];\n```\n\nRequires `@rslint/core` (declared as an optional peer dependency — installing `rslint` already gives it to you).\n\n`buildFromRslintConfigFile({ cwd, config })` accepts:\n\n- `cwd` — directory to discover the config from (default: `process.cwd()`).\n- `config` — explicit absolute path; bypasses discovery.\n\nOnly `rslint.config.{ts,mts,js,mjs}` is supported. JSON / JSONC configs are deprecated upstream and have no public Node loader; users on those formats should use a static config instead.\n\nFor full control, `buildFromRslintConfig(entries)` accepts an already-loaded Rslint config array and returns the same shape — useful if you want to compose configs in memory.\n\n### Available configs\n\n| Name | Description |\n|------|-------------|\n| `flat/recommended` | Strict subset matching Rslint's `recommended` preset (`js.configs.recommended`, `ts.configs.recommended`, `react.configs.recommended` from Rslint's `internal/config/config_init.go`) |\n| `flat/all` | Every rule Rslint implements, regardless of recommended status |\n| `flat/eslint` | Only ESLint core rules |\n| `flat/@typescript-eslint` | Only `@typescript-eslint/*` rules |\n| `flat/react`, `flat/react-hooks`, `flat/import`, `flat/jest`, `flat/jsx-a11y`, `flat/promise`, `flat/@stylistic`, `flat/unicorn` | Per-plugin slices |\n\n### Raw rule data\n\nIf you want to compose your own configs, the underlying rule maps are\navailable as named exports from the main entry:\n\n```ts\nimport {\n  rulesByScope,           // { eslint: { ... }, '@typescript-eslint': { ... }, ... }\n  rulesByPlugin,           // alias of rulesByScope\n  recommendedRulesByPlugin, // recommended-only subset\n} from '@elecmonkey/eslint-plugin-rslint';\n```\n\nEach leaf value is `'off'`.\n\n## What's special\n\n- **Two-track usage, like `eslint-plugin-oxlint`.** Static configs (zero-config, follow Rslint's defaults) plus a dynamic builder that reads your real `rslint.config.*` so a rule you turned off in Rslint stays on for ESLint.\n- **Bidirectional `@typescript-eslint` ↔ ESLint sync.** When Rslint enables `@typescript-eslint/no-shadow`, this plugin also turns off the bare `no-shadow`, and vice versa, so users don't get double reports across plugin boundaries.\n- **Strict `recommended`.** `flat/recommended` is hand-mapped to Rslint's actual recommended tables — it is **not** equivalent to `flat/all`.\n- **Reuses Rslint's own loader.** The dynamic builder delegates `.ts/.mts/.js/.mjs` loading to `@rslint/core/config-loader`, so it stays in lock-step with Rslint's parsing semantics.\n\n## Versioning\n\n`rslint.jsonc` in this repo is the single source of truth for what Rslint can check. It is **auto-generated** from a local Rslint checkout via `pnpm sync`. When Rslint adds, removes, or changes a rule, bump this package, re-run `pnpm sync && pnpm generate`, and publish.\n\n`@rslint/core` is declared as an optional `peerDependency`. It is only required when you use `buildFromRslintConfigFile` / `buildFromRslintConfig`; the static configs work without it.\n\n## Development\n\n```sh\npnpm install\npnpm sync        # Rslint Go source → rslint.jsonc (defaults to ../rslint)\npnpm generate    # rslint.jsonc → src/generated/*\npnpm test        # rstest\npnpm build       # rslib (esm + dts)\n```\n\n`pnpm sync` accepts a path argument or `RSLINT_REPO` env var if Rslint is not at `../rslint`.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-d4eff7a79296c3ba4dadd2cb815ea2c2"}