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

ESLint configuration error at WebStorm (React project)

I have an issue while connecting ESLint airbnb configuration to my React App. I have already tried to remove package-lock.json, node_modules and run a command npm install WebStorm says ESLint: Error: .eslintrc.json >> eslint-config-airbnb-base >>…
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

ESLint Question: Standard guide, or a popular style guide

As a beginner should I be using a standard guide, a popular style guide or should I be working on creating my own file based on my own preferences?
0
votes
0 answers

Why ESLint is complaining about props validation in my React and Typescript project

I use Typescript to define and type my props. I am using ESLint and eslint-config-airbnb-typescript. I use gatsby-plugin-graphql-codegen to generate the types for my graphQL queries. ESLint is complaining about props validation. This is the…
meez
  • 3,783
  • 5
  • 37
  • 91
0
votes
1 answer

Configure parserOptions or parser package for ESLint and Airbnb typescript setup

In my Gatsby (React) project I am using typescript. I need to setup ESLint and have to use eslint-config-airbnb-typescript I am also using Prettier: prettier (comes with Gatsby), and I installed the following packages: npm install…
0
votes
2 answers

"Objects are not valid as a React child" and linters

I have an issue about a simple component and I don't know why. Here is my error and my code : Error: Objects are not valid as a React child (found: object with keys {Cfor, children}). If you meant to render a collection of children, use an array…
0
votes
2 answers

[TYPESCRIPT]: react/require-default-props does not work correctly with my .eslintrc configuration

I'm setting the default props in typescript in this way type Props = { message?: string, disableElevation?: boolean, }; const BoxError = ({ message = 'Oops! Something went wrong!', disableElevation = false }: Props) => { return ( …
Webman
  • 1,534
  • 3
  • 26
  • 48
0
votes
1 answer

How to fix eslint error no-use-before-define

I am using Airbnb's style guide and have a couple of functions that reference each other this error is triggered no matter which function is above the other. Is there a best practice on how to fix this error besides just disable it? function foo()…
Dan Neal
  • 51
  • 6
0
votes
1 answer

Why am i getting ESLint - Component should be written as a pure function?

I am getting this eslint error, only for the app component "Component should be written as a pure function" and i am not sure why. I checked other posts with this error and none of the solution seem to work. import React from "react"; import {…
Adrian Sultu
  • 330
  • 5
  • 16
0
votes
2 answers

Must use destructuring props assignment in className

I've applied ESLint Airbnb standard to my code like:
0
votes
1 answer

ESLint/Prettier/Airbnb : Do I set them up again for each project?

I have just finished setting up Eslint/prettier/airbnb by watching an online tutorial but what I don't understand is that when I start a new project, will I need to repeat the same processes* again? I wish there was a way to integrate it to VSCode…
B_12
  • 143
  • 1
  • 9
0
votes
1 answer

How to load static image in react native without require?

I want to load image from my assets folder. I don't want to use require because it violates my eslint rules (I follow airbnb rules). I use typescript. Do you have any best practices for this?
Che Huu
  • 163
  • 10
0
votes
1 answer

Why does "eslint --print-config blah.js > outfile.json" result in invalid configuration rules?

Following this guide, I have tried to create an extracted rule set except I am extending from eslint-config-airbnb-typescript-prettier instead of eslint-config-airbnb-typescript: - module.exports = { extends: "airbnb-typescript-prettier" } When I…
U4EA
  • 832
  • 1
  • 12
  • 27
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

eslint max-line-per-function disable for object-shorthand

const mailParams = ({ ToAddresses, CcAddresses, subject, sourceEmail, mailTemplate }) => ({ Destination: { ToAddresses, CcAddresses }, Message: { Body: { Html: { Charset: 'UTF-8', Data: mailTemplate …
zabusa
  • 2,520
  • 21
  • 25