Issue This test.tsx: <Form> <Field name=’name’ validate={validateFunc}> {({ field, form }) => ( <FormControl isInvalid={form.errors.name && form.touched.name}> <FormLabel htmlFor=’name’>Default</FormLabel> <Input {…field} id=’name’ placeholder=’name’ /> <FormErrorMessage>{form.errors.name}</FormErrorMessage> </FormControl> )} </Field> yields Error: JSX props should not use functions react/jsx-no-bin I know why
Continue readingTag: eslint
[SOLVED] How to disable eslint rule semi?
Issue I have a TypeScript project linted with ESLint and typescript-eslint. Here’s the rules property in .eslintrc.json: "rules": { "semi": [ "error", "never" ], "@typescript-eslint/semi": ["error", "never"] } I have a tsx file, where the last line of the file
Continue reading[SOLVED] Resolve error: webpack with invalid interface loaded as resolver after Expo upgrade to SDK 45
Issue Since upgrading Expo SDK from 43 to 45, I am getting these ESLint errors in every file on the first import line. The project is able to run though. I’ve tried adding the eslint-import-resolver-typescript package, without luck. The error
Continue reading[SOLVED] How to convert a React.Component as a pure function?
Issue Eslint suggest me to use a pure fiction instead of a react component. I use eslint in airbnb config. error Component should be written as a pure function react/prefer-stateless-function class App extends Component { render() { return ( <Router>
Continue reading[SOLVED] Why eslint consider JSX or some react @types undefined, since upgrade typescript-eslint/parser to version 4.0.0
Issue The context is pretty big project built with ReactJs, based on eslint rules, with this eslint configuration const DONT_WARN_CI = process.env.NODE_ENV === ‘production’ ? 0 : 1 module.exports = { extends: [ ‘eslint:recommended’, ‘plugin:jsx-a11y/recommended’, ‘plugin:react/recommended’, ‘prettier’, ‘prettier/@typescript-eslint’ ], plugins:
Continue reading[SOLVED] 'Button' cannot be used as a JSX component
Issue These ESLint errors happen with components imported from React Native Paper imports since Expo upgrade from SDK 43 to 45. The project is able to run though. import { Button } from ‘react-native-paper’; There seem to be no ESLint
Continue reading[SOLVED] Eslint with airbnb does not load when using .eslint.json
Issue I’m trying to setup linting for a node project. I wish to use the airbnb style guide. These are my dev dependencies in package.json: "devDependencies": { "eslint": "^8.2.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-plugin-import": "^2.25.2" } This is my .eslintrc.json file: {
Continue reading[SOLVED] How to disable eslint rule max line length for paragraph in <template> of vue.js?
Issue I am using airbnb eslint and currently I am getting error: error: Line 6 exceeds the maximum line length of 100 (max-len) at path/to/file.vue:6:1: <template lang=”pug”> div .container .row .col-xl-10.mx-auto p Please let us know how you got here,
Continue reading[SOLVED] ESLint with React gives `no-unused-vars` errors
Issue I’ve setup eslint & eslint-plugin-react. When I run ESLint, the linter returns no-unused-vars errors for each React component. I’m assuming it’s not recognizing that I’m using JSX or React syntax. Any ideas? Example: app.js import React, { Component }
Continue reading[SOLVED] VSCode prettier adds `value` to imports in TypeScript React
Issue After configuring prettier with the plugin in VSCode the format on save function adds weird value keywords to every non-default import in my React+TS code. Like this: import { value ApolloProvider } from ‘@apollo/client’; import { value BrowserRouter as
Continue reading