Category "eslint"

Enforce one describe per file

The Story: We have a rather big test codebase with Protractor+Jasmine tests. One of the current problems we have is that some of the test/spec files contain

TypeScript `extend` produces ESLint error when extending a template string?

I want to implement a type TrimStart like this: type TrimStart<T extends string> = T extends ` ${infer Rest}` ? TrimStart<Rest> : T; type TT = Trim

ESLint - 'process' is not defined

I am using ESLinter for a simple node project. Below is the only code I have in index.js: const express = require('express'); const app = express(); app.get(

'eslint' is not recognized as an internal or external command

I'm trying to install eslint & run it in vs code. I ran this command: npm i -g eslint and it seemed to work, but I keep getting an error when I try to run

import ``,ESLint: Cannot read property 'range' of null Occurred while linting

The error is because of this line of code item.component = () => import(`@/views/${_component}`) If I modify .eslintrc.js, it works 'indent' : "off", 'te

What is causing Error: .eslintrc.js: Environment key "vue/setup-compiler-macros" is unknown

I am developing a sample app using Vue 3 and Typescript. Specifically, I am using the new Vue v3.2 setup option in the section of the Vue SFC. Vue docs advise

Definition for rule 'react-hooks/exhaustive-deps' was not found

I am getting the following eslint error after adding // eslint-disable-next-line react-hooks/exhaustive-deps in my code. 8:14 error Definition for rule 'r

Prettier react/jsx-max-props-per-line format with VSCode

I use Prettier in JavaScript project with React. All my component props is formated in 1 line : <Icon icon="arrow-left" width={15} height={18} /> And i

ESlint - Error: Must use import to load ES Module

I am currently setting up a boilerplate with React, Typescript, styled components, webpack etc. and I am getting an error when trying to run eslint: Error: Mus

ESLint: 8.0.0 Failed to load plugin '@typescript-eslint'

Could you help me, I've got this error when I try building a project? Oops! Something went wrong! :( ESLint: 8.0.0 TypeError: Failed to load plugin '@types

Error: Failed to load parser 'babel-eslint' declared in '.eslintrc': Cannot find module 'babel-eslint' in create-react-app

Trying to install eslint into create-react-app, but get next error when running linter: Here is my .eslintrc config file: { "extends": ["airbnb", "prettie

Resolve Error: typescript with invalid interface loaded as resolver ESLint

I'm having ESLint in my project and getting an error Resolve Error: typescript with invalid interface loaded as resolver : import-no-restricted-paths when I ad

Rules are only applied from the last override?

I have multiple overrides that target different file subsets, but some overlap. But eslint only seems to use the last matched override, thereby ignoring some of

ESLint configuration with typescript jsx

I am having issues with configuration with typescript. Here is my following code in tsconfig.json: { "compilerOptions": { "target": "es5", "lib": [

What is `react/no-unused-state` and why is it bad?

Can someone explain exactly what no-unused-state means and why is it considered bad practice? I can't seem to find any information other than the following sen

Eslint jest/globals environment key unknown

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. Lo

ESLint error "'svelte' is not defined" when using svelte.JSX.MouseEventHandler

In a SvelteKit project, I have included the a svelte type. My problem is that my linting (ESLint) throws an error saying that 'svelte' is not defined. My code i

EsLint - Suppress "Do not use 'new' for side effects"

I saw the way to suppress this with jsLint, tried it, it did not work. I need the 'new' keyword or my script does notwork. How can I suppress it in .eslintrc?

EsLint - Suppress "Do not use 'new' for side effects"

I saw the way to suppress this with jsLint, tried it, it did not work. I need the 'new' keyword or my script does notwork. How can I suppress it in .eslintrc?

Lint rule "no-restricted-imports" throw error when patterns group specified

I configured .eslintrc.json in Nx/nrwl monorepo for React project. When I add group to pattern attribute to no-restricted-import "rules": { "no-restricted-i