Questions tagged [eslintrc]

For issues relating to .eslintrc.* configuration files.

Files of type .eslintrc.* are used to configure eslint.
Supported file formats are JavaScript (*.js), JSON (*.json) and YAML (*.yaml or *.yml).

Note that the config file .eslintrc (without extension) is deprecated in favor of .eslintrc.* files.
See: .eslintrc without file extension is deprecated.

[For] configuration files - use a JavaScript, JSON, or YAML file to specify configuration information for an entire directory and all of its subdirectories.

480 questions
678
votes
40 answers

Why do I keep getting "[eslint] Delete `CR` [prettier/prettier]"?

I am using VS Code with Prettier 1.7.2 and ESLint 1.7.0. After every newline I get: [eslint] Delete `CR` [prettier/prettier] This is the .eslintrc.json: { "extends": ["airbnb", "plugin:prettier/recommended"], "env": { "jest": true, …
bier hier
  • 20,970
  • 42
  • 97
  • 166
241
votes
7 answers

ESLint: TypeError: this.libOptions.parse is not a function

I was getting started with Next.js on WebStorm 2022.2.1 Build #WS-222.3739.57. I created a new Next.js project with TypeScript enabled, and that's all. The error is shown below: TypeError: this.libOptions.parse is not a function TypeError:…
Thebluedragon
  • 2,564
  • 2
  • 4
  • 13
219
votes
2 answers

How to disable multiple rules for eslint nextline

I have this code: const subTotal = orderInfo.details.reduce((acc, cv) => acc += Number(cv.price) * Number(cv.quantity), 0); I want to disable two ESLint types of checks for this line, no-return-assign and no-param-reassign. I tried it this way: /*…
shubham choudhary
  • 2,670
  • 5
  • 13
  • 16
104
votes
4 answers

describe is not defined when installing jest

I installed jest v24.7.1in my project with: npm install jest -D Then I start writing some test files, However I got these eslint errors: 'describe' is not defined. eslint (no-undef) 'it' is not defined. eslint (no-undef) 'expect' is not defined.…
Slim
  • 5,527
  • 13
  • 45
  • 81
83
votes
2 answers

Using jest in my react app, describe is not defined

I am new to jest and trying to figure out some basic stuff in my following code import * as actions from './IncrementalSearchActions'; describe('Incremental Search Actions', () => { it('Should create an incremental search action') }); The…
tmp dev
  • 8,043
  • 16
  • 53
  • 108
78
votes
3 answers

Is it possible to show warnings instead of errors on ALL of eslint rules?

As the title says, would it be possible for eslint to show warnings instead of errors on ALL of the rules? I'm using Standard JS, if that information is relevant. Thanks!
nrion
  • 4,258
  • 4
  • 17
  • 33
67
votes
2 answers

How can I disable the error (prettier/prettier) on eslint?

While coding, I was not using eslint. Now I installed it and it has flooded my editor with prettier/prettier errors, which by no way seem like they make my code prettier. I am looking to find a way to solve this. prettierrc.js: module.exports = { …
Arat2003
  • 841
  • 1
  • 5
  • 8
59
votes
5 answers

ESLint Definition for rule 'import/extensions' was not found

I'm getting the following two errors on all TypeScript files using ESLint in VS Code: Definition for rule 'import/extensions' was not found.eslint(import/extensions) Definition for rule 'import/no-extraneous-dependencies' was not…
56
votes
3 answers

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 WebStrom, but it doesn't work and displays an error: ESLint: Parsing error: This experimental syntax requires enabling one of the following parser plugin(s): 'jsx, flow, typescript' (2:9). Here is my .eslintrc and…
48
votes
6 answers

Ignore or prevent ESLint errors from breaking the build in a React project (create-react-project)

I've recently created a project with create-react-project. The problem is that, while I'm developing, every time there's a problem with ESLint, the build breaks and doesn't compile the code. Can I keep the build running while still having ESLint…
R01010010
  • 5,670
  • 11
  • 47
  • 77
47
votes
5 answers

Struggling with TypeScript, React, Eslint and simple Arrow Functions components

I have been struggling all morning with this issue and couldn't find the solution anywhere. I am new to typescript, and I am trying to set it up properly with Eslint and Prettier to ensure the code is properly formated. So, the issue I am facing…
47
votes
3 answers

ESLint Prefer default export import/prefer-default-export

Hi there I am struggling to understand / have this eslint error disappear with my React Project. Prefer default export import/prefer-default-export Helpers.js error is pointing to: export function getItems() { fetch('./data/data_arr.js') …
roshambo
  • 2,624
  • 6
  • 31
  • 54
46
votes
2 answers

Failed to load plugin @typescript-eslint: Cannot find module 'eslint-plugin-@typescript-eslint'

I am reconfiguring my project from tslint to eslint. I can run eslint manually, but webpack fails to run with this error message: Module build failed (from /path/node_modules/eslint-loader/index.js): Error: Failed to load plugin @typescript-eslint:…
Thilak Rao
  • 1,841
  • 2
  • 19
  • 26
46
votes
4 answers

eslint Parsing error: Unexpected token function with async

I am getting the following error in async usage on ESLINT. eslint Parsing error: Unexpected token function with async Here is my eslintsrc { "extends": "airbnb-base", "rules": { "no-console": "off", "func-style":"error", …
shamon shamsudeen
  • 5,466
  • 17
  • 64
  • 129
46
votes
4 answers

How to fix just one rule using eslint

I want to use eslint command flag --fix to just fix one rule. And I tried the command: eslint --fix --config ./.eslintrcsomerules.js .. But it does not work. How to achieve the object? My .eslintrcsomerules.js file is below: module.exports = { …
soarinblue
  • 1,517
  • 3
  • 21
  • 30
1
2 3
31 32