Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESLint v9 support #23

Open
json-derulo opened this issue Apr 17, 2024 · 11 comments
Open

ESLint v9 support #23

json-derulo opened this issue Apr 17, 2024 · 11 comments

Comments

@json-derulo
Copy link

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.

@e-oz
Copy link

e-oz commented Jul 19, 2024

Also, this plugin doesn't send context information correctly to ESLint 9, causing "parserOptions.project" to be empty.

@schreibse
Copy link

@cartant: do you have a plan how you wish to proceed with all the recent changes? (flat config, takeuntildestroyed, ...). Since not too much happened here for quite some time, might it be an option to integrate and update the three rules in https://github.com/angular-eslint/angular-eslint ? I am just thinking out loud and I have no idea what JamesHenry would say to that

@json-derulo
Copy link
Author

json-derulo commented Aug 1, 2024

I got the plugin working in ESLint v9 with the help of the @eslint/compat package:

import { fixupPluginRules } from '@eslint/compat';
import rxjsAngular from 'eslint-plugin-rxjs-angular';

export default tseslint.config(
  {
    files: ['**/*.ts'],
    plugins: {
      'rxjs-angular': fixupPluginRules(rxjsAngular),
    },
  },
);

Additionally I needed to add a npm override to silence the peer dependency error.

@e-oz
Copy link

e-oz commented Aug 1, 2024

Didn't work for me :(
And now here is ESLint 10 ;)

@oBusk
Copy link

oBusk commented Aug 6, 2024

Seems like the "correct" approach would be to use fixupConfigRules(). This worked for us;

const eslint = require('@eslint/js');
const tseslint = require('typescript-eslint');
const eslintrc = require('@eslint/eslintrc');
const { fixupConfigRules } = require('@eslint/compat');

const compat = new eslintrc.FlatCompat({
    baseDirectory: __dirname,
});

module.exports = [
    {
        files: ['**/*.ts'],
        languageOptions: {
            parserOptions: {
                project: true,
                tsconfigRootDir: __dirname,
            },
        },
        extends: [
            eslint.configs.recommended,
            ...tseslint.configs.recommendedTypeChecked,
            ...fixupConfigRules(compat.extends('plugin:rxjs/recommended')),
        ],
        rules: {
            // `eslint-plugin-rxjs` overrides
            'rxjs/no-implicit-any-catch': 0,
            'rxjs/no-subject-value': 'error',
        },
    }
]

@e-oz
Copy link

e-oz commented Aug 7, 2024

I don't understand how you can call "patching" a correct approach. It's just a temporary patch.

@oBusk
Copy link

oBusk commented Aug 7, 2024

I don't understand how you can call "patching" a correct approach. It's just a temporary patch.

To make it work right now of course, not as a permantent solution

@biolauri
Copy link

@cartant: do you have a plan how you wish to proceed with all the recent changes? (flat config, takeuntildestroyed, ...). Since not too much happened here for quite some time, might it be an option to integrate and update the three rules in https://github.com/angular-eslint/angular-eslint ? I am just thinking out loud and I have no idea what JamesHenry would say to that

There is already a discussion ongoing at angular-eslint/angular-eslint#2094. If you also like the idea, please upvote the first comment/post to get some attention there. :)

@JasonWeinzierl
Copy link

As mentioned in that discussion, I've published an initial fork of this project. Unless the community moves in a different direction, it's currently open for PRs.

I've also started a discussion on the main RxJS plugin to propose moving additional rules into this plugin: JasonWeinzierl/eslint-plugin-rxjs-x#132

@manbearwiz
Copy link

manbearwiz commented Jan 28, 2025

fwiw I also forked these last october to support both config file formats and plan to maintain them until the community settles on something:

@JasonWeinzierl
Copy link

Hah that brings us to 4 forks I've seen in the wild.

For now, I'll continue my own fork because I believe in its merits (good commit history, adding new rules, re-organizing and re-documenting existing rules). But I'll shut down and point at another fork if the community settles elsewhere.

There are open discussions in the following places:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants