I've been updating and refining an Angular project (to Angular 8, Electron 6, Ionic 4) and we made the decision to transition from TSLint to ESLint.
I've set up some rules and they're working fine, but I'm struggling to get rid of the no-unused-vars
warning for type definitions. Whenever I run linting, I keep getting this warning for OperatorFunction
and Observable
, even though it's not really a problem.
import { OperatorFunction, Observable, timer } from 'rxjs';
import { tap } from 'rxjs/operators';
export function executeDelayed<T>(fn: () => void, delayTime: number): OperatorFunction<T, T> {
return function executeDelayedOperation(source: Observable<T>): Observable<T> {
//...
}
}
The .eslintrc.js file contains the following configuration:
module.exports = {
"env": {
"browser": true,
"es6": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:prettier/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"no-unused-vars": [
"warn",
{
"vars": "local",
"ignoreSiblings": true,
"args": "after-used",
"argsIgnorePattern": "res|next|^err"
}
],
"no-use-before-define": [
"error",
{
"functions": true,
"classes": true
}
]
}
};
I've looked through several similar questions here but couldn't find a solution. Any suggestions? Keep in mind that reverting back to TSLint is not an option.