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

Click through nav handler eslint errors

I have a sliding-menu component. It has items and I want to hide the menu when I click on each item. But if i click on Now I did so:
platypussss
  • 159
  • 8
1
vote
2 answers

How to use eslint rule for no-multi-comp

I came across this style guide and trying to adopt some of its rules. The first rule mentioned about Only include one React component per file. However, multiple Stateless, or Pure, Components are allowed per file. eslint: …
Kim Stacks
  • 10,202
  • 35
  • 151
  • 282
1
vote
1 answer

Eslint is throwing `no-undef` while destructuring in a for..of loop

I am using eslint and a little bit of customized airbnb standard. My eslintrc file, module.exports = { extends: 'airbnb-base', rules: { 'no-restricted-syntax': 'off', // allow for..of loop }, }; This is a sample loop which have…
Md. Abu Taher
  • 17,395
  • 5
  • 49
  • 73
1
vote
1 answer

React Navigation | [eslint] Parsing error: Unexpected token = | React-Native

I'm having a linting issue with the Air Bnb eslint ruleset, this is my code: import React, { Component } from 'react'; import { StyleSheet, Text, View, } from 'react-native'; class HomePage extends Component { static navigationOptions = { …
1
vote
0 answers

Use .eslintrc from /home with eslint installed globally in VScode

It is possible to use a .eslintrc for all projets that I open in VScode with eslint installed globally ? I would like to use my .eslintrc in my home, when I open a project an eslint error appear in VScode console. Failed to load plugin prettier:…
Safi Nettah
  • 1,160
  • 9
  • 15
1
vote
2 answers

How to resolve warning with ESlint: Disallow Assignment in return Statement (no-return-assign)?

I'm using the following package in my React application to generate a Recaptcha component: https://github.com/appleboy/react-recaptcha Here is what the component looks like, with the eslint warning: this.recaptchaRef is defined like so:…
1
vote
2 answers

Is there a clean way to infinitely use async functions?

According to ESLint some code like this is not 'clean code' for(;;) { await *async function* } My aim is to infinitely loop a certain function, executing it one by one, without eventually crashing my app because of call stack limits. I have…
timgfx
  • 199
  • 2
  • 14
1
vote
1 answer

ESLint error: Unexpected assignment within a 'while' statement

I have a function that formats currency: export const formatDollar = (dollar) => { const format = function moneyFormat(val, sign = '$ ') { const pieces = parseFloat(val).toFixed(2).split(''); let ii = pieces.length - 3; while ((ii -=…
1
vote
2 answers

Ignoring eslint error for moment.js

I am adding moment.js in my react app as an external resource like this: When I use moment in my code file where eslint is enabled…
sahil solanki
  • 507
  • 6
  • 20
1
vote
1 answer

Error keeps popping up: Configuration for rule "react/jsx-uses-react" is invalid

When I save any js file in Sublime text 3 the error pasted below keeps popping up. I have tried a reinstall of eslint, eslint-plugin-import, eslint-config-airbnb, eslint-plugin-react, but no results. any ideas? error: Error:…
Zumo
  • 510
  • 3
  • 12
1
vote
1 answer

Is the eslint rule react/no-unescaped-entities necessary for React Native?

We are using the Airbnb code style guide with eslint in our React Native app. Since React Native does not use HTML, is the rule react/no-unescaped-entities necessary? The rule is forcing me to use: {`"${this.state.quote}"`} instead…
Phil Mok
  • 3,860
  • 6
  • 24
  • 36
1
vote
2 answers

Proper way of defining functions in ES6?

I'm just wondering how to write ES6 functions properly. I know that it depends on personal preference but what are the pros and cons? function foo() { ... } vs. const foo = () => { ... }; vs. const foo = function () { ... }; vs. const foo =…
1
vote
1 answer

eslint error "data is missing in props validation" in apollo react app

Not sure I understand what this eslint error is asking me to do. I'm using the apollo client demo code and it doesn't seem to like "data" in function PostList({ data: { loading, posts } }) { Should I be doing something else to follow the airbnb…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
0
votes
1 answer

Error: Plugin "@typescript-eslint" was conflicted between ".eslintrc.js » plugin:@typescript-eslint/recommended-type-check

Error: Plugin "@typescript-eslint" was conflicted between ".eslintrc.js » plugin:@typescript-eslint/recommended-type-checked » ./configs/base" and ".eslintrc.js » @vue/eslint-config-typescript/recommended » plugin:@typescript-eslint/recommended »…
laterday
  • 353
  • 1
  • 4
  • 11
0
votes
1 answer

Getting error 404 while installing ESLint in Node JS

I'm trying to install ESLint and configuring it for a NodeJS project. When running npm init @eslint/config from command line, the following error appears: PS C:\notes-app-backend> npm init @eslint/config Need to install the following…