I'm using the eslint-config for nextjs and I'm having some issues when using constructor shorthand while creating my module classes. I would like to know if is it possible to add the rules above to the lint setup
How to reproduce the error:
1- Create a nextjs project with typescript
2- add rocketseat eslint config on your .eslintrc
3- create a typescript class like the example bellow:
export class ExampleClass {
constructor(private foo:string) {}
}
I've bypassed this error by adding thoose rules bellow:
{
// note you must disable the base rule as it can report incorrect errors
"no-useless-constructor": "off",
"@typescript-eslint/no-useless-constructor": ["error"]
}
Description
I'm using the eslint-config for nextjs and I'm having some issues when using constructor shorthand while creating my module classes. I would like to know if is it possible to add the rules above to the lint setup
How to reproduce the error:
1- Create a nextjs project with typescript 2- add rocketseat eslint config on your
.eslintrc
3- create a typescript class like the example bellow:4- view an error similar to this one:
Possible solution:
I've bypassed this error by adding thoose rules bellow: