Category "eslint"

Ordering member for async and method in Typescript-ESLint

Is there a way for ordering async / sync method member ? example # ❌ Incorrect function myFunction() { // something code } async function myAsyncFunct

Can't global uninstall npm package (eslint) OS X

I have eslint installed and I wanted to update it to a newer version. Upon trying to do this, I found out that I can't get rid of my current version of eslint.

eslint complains about typescript's path aliasing

I've set up path aliasing in typescript's .tsconfig so my imports look cleaner. In my code when I try and import my interface like this import { ApiResponse }

"'React' was used before it was defined." eslint warning

Similar question to this post on StackOverflow but I cannot seem to get rid of this warning after trying everything I could find on the internet. Github Issue.

What "plugins" property in .eslintrc does?

module.exports = { root: true, parser: '@typescript-eslint/parser', plugins: ['@typescript-eslint'], extends: [ 'eslint:recommended', 'plugin:@t

setting up lint-staged for jest

I have to try to set up a husky with lint-staged. Initially, I was trying to set up like the following but that does not work. "lint-staged": { "*.js": [

Prettier to format .vue

Prettier VS Code extension doesn't work properly with .vue. I mean how to setup prettier to integrate it with eslint and format .vue files on Cmd+Shift+P ->

How do I automatically check for '.only' calls accidentally left in Mocha specs?

I occasionally forget to remove .only calls from my Mocha specs before pushing spec changes. Doing so obviously affects test coverage, which requires addressing

@typescript-eslint/naming-convention workaround for Vue components

We have this rule enabled: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/naming-convention.md#allowed-selec

Add space in self closing tags before in self closing tags

How do you include a space before the closing tags in self closing tags with WebStorm/IntelliJ-based products? Default settings turns <ReactComp /> to &l

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