eslint Questions

7

In other threads I read that the issue might come when eslint and tsconfig.json are not in the same working folder, but I have all the files in the project's root folder. Somehow, after initializin...
Venator asked 4/12, 2020 at 4:28

3

I use neovim to develop TypeScript, I upgraded eslint 8.28.0 When I opened neovim it got an error, I tried many times to solve it, but still could not solve this problem, please ask for help ❴eslin...
Izard asked 2/12, 2022 at 11:37

4

E.g. I want to restrict importing react-use, but allow react-use/lib/usePrevious. I tried: rules: { 'no-restricted-imports': [2, { patterns: [ 'react-use', ] }], }, And rules: { 'no-restric...
Paternalism asked 23/2, 2021 at 9:46

4

Solved

The context is pretty big project built with ReactJs, based on eslint rules, with this eslint configuration const DONT_WARN_CI = process.env.NODE_ENV === 'production' ? 0 : 1 module.exports = { e...
Nirvana asked 2/10, 2020 at 11:36

2

I was working on a new react project and had set up my ESlint which was running fine before I changed code in another file and now it's giving me an error: Error: Unexpected token 'export' I'm new...
Jaramillo asked 8/5, 2021 at 14:23

2

Solved

How I can get a warning instead of an error while using ESLint? I use ESLint 6.7.2 version with a plugin for babel and react. This is my actual .eslintrc.json: { "env": { "browser": true, "es...
Trent asked 7/12, 2019 at 11:19

6

On my new project, ESLint is not outputting warnings like before, I'm using VSCode. If I have an unsed var somewhere in my code, it doesn't show the warning in the terminal output anymore. Only in ...
Polygenesis asked 8/2, 2021 at 18:8

5

Unable to launch my app using sudo yarn build I am getting this error: package.json » eslint-config-react-app/jest#overrides[0]: Environment key "jest/globals" is unknown What would be ...
Denbrook asked 1/5, 2021 at 7:17

3

Solved

I'm having an issue with the linting for my Vue SPA. I'm using the defineEmits function from the script setup syntactic sugar (https://v3.vuejs.org/api/sfc-script-setup.html). The errors just do no...
Blevins asked 21/1, 2022 at 15:3

1

VSCode linting does not seem to respect the paths I defined in my tsconfig.json file. I get the following error, when importing anything from an "alias" defined in my tsconfig.json. tsco...
Carlyle asked 1/10, 2020 at 2:6

9

I have an issue where the missing dependencies warning doesn't show up any longer for useEffect in React. I am using VS Code if that matters. Does anyone know what could be the cause for this, as r...
Gymnasiast asked 29/12, 2021 at 14:2

6

Solved

Recently I updated my react project using "create-react-app" (React 16.9) Everything worked just OK before the update, but suddenly I get following ESLint error: (In the output tab) [Err...
Pigpen asked 19/8, 2019 at 13:55

2

Solved

I have come JS code with some infinite loops (we're using node-fibers to allow things to happen). ESLint hates: while (true) { } because of the constant condition. The following is allowed th...
Almetaalmighty asked 26/5, 2016 at 16:34

9

Solved

After looking at the documentation for the import/no-named-as-default eslint rule, I'm still confused about what exactly I'm doing wrong. I have the following file structure . ├── ButtonBack.css ...
Actinon asked 8/6, 2017 at 13:33

4

I have a chai among my devDependencies: "devDependencies": { "@types/chai": "4.2.14", "chai": "4.2.0", } Chai is requires for tests only, but I ...
Sundowner asked 15/5, 2021 at 23:12

5

Solved

I've set up path aliasing in typescript's .tsconfig so my imports look cleaner. In my code when I try and import my interface like this import { ApiResponse } from '@api'; eslint complains: Una...
Recessive asked 15/7, 2019 at 2:2

4

As the title says, ESLint is complaining with this error message: ESLint: Unable to resolve path to module '@vercel/analytics/react'.(import/no-unresolved) In the line: import { Analytics } from '...
Contact asked 4/11, 2022 at 15:22

5

I want to deploy my Next.js file on the server. When I hit the command npm run build it shows the error Need to disable some ESLint rules? Learn more here: https://nextjs.org/docs/basic-features/e...
Tourneur asked 2/9, 2022 at 4:19

2

Solved

In the case where you have an override where you want to "downgrade" the js parser, how do you turn off the extends from the parent? parserOptions is easy to override because it is key-based. exten...
Glairy asked 19/7, 2019 at 7:43

7

Solved

I have a project that has both prettier and eslint installed. The problem is that when I save a file eslint automatically changes the format of the file and it seems some rules conflict with pretti...
Inquiring asked 31/7, 2020 at 17:2

3

I'm using ESLint to make my JavaScript code style consistent. My favorite indentation level is 4 and I want my declarations style to be this: function () { let a = 1, bbb = 2; const cc = 3, d...
Feuillant asked 28/4, 2017 at 21:52

2

Solved

I try settup eslint with typescript-eslint. My config from docs: import eslint from '@eslint/js'; import tseslint from 'typescript-eslint'; export default tseslint.config( eslint.configs.recommen...
Amazonite asked 23/2, 2024 at 17:9

13

I have a custom eslint-config that has several plugins for various packages, including jest. I have the main set to an index which just extends other files. Long story I have a jest config file. T...
Writhe asked 23/9, 2019 at 15:33

3

I am using eslint and prettier (in vscode), and I configured the indent rule: // .eslintrc { // other settings... rules: { "indent": ["error", 4] // 4 whitespace indent } }...
Farthing asked 26/3, 2022 at 7:28

2

Solved

I am trying to initalize a project with Vue3 and typescript, but after adding vuex to the project, it won´t compile. What I did: First I created the project with create-vue, using the recommend op...
Oriane asked 7/5, 2023 at 21:3

© 2022 - 2025 — McMap. All rights reserved.