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
0 answers

Script to detect and save single line comments into an array for javascript files

I want to write a script that takes a javascript file and iterate through it line by line and check for single-line code comments. If there are any then push it to array and return that array. For Example: const array=[1,2,3,4,5]; //This comment…
Suleman Ahmad
  • 452
  • 1
  • 5
  • 14
0
votes
1 answer

ESlint cannot override parseOptions

I cannot make a config to override the main configuration of the eslint.js .eslintrc module.exports = { "root": true, "env": { "node": true, "browser": true, }, "globals": {}, "parserOptions": { "ecmaVersion": 5, …
Nick
  • 2,818
  • 5
  • 42
  • 60
0
votes
0 answers

possible to have rule making eslint show warning / error if no return before res in nodejs?

I went through the eslint doc list wanting to find a rule to give warning / error or even better auto fix to have a return infront of res sometimes people only do res.json({blah}) instead return res.json({blah}) personally really prefer having a…
Dora
  • 6,776
  • 14
  • 51
  • 99
0
votes
1 answer

Eslint wont work because of eslint plugin error?

I can't seem to get my eslint to work. I have the eslint extenstion on vscode. I created a new node project and npm installed eslint as a dev dependency. I chose the Air-BNB style and then went to check if it worked. Whenever I open a file I get a…
0
votes
2 answers

C# Docusign API MyHR sample app looking for eslint

I'm looking to run the MyHR CSharp sample app in my Visual Studio 2019. I have followed the steps in the Github manual installation notes, I am getting stuck in getting it to run the localhost5001. Instead, when I run "npm start" from the project…
0
votes
1 answer

AssertionError 'import' is reserved when writing tests for custom eslint rule

The custom eslint rule runs ok in our project, but I cannot figure out how to run tests for it. My guess is that I am running wrong version of ecmascript and I need to use babel or adjust something in eslintrc.json to make this work with the mocha…
Jason Hocker
  • 6,879
  • 9
  • 46
  • 79
0
votes
1 answer

eslint error: 'Uint32Array' is not defined. no-undef

When using Uint32Array with TypeScript and eslint, I to this error. 34:43 error 'Uint32Array' is not defined no-undef How do I fix this? My eslintrc looks like this (YAML syntax used): env: browser: true jasmine: true jest:
Thorkil Værge
  • 2,727
  • 5
  • 32
  • 48
0
votes
1 answer

Error: .eslintrc.js: Configuration for rule "no-empty-interface" is invalid:

Trying to add a rule that says it's okay to have an empty interface such as below. Please note I am trying to add this to the eslintrc.js file - is this correct? interface RoutesProps {}
Ry2254
  • 859
  • 1
  • 10
  • 19
0
votes
0 answers

How to restrict imports from sibling directories using an eslint rule?

I have a mono repo style codebase where I build several separate applications that have a shared codebase. I want an eslint rule that errors if one app tries to import from another app. My file structure looks like this: /src/App1 /src/App2 …
Benjamin
  • 3,428
  • 1
  • 15
  • 25
0
votes
1 answer

enabling eslint-react-hooks turns off all eslint rules

I am trying to get react-hooks rules for eslint, but it doesn't seem to be working with my setup (VSCode, CRA, airbnb, tslint, prettier). Here's my .eslintrc.json before it breaks: { "env": { "browser": true, "es6": true, "jest":…
benard-kong
  • 1,733
  • 2
  • 8
  • 15
0
votes
1 answer

eslintrc file | nodejs

i am trying to import modules inside nodejs routes file using the "node-module-alias". My code structure is as follows, . ├── src ├──utils ├── logger when i try to commit the code, eslint fails with below error message. 2:30 error …
Shivathanu GC
  • 43
  • 1
  • 6
0
votes
1 answer

How to enforce in JavaScript using eslint not to use myStr = myStr + 'Some string'

How to enforce in JavaScript using ESLint not to use myStr = myStr + 'Some string' and use myStr += 'Some string'.
0
votes
1 answer

Configure eslint with coffeescript eslintrc

I am trying to configure eslint with a coffeescript file with the following code. But so far the configuration is not being read correctly. # .eslintrc.js require('coffeescript/register') require('./.eslintrc.coffee') # .eslintrc.coffee config = …
ateam
  • 137
  • 1
  • 11
0
votes
1 answer

Use the latest vue-eslint-parser - encore

I was able to set up ESLint working with Encore (Symfony). My .eslintrc.js file has the following configuration: module.exports = { "parser": "vue-eslint-parser", "parserOptions": { "parser": "babel-eslint", "ecmaFeatures":…
0
votes
0 answers

no-use-before-define wrongly catches use of the global window variable

Working in electron vue-cli project. Trying to upgrade eslint but the default setup has no-use-before-define enabled. This causes it to catch every use of things like window.process.env.username as an error. I tried setting my rules as…
Trevor
  • 2,792
  • 1
  • 30
  • 43