Questions tagged [eslint]
The pluggable linting utility for JavaScript and related frameworks.
eslint
6,941
questions
0
votes
0
answers
59
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
33
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
59
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
211
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
67
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
12
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
24
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
52
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
30
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
49
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
55
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&...
-3
votes
2
answers
64
views
Why 'eslint' + 'typescript-eslint' used for TypeScript linting when 'tsc' appears to work better? [duplicate]
Goal: To create a strict TypeScript linter script
eslint checks for poor JavaScript code patterns.
The docs suggests initialising eslint with npm init @eslint/config@latest
This also installs ...
0
votes
0
answers
13
views
Disable eslint `require-jsdoc` for nested functions
I'm trying to disable jsdoc warnings for nested functions. For example, in this file it spits a warning on the commented line.
// Notifications.ts
import * as Device from "expo-device";
...
-1
votes
0
answers
18
views
How to customize error highlighting in VS Code editor according to ESLint?
Can't configure error highlighting and auto-correction when saving a file according to ESLint settings in VS Code. ESLint extension installed
Configuration of the eslint.config.mjs file:
import ...
1
vote
2
answers
75
views
Eslint 9 add a rule to existing configuration
I have a ES9 config that looks like this (eslint.config.js):
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import stylistic from '@...