Category "eslint"

Configuring tsconfig.json and eslint for a monorepo using Yarn workspaces

I'm using a Yarn workspace monorepo structure in a TypeScript React project: packages admin package.json user package.json package.json // Workspace

TypeScript/Eslint throwing a 'Promise returned' error on a Express Router async route

I have the following endpoint setup to reset a database after test runs: import { getConnection } from 'typeorm'; import express from 'express'; const router =

Why we need to lint code when build with webpack?

There are some plugin about linting code, such as https://github.com/webpack-contrib/eslint-webpack-plugin. I wonder why we need to lint code during building. E

Plugin React was cnonflicted between package.json

Any project I create using npx create-react-app When compiling the project, the same message always appears: Plugin react'' was conflicted between package.json

I am trying to create a react app with typescript but I keep getting failed to compile on start

I am trying to create a react app with --template typescript and I keep getting this error: ERROR in Plugin "react" was conflicted between "package.json »

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