Category "eslint"

Warning Unexpected unnamed function func-names under, ESLint rule

My eslint version is 4.18.2, it would give a warning like this: Unexpected unnamed function Expected an assignment or function call and instead saw an ex

How do you run eslint for only a specific rule or set of rules - command line only

I know you can define rules in an .eslintrc file, but what if I just want to run eslint and check for one specific rule? E.g. $ eslint helpme.js --rule some-im

Nice way to get rid of no-unused-expressions linter error with chai

In my Chai tests I often find myself wanting to use their assertions that are something like .to.be.empty, .to.be.true e.t.c., because I find them to be cleaner

"Import in body of module; reorder to top import/first" Across Many Files

I have the same error as this answer, except instead of it just occurring in one file it is occurring in many; once I fix it for one file, another just pops up

TypeError: Failed to load plugin 'jest' declared in '.eslintrc': Class extends value undefined is not a constructor or null

I was updating react-scripts to latest version i.e. 5.0.0 and started seeing above error. One article suggested to upgrade @typescript-eslint to version ^5.0.0

Eslint rule to ensure minimum variable name length, but not on JSON?

Our code has become a bit of a maintenance nightmare due to previous developers being liberal with single letter variables and little documentation. The latter

Codemod vs. eslint --fix

I want to write a couple of scripts to automatically detect missing imports and import them based upon a root directory. Is it better to write this script as a

SAP Web IDE shows errors about ES6+ features

for (var items in _selectedContexts) { var downloadModel = __parsed[__parsed[items].toString().split("/")[1]][__parsed[items].toString().split("/")[2]]; var

Vue: disable no-unused-vars error: the simplest fix

I have a very simple vue project: <template> <div class="text-breakdown"> <h3 class = "title">Text Breakdown</h3>

Why (and How Can I FIx) ESLint import/no-extraneous-dependencies Failures on Installed Packages?

When I run ESLint I get the following errors: 1:13 error 'joi' should be listed in the project's dependencies. Run 'npm i -S joi' to add it import/no-

Eslint not working with the TypeScript syntax

I am trying to configure eslint for my REACT-TypeScript project. It was previously using tslint which is going to deprecate soon. I have gone through the web an

no-use-before-define typescript interfaces

I have 2 typescript interfaces that have a member that is of the type of the other interface (circular reference). My linter complains that I cannot use an inte

How to create a custom hook that recives dependencies?

I'm making a custom hook that have a toogle when some state change. You should be able to pass any state in an array. import { useState, useEffect } from 'rea

Error when deploying react app and it keeps sayings << Plugin "react" was conflicted between "package.json » eslint-config-react-app » >>

I have been having a little bit of issues when deploying my create react app, as it fails to compile and tells me Plugin "react" was conflicted between "package

ESLint Vue multiword components

Is there a way to stop getting error from ESLint for single word view name in Vue3? Every time I run ESLint, I get following message: 1:1 error Component na

Disable check of camel case rule in eslint

I have a large JavaScript file with multiple eslint rule violations. I am trying to disable them and address them one at a time. The code below shows that I can

Webpack 5 & Jest - Property 'toBeInTheDocument' does not exist on type 'JestMatchers<HTMLElement>'

I can't get the typings for Jest to work with Webpack 5 and TypeScript, I've tried other solutions for the same problem. The problem is only with "screen" and "

Webpack 5 & Jest - Property 'toBeInTheDocument' does not exist on type 'JestMatchers<HTMLElement>'

I can't get the typings for Jest to work with Webpack 5 and TypeScript, I've tried other solutions for the same problem. The problem is only with "screen" and "

Failed to load config "airbnb" to extend from - gitlab ci

I tried to do and redo the Airbnb eslint installation in various ways, but I always get this build error inside GitLab-ci. It works in my local environment. I c