eslint-plugin-rxjs-x

raw JSON →
1.0.2 verified Sat Apr 25 auth: no javascript

Modern ESLint plugin for RxJS, forked from the unmaintained eslint-plugin-rxjs. v1.0.2 requires ESLint ^10.0.1, Node ^20.19.0 || ^22.13.0 || >=24, and RxJS ^7.2.0 with TypeScript >=4.8.4 <6.1.0. Ships TypeScript types. Offers flat-config-only recommended and strict configs, with 33+ rules. Breaking from v0.x: ESLint 10 required, Node 18 dropped, eslintrc unsupported, and namespace changed from 'rxjs' to 'rxjs-x'. Provides typed linting via dependency on typescript-eslint.

error Error: Cannot find module 'eslint-plugin-rxjs-x'
cause Package not installed or wrong import path.
fix
npm install eslint-plugin-rxjs-x --save-dev
error Configuration for rule "rxjs-x/no-subject-value" is invalid: Value "error" is not a valid severity.
cause Using old eslintrc syntax with 'extends' containing 'plugin:rxjs-x/recommended'.
fix
Use flat config: import rxjsX from 'eslint-plugin-rxjs-x' and extend rxjsX.configs.recommended.
error TypeError: eslint-plugin-rxjs-x is not a function
cause Using require() instead of import in flat config.
fix
Use 'import rxjsX from 'eslint-plugin-rxjs-x'' in ESM context.
error Parsing error: ESLint was configured to run on files that are not included in the project's TypeScript configuration.
cause Missing 'projectService: true' or TypeScript config not found.
fix
Add 'projectService: true' to parserOptions and ensure tsconfig is present.
error Cannot read properties of undefined (reading 'configs')
cause Importing default export incorrectly in CommonJS.
fix
Switch to ESM or use dynamic import: const rxjsX = await import('eslint-plugin-rxjs-x').then(m => m.default);
breaking ESLint v10 required; Node.js v18 support dropped.
fix Upgrade to ESLint ^10.0.1 and Node.js ^20.19.0 || ^22.13.0 || >=24.
breaking eslintrc config no longer supported; only flat config with import/export.
fix Migrate to flat config using import statements and defineConfig.
breaking Namespace changed from 'rxjs' to 'rxjs-x'; all rule references must be updated.
fix Replace 'rxjs/' with 'rxjs-x/' in all ESLint config rules and inline disable comments.
breaking Rule 'rxjs/no-ignored-observable' replaced by 'rxjs-x/no-floating-observable'.
fix Use 'rxjs-x/no-floating-observable' instead of 'rxjs/no-ignored-observable'.
deprecated 'recommended-legacy' config removed in v1; use flat config only.
fix Use rxjsX.configs.recommended in flat config.
gotcha Typed linting requires projectService: true in parserOptions.
fix Add 'projectService: true' to parserOptions; otherwise type-dependent rules won't work.
gotcha Peer dep upper bounds: rxjs ^7.2.0, typescript <6.1.0.
fix Ensure RxJS is ^7.2.0 and TypeScript >=4.8.4 <6.1.0.
npm install eslint-plugin-rxjs-x
yarn add eslint-plugin-rxjs-x
pnpm add eslint-plugin-rxjs-x

Sets up ESLint flat config with typescript-eslint and eslint-plugin-rxjs-x recommended rules for typed RxJS linting.

// @ts-check
import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
import rxjsX from 'eslint-plugin-rxjs-x';

export default defineConfig({
  extends: [
    tseslint.configs.recommended,
    rxjsX.configs.recommended,
  ],
  languageOptions: {
    parserOptions: {
      projectService: true,
    },
  },
});