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:
…
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…
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 = {
…
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:…
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:…
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…
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 -=…
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:…
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…
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 =…
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…
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…