Questions tagged [eslint]
The pluggable linting utility for JavaScript and related frameworks.
eslint
6,934
questions
1
vote
1
answer
23
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 '@...
-1
votes
0
answers
24
views
Catching errors with the lint:eslint script in the lit typescript starter project?
I'm testing the lint:eslint script in the lit element typescript starter project.
I added a property with undefined any like this below the name property:
/**
* The name to say "Hello" ...
0
votes
0
answers
10
views
Error loading rule @typescript-eslint/no-implied-eval lint-staged eslint --fix
I can not run eslint --fix with lint-staged
I'm trying to implement lint-staged husky. I already installed husky, lint-staged and relate packges.
"scripts": {
"dev": "...
0
votes
0
answers
34
views
eslint and stylelint fix flag not working as expected [closed]
My eslintrc.cjs and stylelintrc.json files are given below along with other config files:
Package.json
stylelintrc.json
eslintrc.cjs
tsconfig.json
Specifically, look at the scripts in package.json:
...
1
vote
1
answer
24
views
ESLint: Why is no-unused-expressions failing?
In my code I have a series of ternary operators using the addition/subtraction assignment operator to modify the value for a variable corresponding to the pixel position of an element in an SVG.
A few ...
0
votes
1
answer
37
views
Next.js / ESLint – "Parsing error: Cannot find module 'next/babel'"
Every time I create a Next.js app with:
`npx create-next-app@latest`
ESLint immediately starts flashing warnings in all my .js files saying
"Parsing error: Cannot find module 'next/babel'
...
0
votes
0
answers
21
views
Eslint allow globals while keeping undef errors
In eslint I have to declare each global class
Combo: "writable",
Block: "writable",
Peek: "writable",
Or disable undef "no-undef": &...
-1
votes
0
answers
17
views
How to configure a JS/TS monorepository from a legacy project: feedback and advices [closed]
I'm a web developer and I'm trying to consolidate one of our apps, that we decided to transform into a monorepository a few months ago. It's composed of apps in Javascript and/or Typescript -- 2 ...
0
votes
2
answers
28
views
Local npm dependency in Ember.js 5.8
I need custom linting rules for my Ember 5.8 project. Ember 5.8 uses ESLint 8.57 and ESLint allows custom rules via Plugin, see this tutorial. Step 8 of said tutorial reads as follows:
You might want ...
0
votes
4
answers
59
views
How to bypass useEffect dependency for custom hook?
Here's my sample code:
const { getConversionList, conversionList } = useConversion();
useEffect(() => {
getConversionList();
}, []);
useConversion is a GraphQL resolver hook, I'm getting ...
0
votes
0
answers
426
views
Error while installing @typescript-eslint/eslint-plugin
I am getting below error while installing the package @typescript-eslint/eslint-plugin
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ...
-2
votes
0
answers
15
views
yarn tsc command throwing error for node_modules folder [closed]
"typescript": "3.8"
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
When I try to run command yarn ...
0
votes
0
answers
22
views
Configure @typescript-eslint/quotes for double-quotes
I'm setting up ESLint for a new Next.js TypeScript project in VS Code and find that I cannot configure the @typescript-eslint/quotes rule to enforce double-quotes rather than single-quotes.
For non-...
0
votes
0
answers
27
views
How to allow and/or configure rules for self-closing tags?
I am using ESLint in my Angular application. When I run ng lint which is running the following script:
"lint": "eslint --color --fix --ext .ts ./src/app",
it fails with error:
...
0
votes
0
answers
27
views
Do i need the `languageOptions.globals` field in eslint flat config when using typescript-eslint?
Is it necessary to have languageOptions.globals in my eslint flat config when using the type-script-eslint plugin? Doesn't typescript eliminate the need for this field? Or should i keep this in my ...