Category "eslint"

Extension 'eslint' is configured as formatter but it cannot format 'JavaScript'-files

I am experiencing an intermittent problem with ESLint in VS Code. When saving a file, instead of formatting it, this message shows in the status bar: Apparentl

How can eslint be configured to work with svelte and postcss-nesting?

Using postcss with plugin postcss-nesting in svelte is quite easy -- adding postcss-nesting to the preprocess config in svelte.config.js is the only thing neede

How do I configure parcel to exit build with an error if eslint does not validate

I'm building a react app with parcel. I have an eslint config set up that I like, and use VSCode tools to catch eslint errors and fix them as I code. The app bu

"Parsing error: No babel config file detected" when IDE not open at Vue projects root directory

I stumbled into a problem where in VS Code, when a Vue project is created and not open at root directory of the Vue project, babel.config.js wouldn't load and I

ESLint: Parsing error: This experimental syntax requires enabling one of the following parser plugin(s): 'jsx, flow, typescript' (2:9)

I am trying to use eslint in webstorm, but it doesn't work and displays an error:ESLint: Parsing error: This experimental syntax requires enabling one of the fo

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