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

Linting react typescript project

I am trying to lint my react project with typescript template. I want to use the airbnb style guide, but when the ran the comm npx eslint --init I only get the standard option and the xo option. Is there a reason for this?
Andrews
  • 43
  • 7
0
votes
1 answer

Naming private fields and conflicted member ordering with the Airbnb-Typescript-ESLint-Config

I have added eslint with Prettier and the Airbnb-TypeScript-Styleguide to my Angular-project and it says you shouldn't have any dangling underscores. How am I meant to name my private fields that are accessed through getters and…
0
votes
1 answer

Do I have to use and 'extend' eslint-plugin-react in eslintrc.js config while using and extending 'eslint-config-airbnb' already

I updated my Eslint rules using airbnb in my React typescript project. My project doesn't use 'create-reac-app'. So I have to extend airbnb since I am also using and extending airbnb-typescript. eslint-plugin-react and eslint-plugin-react-hooks are…
meez
  • 3,783
  • 5
  • 37
  • 91
0
votes
1 answer

How to properly fix React Hook useCallback has a missing dependency

I updated my Eslint rules using airbnb in my React typescript project. I get those errors now: React Hook useCallback has a missing dependency: 'setCookie'. Either include it or remove the dependency array.eslintreact-hooks/exhaustive-deps I have…
meez
  • 3,783
  • 5
  • 37
  • 91
0
votes
1 answer

How to fix Eslint error: 'default' is restricted from being used as an exported name in my React Typescript project

I am updating eslint rules in my React project. Currently I have this in the extend property inside eslintrc.js: extends: [ 'airbnb', 'airbnb-typescript', 'airbnb/hooks', // "plugin:@typescript-eslint/recommended", //…
meez
  • 3,783
  • 5
  • 37
  • 91
0
votes
1 answer

How to configure eslintrc and add React to eslint (with airbnb, typescript) without create react app

My project is not using create-react-app. I am upadting my Eslint. How do I add React properly to the eslintrc.js file? Currently I have this in the extend property: extends: [ 'airbnb', 'airbnb-typescript', 'airbnb/hooks', //…
meez
  • 3,783
  • 5
  • 37
  • 91
0
votes
1 answer

eslint --fix breaks code when no-duplicate-imports happens

for example, running npx eslint ./App.js --fix on a fresh react native app that went through the eslint init process will cause the code to format from: App.js: import { StyleSheet, View, TextInput, ImageBackground, Image, …
0
votes
2 answers

Why does the default react app file not run with eslint enabled?

I have globally installed eslint via cmd and its also installed as an extension in vs code. After that I used the following command in the vs code terminal to initialize it: npx eslint --init I used the Airbnb style guide option while setting it…
0
votes
1 answer

What is the purpose of eslint-plugin-prettier?

I have installed airbnb style guide in my eslint config. So for airbnb it is recommended to use single quotes for strings. But by adding plugin:prettier/recommended in extends it disables single quotes. So how do I make sure that the rule is…
Pratik Wadekar
  • 1,198
  • 8
  • 15
0
votes
1 answer

What is meaning of the 2 and never param in comma-dangle?

What is the usage of this ? "comma-dangle": [ 2, "never" ], What is 2 and never here?
0
votes
1 answer

I use filter return array get eslint error

I get eslint error and how to I fix it? const filter = state.playListSetData.filter(item => { // 若兩相符合,抓播放設定底下的其他資料 if (item.uuid === payload[i].playerList[j].uuid) { …
0
votes
2 answers

Proper way of Installing ESlint with Prettier in a React Project

I've recently started using eslint and prettier in my projects, but I'm always not sure if I'm installing them correctly. I've read several articles online and it seems each one does it differently. I'm trying to use the Airbnb configuration. I…
alti21
  • 127
  • 2
  • 11
0
votes
2 answers

Object Destructuring eslint throws react/prop-types

export const Top = (props) => { return (

Jens
  • 17
  • 1
  • 4
0
votes
1 answer

How pass an object to a child custom React functional component with Typescript

and thanks for the time taken for reading this. I'm trying to learn Typescript with react using eslint with the AirBnB config. Something as simple as mapping an array of objects and creating a custom functional component with each is giving me the…
CodeAlga
  • 123
  • 1
  • 2
  • 8
0
votes
1 answer

Why does Prettier claim the `;` before destructuring assignment?

I have if block in my Angular component: if (desc.length > 0) { [this.errorMsg] = desc } However, Prettier doesn't like it and recommends to put ; at the beginning of the destructuring assignment: if (desc.length > 0) { ;[this.errorMsg] =…
Denis Sologub
  • 7,277
  • 11
  • 56
  • 123