Questions tagged [eslint]
The pluggable linting utility for JavaScript and related frameworks.
eslint
6,936
questions
-1
votes
0
answers
16
views
How to clear the clutter from root directory of a vite project? [closed]
When I create a new Vite project with typescript and eslint i get a lot of config files in the root directory of my project.
It bothers me as I like my code well organized, so I just want these config ...
-1
votes
0
answers
31
views
ESLint - Wrong unnecessary conditional error
I'm having some issues with ESLint while linting Typescript interface array. Look at the following example:
interface SomeKind {
one: string
two: string
}
const someKinds: SomeKind[] = []
...
0
votes
0
answers
20
views
typescript eslint stops working when I add a rule
I've installed typescript-eslint and it works great when I have the following config:
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
export default ...
0
votes
0
answers
22
views
ESLint 'no-unused-vars' error with Vite and React [closed]
I am working on a React project using Vite as my development server. Recently, I encountered an internal server error related to ESLint when trying to run my project. The error messages are pointing ...
0
votes
0
answers
47
views
Include Files is not working in ESLint 9+
I'm using ESLint 9.7.0 and I want to implement ESLint on a specific folder in my React app. But it's not working on the folder I'm giving the path of that folder in my eslint.config.mjs. Here is my ...
1
vote
0
answers
29
views
ESLint: @stylistic/type-annotation-spacing and @stylistic/key-spacing conflict
This is my current eslint config. I am currently using the latest version of ESLint. I would like to be able to use these two rules in combination but they conflict. I also tried to write a custom ...
0
votes
1
answer
46
views
ESLint is not reading the rules specified in the eslintrc.json in my Angular v17 Project
ESLint is not reading the rules written in the eslintrc.json file. It is displaying all the problems as errors even though I have set values of some rules as warn. Moreover, it is displaying errors ...
2
votes
2
answers
122
views
Prettier is removing typescript generic annotation from react class component
I'm trying to make an ErrorBoundary using a class component like this
class ErrorBoundary extends Component<ErrorBoundaryProps,ErrorBoundaryState>
But every time I format it with prettier, the ...
1
vote
0
answers
55
views
error 'console' is not defined no-undef with eslint 9 jest
This question isn't a duplicate. I have read through this question: ERROR: 'console is not defined. [no-undef] - Brackets and most of the answers are for ESLint 8 and below. Some have talked about the ...
0
votes
0
answers
10
views
NX automatically adds undesidered eslint plugin causing performance issues
It happened several times already that somehow NX added this:
"plugins": [
{
"plugin": "@nx/eslint/plugin",
"options": {
"...
0
votes
0
answers
22
views
How Can I Display All Lint Errors and Warnings in VS Code Without Opening Each File?
When I run nx run-many -t lint --all, I get a lot of warnings and errors in the terminal.
Is there a way to display all these errors and warnings in the Problems section of VS Code?
Currently, they ...
0
votes
2
answers
40
views
Media elements such as <audio> and <video> must have a <track> for captions eslint error
When I try to add
<video controls>
<source src="content.mp4" type="video/mp4" />
<source src="content.webm" type="video/webm" />
Your ...
0
votes
0
answers
23
views
When using ESLint in a Vue component, do I need to set the lint rules for the <script> and <template> separately?
I have a Nuxt 3 app that uses the new Nuxt ESLint module for linting and formatting (using ESLint Stylistic). The relevant bit of my ESLint config looks like this:
import withNuxt from './.nuxt/eslint....
0
votes
0
answers
38
views
Migrating ESLint9 Older Config to new Flat Config using @angular-eslint/template-parser as template parser not working
Using the tool @eslint/migrate-config to migrate to the new ESlint (version 9) flat config is not working.
Cannot integrate @angular-eslint/template-parser properly.
.eslintrc.json
{
"root&...
-3
votes
1
answer
50
views
Adding ignores to the typescript-eslint recommended configuration?
I'm trying to add an ignores object to the typescript-eslint configuration
I figured this would do the trick:
import eslint from "@eslint/js";
import tseslint from "typescript-eslint&...