cartant / eslint-plugin-rxjs

ESLint rules for RxJS
MIT License
312 stars 37 forks source link

ESLint v9 support #127

Open json-derulo opened 7 months ago

json-derulo commented 7 months ago

ESLint v9 has been released recently. This plugin has a peer dependency to ESLint ^8.0.0 and causes peer dependency conflicts with ESLint v9.

Servonius commented 6 months ago

Also ESLint v9 requires the new flat config which this plugin doesn't support yet.

json-derulo commented 6 months ago

I got the plugin working in flat config format using ESLint v8, with the following config:

import rxjs from 'eslint-plugin-rxjs';

export default [
  {
    files: ['**/*.ts'],
    plugins: { rxjs },
    rules: { ...rxjs.configs.recommended.rules },
  },
];

For configuring TypeScript ESLint in flat config, see their docs.

rylorin commented 6 months ago

It didn't work for me, I had to do the following changes to my flat config file:

import { fixupPluginRules } from "@eslint/compat";
import eslint from "@eslint/js";
import prettier from "eslint-plugin-prettier/recommended";
import rxjs from "eslint-plugin-rxjs";
import tseslint from "typescript-eslint";

export default tseslint.config(
  eslint.configs.recommended,
  ...tseslint.configs.recommended,
  prettier,
  {
    ...
    plugins: { rxjs: fixupPluginRules(rxjs) },
    rules: {
      ...
      "rxjs/no-async-subscribe": "warn",
      "rxjs/no-ignored-observable": "warn",
      "rxjs/no-ignored-subscription": "warn",
      "rxjs/no-unbound-methods": "warn",
      "rxjs/throw-error": "warn",
    },
  },
);
dubzzz commented 5 months ago

I started to investigate the issue (I'm not related to the project), I think we should get rid-off the dependency called @typescript-eslint/experimental-utils in favor of its official version called @typescript-eslint/utils.

I did a first PR to patch eslint-etc. Once merged and rolled out I can open a similar one on eslint-plugin-rxjs to do the same (and maybe others).

Sebi11 commented 3 months ago

Hello there! Any chances to see this plugin upgraded to support ESLint 9 in the next few weeks?

reduckted commented 3 months ago

Support for ESLint v8 ends in two months, so it would be great to get this resolved soon.

fast-facts commented 2 months ago

Can this now be considered abandonware?

reduckted commented 2 months ago

https://github.com/ReactiveX/rxjs/discussions/7492

rbirkgit commented 2 months ago

We get this error when updating to ESLint 9.

Error: You have attempted to use a lint rule which requires the full TypeScript type-checker to be available, but you do not have `parserOptions.project` configured to point at your project tsconfig.json files in the relevant TypeScript file "overrides" block of your project ESLint config `src/.eslintrc.json`

We use typed rules and have parserOptions.project set properly. Commenting out rxjs/recommended usage, all linting work again.

AbakumovAlexandr commented 2 months ago

Look like it's really dead. Will have to remove it from our projects.

JasonWeinzierl commented 3 weeks ago

I've started a fork of this project named eslint-plugin-rxjs-x (named following the pattern set by eslint-plugin-import-x) that supports ESLint v9 flat config. It's still in prerelease versions, but feedback/attention is welcome. I intend to review any active issues/PRs in this repository and fix accordingly before releasing v1.0.0. All things going well, I also intend to fork the rxjs-angular rules too.

DaveMBush commented 4 days ago

I have a port done and just posted https://www.npmjs.com/package/@smarttools/eslint-plugin-rxjs