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 error: Unexpected block statement surrounding arrow body

I am getting the following error Unexpected block statement surrounding arrow body when I run this code. scope.$watch(() => { return ngModel.$viewValue; }, val => { if (ngModel.$isEmpty(val) && ngModel.$dirty) { …
Nikhil
  • 544
  • 1
  • 6
  • 19
0
votes
0 answers

Warnings are shown in browser console even when the rule is turned off in .eslintrc

I am facing an issue which is similar to this one and since I don't have enough reputations I wasn't able to comment and this question was asked almost a year ago. And since CRA have frequent updates and its been a year I might have missed if the…
Ayesha Iftikhar
  • 1,028
  • 2
  • 11
  • 27
0
votes
2 answers

unable to run expo web app because of ESlint

I'm developing an app for web and mobile so I'm using expo where if I run the app for android it works fine but when I want to run for web using yarn run web it showing an error. Failed to compile. …
zulqarnain
  • 1,536
  • 4
  • 26
  • 44
0
votes
1 answer

What is the difference between `docker-compose run client yarn lint` vs `cd client && yarn lint`

Hopefully this can be answered in a generic sense without needing to know about more specifics of my docker setup. When I run docker-compose run client yarn lint the .eslintrc file in my client directory is not respected, even when explicitly passed…
evansjohnson
  • 452
  • 4
  • 14
0
votes
1 answer

Linting React+Typescript project with ESlint

I read in an article that the TypeScript core team explaining ESLint has a more performant architecture than TSLint. And on the other hand @typescript-eslint/parser makes a more convenient AST which works the best alongside…
Amir-Mousavi
  • 4,273
  • 12
  • 70
  • 123
0
votes
1 answer

How to get .eslintrc.js ignore all none js files

How to configure .eslintr.js to ignore all non-js files? I started a .eslintignore file with the rule !**/*.js but doesn't work.
drum
  • 5,416
  • 7
  • 57
  • 91
0
votes
1 answer

ESLint not finding files

I've been trying to lint my new project with ESLint without any luck. Previously, running yarn eslint --fix ., would lint all the files in my project, but now, it gives this error: No files matching the pattern "." were found.. Was there a breaking…
0
votes
1 answer

How to resolve ESLint error unable to resolve path to module 'react-native'

New to react native and trying to setup ESLint in my project. I am getting this specific error: Unable to resolve path to module 'react-native'. (import/no-unresolved) I searched on SO and found similar threads, but nothing seems to work. I tried…
user1669296
  • 425
  • 1
  • 6
  • 13
0
votes
1 answer

What does @nuxtjs mean in my eslintrc file?

I am new to Nuxt.js and trying to understand what is meant by the following line (@nuxtjs) in my .eslintrc.js file: extends: [ '@nuxtjs', <-------------------------- is this an alias? 'plugin:prettier/recommended' ],
redshift
  • 4,815
  • 13
  • 75
  • 138
0
votes
0 answers

Specifying different eslint config files on command line

How do you deal with using different config files for server-side (node.js) code and client-side code when linting with eslint? Do you specify differents arguments to eslint in your lint script in package.json? Do you have separate config files?
Daniel Kats
  • 5,141
  • 15
  • 65
  • 102
0
votes
0 answers

Is there ESlint rule that would right align keys and left align values of object?

I found a rule that does this: obj = { a : 1, longkey: 2, zxc : 3 } which kinda sucks as you really loose track which value belongs to which key if one of the keys are long enough... however if there was something like this... obj =…
Muhammad Umer
  • 17,263
  • 19
  • 97
  • 168
0
votes
1 answer

How to share ESlint settings across multiple SublimeText projects

I have tons of little projects that come and go and I don’t want to always have to create a .eslintrc file in my root dir or do any other special configuration to get my default lint settings to work. After a few hours of googling and getting…
MattS
  • 173
  • 1
  • 9
0
votes
0 answers

ESLint Variable is defined but never used (no-unsed-vars)

I've set up ESLint and testing it out for a couple of days and there's something that's been bugging me. I get error message that reads: 'Book' is defined but never used. (no-unused-vars) class Book extends REST { sayHi() { return `Hi! I am…
0
votes
1 answer

eslint Parse errors in imported module for images

I'm currently working with a React Project and I typically add images I use for components in this way: import CartImage from '../../images/icon_cart.png'; All is well and the image loads up properly in my app. Unfortunately the are some linting…
lem.mallari
  • 1,274
  • 12
  • 25
0
votes
0 answers

ESLint : Force to specify a rule to disable inline

While I have a pretty good .eslintrc file, I sometimes need to break some rule intentionally (could be as simple as a temporary console.log, or even one that's supposed to stay). However, I feel using the raw inline // eslint-disable-rule is a…
Kewin Dousse
  • 3,880
  • 2
  • 25
  • 46
1 2 3
31
32