Category "eslint"

Fix ESLint: Insert `·`(prettier/prettier) on WebStorm

For the following react code I get the following error: When I run ESLint using the --fix flag on my code base, I get an error that reads: ESLint: A space is r

How to set inline style rule with eslint?

I create a React Native project the version is 0.62.2 I change eslintrc.js as below module.exports = { parser:'babel-eslint', env: { browser: true,

Align indentation to the equal sign

I want to align the indentation to the equal sign when formatting my code. Is there any plugin or setup out there? Before: const React = require('react'); con

@nrwl/nx + VS Code + ESLint - Errors highlighting doesn't work

Linting shows errors in terminal but won't highlight the code in VS Code. ESLint extension is installed. Running nx lint: yarn run v1.22.10 $ nx lint > nx r

How to throw "expressive" / console friendly exceptions in JavaScript?

JavaScript noob here... I'm exploring various options for throwing exceptions. Throwing a string / primitive value This seems to be bad practice for several rea

How to make ESLint understand that function is used in vue pug template?

I have following vue component. <template lang="pug"> button(@click="onLogout") Logout </template> <script setup lang="ts"> function onLogout

Is eslint pre-commit hook in CRA bootstrapped application required?

My react application is bootstrapped using CRA(react-scripts v4.0.0) and I want to add a code formatter (prettier to be specific) that must format the code befo

@typescript-eslint/naming-convention ignore object inside a classname

tl:dr, why is this REGEX incorrect : classNames.*(.*{(?:.|\n)*?}) although it work in regex101 ? I am using typescript with eslint. I setup some naming conventi

Using eslint with typescript - Unable to resolve path to module

I have this import in my file app.spec.ts: import app from './app'; Which causes this Typescript error 2:17 error Unable to resolve path to module './app'

ESlint complaining about useless constructor

I'm getting ESlint error in this file Bar.ts: class Bar { constructor(public foo: string) {} hello(): string { return this.foo; } } export default B

Error: Do not use <img>. Use Image from 'next/image' instead. - Next.js using html tag <img /> ( with styled components )

I know that in Next.js we have Image component, but the problem I have with it is that I can't use it as a normal HTML tag like <img />. I have to give it

Prettier auto-correct javascript "import" statement into an one line but then eslitnt 'max-len' rule breaks

I have eslint setup with Prettier formatter in vscode. there is this following original line, import MyCustomComponentsIsThis from 'queries/internal/consu

Global variables in Javascript and ESLint

I have got multiple javascript files and I have defined some global variable in a file which loads before the others. As a consequence all of the files loaded a

Making Prettier understend TS "as" operator when it is working with eslint

I'am tring to use Prettier with ESLint for TS. But it's fails with an error SyntaxError: Unexpected identifier, expected the token `)` (17:55) On line with

Eslint not ignoring node_modules folder

Somehow after updating Babel from 6 to 7 my eslint started giving such a warning in node_modules: So, from my understanding node_modules folder is not ignore

Webpack alias is not recognized by flow

I'm having some trouble with webpack aliases and having it play nicely with flow. I have the alias: alias: { vue$: 'vue/dist/vue.esm.js', pu

vue ui showing Error: NO_MODULES when creating a project (windows)

I could see the GUI on the browser when I run vue ui command, and then when creating a project, I selected the npm as the Package Manager from the dropdown list

How to disable eslint eqeqeq?

I use create-react-app and just want to add rules to my package.json. I see that I can disable this rule, but how? In the official document, only the phrase "If

Error with eslint and vue/comment directive

Hello I was just running my website and I have 20 errors like this : Module Error (from ./node_modules/eslint-loader/dist/cjs.js): error clear vue/comment-di

Failed to load config "next/babel" to extend from eslintrc.json

When I'm trying to build the Next.Js app then the below error is coming with a successful build. This error is showing when I deploy the app in Vercel. error -