I'm getting ESlint error in this file
Bar.ts:
class Bar {
constructor(public foo: string) {}
hello(): string {
return this.foo;
}
}
export default Bar;
my eslint config:
{
"env": {
"browser": true,
"commonjs": true,
"es2020": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"airbnb/base",
"eslint-config-prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 11
},
"plugins": ["@typescript-eslint/eslint-plugin", "eslint-plugin-prettier"],
"rules": {
"prettier/prettier": "error",
"no-unused-vars": "warn",
"@typescript-eslint/no-var-requires": "warn",
"func-names": "off",
"no-underscore-dangle": "off",
"class-methods-use-this": "off"
},
"overrides": [
{
"files": ["*.ts"],
"excludedFiles": ["*.js"],
"rules": {
"@typescript/no-var-requires": "off"
}
}
]
}
Eslint error on Bar.ts:
Useless constructor. eslint(no-useless-constructor)
If you are curious why my eslint config looks the way it is, it's because I'm trying to setup a project with both JS and TS files, and make ESLint work for each type of the file respectively.
What do I need to change in my ESLint config to make it not complaining about totally relevant code?