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
0
votes
1 answer

Where do I add my .eslintrc.js file in a Vue Project?

I don't like that it turns off console.log() but wherever I put my eslint file Vue just doesn't seem to know it exists.
Brian Patrick
  • 333
  • 5
  • 18
0
votes
1 answer

.eslintrc.js keys with "-" (dash)

eslint allows formats other than json, including .js if it exports as module. Unfortunately, the keys required by eslint include dashes like prefer-const below. Quoting is required. This appears to work. But: Is there a workaround that allows the…
backspaces
  • 3,802
  • 6
  • 34
  • 58
0
votes
0 answers

Error while running ESlint: Cannot read property file

I have the following error in the line of "import React" in each file. import React, { Component } from 'react' The error is the following: Error while running ESlint: Cannot read property file: "path" I already tried a solution to a similar…
Iván
  • 401
  • 2
  • 6
  • 17
0
votes
0 answers

How do I use .eslintrc and other configs in my text editor from an npm package?

I've got all my .editorconfig, .eslintrc, .babelrc, etc files in an npm package. These configurations need to be shared between different projects, and it's easy enough to point at the npm package when executing code. On the other hand, my text…
Kevin Ghadyani
  • 6,829
  • 6
  • 44
  • 62
-1
votes
0 answers

problem after update to storybook and nx 15.9.2

I installed storybook for all libraries for my nrwl/angular project. It basically just updated nx from 15.9.2 to 15.7.1. I can build/start my project witout any problems, but lint now throws this error: Failed to load plugin '@nrwl/nx' declared in…
Andresch Serj
  • 35,217
  • 15
  • 59
  • 101
-1
votes
0 answers

Error while loading rule '@typescript-eslint/dot-notation'. .eslintrc.json

ERROR [eslint] Error while loading rule '@typescript-eslint/dot-notation': You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for…
-1
votes
1 answer

How to forbid edition of arguments of a function, expect Array.reduce accumulator

I did not find a documentation in the whole eslint website, and I do not know if there is a plugin to forbid arguments editions. Here is an example of code which should be: Incorrect: const incorrectUpdate = (data) => { data.field = data.field ===…
-1
votes
1 answer

Create ESLint configuration that works for both Vue 2 and Vue 3

I need to some how create an ESLint configuration that works for both Vue 2 and Vue 3, to be able to use it across multiple projects (by installing it as an NPM package). I tried to use vue-demi to detect the Vue version and then switch things out…
Kris D. J.
  • 612
  • 2
  • 7
  • 16
-1
votes
1 answer

Enable react-hooks/exhaustive-deps in Gatsby

How can I enable react-hooks/exhaustive-deps warnings in Gatsby? My question is about Gatsby projects, I have no problem in React projects I know that eslint-plugin-react-hooks is installed.In my .eslintrc file I added these changes but not…
WebMaster
  • 3,050
  • 4
  • 25
  • 77
-1
votes
1 answer

ESLint: Disable "Invalid number literal casing" rule

I'm using NuxtJS CLI, which comes together with Prettier and ESLint. I have problems with hexadecimal numbers: 0xffffff ESLint doesn't like it and throws this error: Invalid number literal casing unicorn/number-literal-case I found this solution, …
MAZ
  • 643
  • 5
  • 18
-1
votes
1 answer

How do get HTML out of semicolons in prettierrc?

Use prettierrc and eslint "semi" use false, But in the event section of HTML @update it is conjoined. How can I ensure that this semicolon only works in JS? module.exports = { // tab "tabWidth": 4, // 超过100自动换行 "printWidth": 100, //…
-1
votes
1 answer

I can't use WebStorm with React

I'm trying to create a project using React but it's impossible using WebStorm, it doesn't even run. ESLint does not recognize. I create a new React project using Node.js v16: React project created successfully: Does not run as ESLint does not…
Biruel Rick
  • 776
  • 1
  • 8
  • 17
-1
votes
1 answer

How to avoid ESLINT to break compilation instead of just showing complaints?

Many VueJS based projects came up with weird dictatorship-like ESLint configurations, that even break compilation if one has placed a semicolon at End of line or did not typed a space after "if"-statement (which is not an error for Javascript and…
itinance
  • 11,711
  • 7
  • 58
  • 98
-1
votes
1 answer

Disable eslint for previous commits

I am new to eslint and prettier. I am trying to set these up and wondering if there is a way to disable eslint and prettier for previous commits in the repo and run it only on the new code or new checkins? Thanks in advance for the help.
db07
  • 107
  • 1
  • 6
-3
votes
2 answers

How to get rid of `no-unused-expressions` eslint error, for `&&` and `?:` usage?

Problem statement: this.componentC && this.componentC.render() // by default, this throws error, per no-unused-expressions eslint rule
Venkat
  • 91
  • 8
1 2 3
31
32