Questions tagged [eslint-config-airbnb]

Use this tag for the NPM package that provides Airbnb's .eslintrc as an extensible shared config

Relevant links

https://www.npmjs.com/package/eslint-config-airbnb

https://github.com/airbnb/javascript

https://eslint.org/docs/rules/

288 questions
0
votes
0 answers

Getting error for TSLint in response of ng lint even after migrating from TSLint to ESLint and uninstalling the TSLint as well

I have just migrated from TSLint to ESLint and uninstalled the TSLint. But after running the ng lint command in terminal, the error displayed is - Ensure TSLint is installed. Following is a snippet of few lines I get after running the command ng…
0
votes
0 answers

Eslint runtime react/function-component-definition error React 18

I’m getting the following error message on screen while run npm run start command. Compiled with errors - [eslint] Function component is not a function declaration, react/function-component-definition I am using eslint, configured with airbnb, also…
0
votes
0 answers

eslint airbnb-base gives many errors due to use strict mode. What should I do?

I initialised eslint with airbnb-base using npx eslint --init. I use normal javascript. After npx eslint "file.js" command I get a lot of errors due to use strict mode. What should I do? module.exports = { env: { browser: true, es2021:…
Dunker
  • 1
  • 1
0
votes
0 answers

eslint Failed to load config "airbnb" to extend from. Referenced from: C:\Users\me\desktop\Workspace\project

My React Aplication doesnt load because of this error. It worked at first, but when i uploaded to github it did'nt anymore, I just start to work with React so i don't really know how to fix this or where to look This is my package.json file { …
0
votes
1 answer

ESLint not applying rules specified in .prettierrc.cjs

I have setup eslint to enforce airbnb rules alongside prettier for stylist rules. .eslintrc.cjs module.exports = { root: true, parser: '@typescript-eslint/parser', extends: [ 'airbnb-base', 'airbnb-typescript/base', …
0
votes
1 answer

eslint jsx-a11y label must be associated with a control error

The
0
votes
1 answer

Issue with eslint/ eslint-config-airbnb

I'm getting this error when I try to run my linter that extends the airbnb linter (es-config-airbnb). I don't have an import/no-cycle rule here, so I'm not sure what the problem is: Error: .eslintrc.js » eslint-config-airbnb » Configuration for…
0
votes
2 answers

Why airbnb style guide force eslint rule react/function-component-definition

I installed ESLint to a ReactJS project with Airbnb guide style. The ESLint rules end up showing me the below error when I am using an arrow function to implement the component Can someone please explain to me why the Airbnb style guide prefers the…
0
votes
1 answer

Eslint import/no-unresolved ignore pattern for files starting with #

If I put this to my .eslintrc.js file I expect it to ignore only imports starting with #, but instead it turns off the rule for everything. How can I turn off no-resolved only for files starting with #, as an example require('#testmodule'); rules:…
Badr Hari
  • 8,114
  • 18
  • 67
  • 100
0
votes
0 answers

eslint failed to load plugin 'import' declared in '.eslintrc.js » eslint-config-airbnb; cannot find module 'typescript/package.json'

I'm trying to set up eslint for a basic React project (Javascript only, no Typescript). When linting my project with npx eslint ./, I get the following error: ESLint: 8.31.0 Error: Failed to load plugin 'import' declared in '.eslintrc.js…
0
votes
1 answer

TSlint rules to ESlint after update angular to v14

after upgrading angular to v14 I also install ESlint. Until now, I use TSlint with some custom rules, config... here is my tslint.json (in root) { "extends": ["tslint-config-airbnb"], "rules": { "align": { "options": ["parameters",…
Arter
  • 2,224
  • 3
  • 29
  • 66
0
votes
0 answers

Export shareable eslint config from a React library's dist folder for other projects

I have a published React library with a dist folder where I export numerous default React components for other projects and I would like to export my eslint config from there. I've seen people do it in basic npm packages in the main index.js file,…
Claim
  • 775
  • 3
  • 12
  • 32
0
votes
0 answers

Why is eslint complaining about Record in my typescript file?

I'm a javascripter since many years that's now being subjected to an extremely bad eslint config. There are several things throwing me - for one, I can't use types from declaration files (i.e. a type defined in .d.ts) so I've had to move all types…
Cookie
  • 364
  • 1
  • 2
  • 12
0
votes
1 answer

Eslint Plugin "react"was conflicted between .eslintrc.json >> eslint-config-airbnb

When I start the app with yarn start I get below comment in terminal. I guess it's airbnb plug-in which makes some mess as when I comment it out in eslintrc.json the app compiles and I can work in it. Shall I remove airbnb plug-in or there is…
marcinb1986
  • 708
  • 1
  • 11
  • 30
0
votes
0 answers

How to resolve Eslint plugin ambiguity?

I have a eslint config which extends some others. Those packages depend on "@typescript/eslint-plugin" but they use different versions. extends: ['airbnb', 'airbnb-typescript', '@some-private-eslint-cfg'], This results in Eslint being unable to…
user2297996
  • 1,382
  • 3
  • 18
  • 28