#EsLint error " appService' is defined but never used "but i used the appservice in function.
8 messages · Page 1 of 1 (latest)
Suggestion for @drowsy yoke:
Please format your question with Markdown formatting.
It leads to better readability and an easier time to spot problems.
For code blocks, you can wrap your block with three back ticks before and after the block, and after the first three back ticks you can add a language (like ts) to add syntax highlighting.
e.g.
```ts
@Injectable()
export class MySuperAwesomeService {
constructor(@Inject('InjectionToken') private readonly dep: SomeDependency) {}
getRandomNumber(): number {
return Math.round(Math.random() * 1000);
}
}
```
Becomes
@Injectable()
export class MySuperAwesomeService {
constructor(@Inject('InjectionToken') private readonly dep: SomeDependency) {}
getRandomNumber(): number {
return Math.round(Math.random() * 1000);
}
}
It looks fine. Make sure the file is saved and the problem isn't from your editor/IDE by running npm run lint
i got error when i run npm run lint
18:22 error 'appService' is defined but never used no-unused-vars
How did you generate the project? Using the nestjs cli?
Did you make any changes to the .eslintrc.js configuration?
yeah using nestjs cli and added airbnb
There are a lot of airbnb eslint plugins out there, and I am not sure which one you've added. There shouldn't be such a problem with the default eslint configuration.
i am using airbnb-base