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

ESlint javascript config - new line before first object in array removed

I'm using VS Code and the formatting option for it. When enabled it always removes empty lines on the first object in an array. Example for Before formatting: var arr = [ { id: 1 }, { id: 2 } ] becomes: var arr =…
0
votes
1 answer

How to allow console.info()/warn()/error() and disable everything else in eslint config file?

I had .eslintrc file without "no-console" rules, and it by default errored on all console.*() calls. I need to allow console.info(), console.warn() and console.error(), so I added no-console rule to my .eslintrc: { "root": true, "no-console": [ …
user3132457
  • 789
  • 2
  • 11
  • 29
0
votes
1 answer

ESLint working but don't know what are all rules it is checking

I have installed the ESLint extension ( by Drik Breaumer) in vs code. Its running and also showing errors But what are the rules its checking I don't have any .eslintric files in my repository? In the package.json file, I have this…
Siluveru Kiran Kumar
  • 699
  • 1
  • 10
  • 16
0
votes
0 answers

Node JS 14 unable to use absolute path import (Cloud Functions)

I'm trying to use absolute path import form my custom modules and VSCode has no prob recognising them. The problem is that when I run firebase deploy which runs first eslint I get errors. 3:24 error Unable to resolve path to module…
M1X
  • 4,971
  • 10
  • 61
  • 123
0
votes
2 answers

How to run es-lint rules on Vue component's external script files

I've added es-lint checks on Vue components but the script for the component not in the same file, I kept it as a separate file for all the components in the project. For Example, I've added vue/order-in-components rule in .eslintrc.js which will…
Subramanian
  • 170
  • 3
  • 12
0
votes
1 answer

prettier-eslint in typescript files runs twice and have confilicts with eslint rules

I have problem with configuration prettier and eslint. Example function: const foo = () => { [1, 2, 3].forEach((element) => { console.log(element); }); }; When I save parentheses are removed from element and I receive an error: "Expected…
Pr0thean
  • 23
  • 6
0
votes
1 answer

React in VS Code error: Parsing error: 'import' and 'export' may appear only with 'sourceType: module'

I was trying to change some unwanted automatic formatting in my VS-Code and seem to have broken my app. I was removing/reinstalling eslint and prettier. When I try to run my start script I get the following error: ./src/index.js Line 1:1: Parsing…
JimmyTheCode
  • 3,783
  • 7
  • 29
  • 71
0
votes
1 answer

Which eslint/prettier rule cause to this error?

I've the following code within my React component: return (
Anatoly
  • 5,056
  • 9
  • 62
  • 136
0
votes
1 answer

Is it necessary reload eslint after remove ou add any rules?

I had to add two new rules prefer-const and prefer-arrow-callback, disable them. So add inside rules, but looks like the eslint stop to work, it does not format the document. { "env": { "browser": true, "commonjs": true, …
Hasunohana
  • 565
  • 8
  • 22
0
votes
0 answers

Javascript files are automatically changed by eslintrc.json

In visual studio 2015 we have a solution with c# and javascript files. For the javascript files, we use a .eslintrc.json file for code conventions. However, everytime I build the solution, these files are automatically changed to the settings in…
0
votes
1 answer

Why Eslint add a space automatically for object property name with hyphen?

I have this data which I want to display it out in Vue: