until-destroy
until-destroy copied to clipboard
Eslint v9 update
Current eslint v9 didn't support old config to use recommended rule rxjs/no-unsafe-takeuntil.
This is how to fix it using the fork https://github.com/DaveMBush/eslint-plugin-rxjs :
npm i --save-dev @smarttools/eslint-plugin-rxjs
import rxjs from '@smarttools/eslint-plugin-rxjs';
export default [
...
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname
},
},
},
{
files: ['**/*.ts', '**/*.tsx', '**/*.cts', '**/*.mts', '**/*.js', '**/*.jsx', '**/*.cjs', '**/*.mjs'],
// Override or add rules here
plugins: {
rxjs,
},
rules: {},
},
{
files: ['**/*.ts'],
rules: {
'rxjs/no-unsafe-takeuntil': [
'error',
{
alias: ['untilDestroyed']
}
],
},
and here is fix for second rule of this repo (prefer-takeuntil):
npm i @rxlint/eslint-plugin-angular --save-dev
import rxjsAngular from '@rxlint/eslint-plugin-angular';
...
plugins: {
...
'@rxlint-angular': rxjsAngular
},
...
rules: {
...
'@rxlint-angular/prefer-takeuntil': [
'error',
{
alias: ['untilDestroyed'],
},
],
...
},
@arturovt @NetanelBasal eslint 8 EOL passed 4 months ago and documentation https://github.com/ngneat/until-destroy?tab=readme-ov-file#eslint-rules didn't cover this fact. Rules are just incompatible with eslint9+ config format (without fixes above).