Skip to content
Advertisement

Tag: prettier

Prettier adding semicolon when semi: false

I have a react component with this jsx When I save the file prettier automatically adds a semicolon infront of <Post … />. This is causing the component to fail to render. I have the semi option set to false. Answer This is happening because currently your map function is not returning anything <Post key={post.id} post={post} /> needs to be

Is eslint pre-commit hook in CRA bootstrapped application required?

My react application is bootstrapped using CRA(react-scripts v4.0.0) and I want to add a code formatter (prettier to be specific) that must format the code before committing the changes to my git repo. I know that eslint is a dependency of react-scripts and linting is done using ‘eslint-webpack-plugin'(default enabled) inside the webpack configuration. Snippet from CRA github | React Scripts

Prevent Prettier formating arrow functions to multiple lines

When I write arrow functions in Vue.js using vscode i get an unexpected formating. I wish to change the settings for Prettier when auto formating arrow functions in vscode. Expected: Acceptable: Actual: Answer I did some research and found this feature has already been requested: https://github.com/prettier/prettier/issues/4125 Changes to prettier were made (https://github.com/prettier/prettier/pull/6685) and released in prettier 2.0 back in 2020.

How to disable eslint(prettier/prettier) single quotes error

I have react-native code. I install ESLint. I use it but its show error. While I use single quotes it show me error Replace ‘react-native’ with “react-native” eslint(prettier/prettier) And when I use double qoutes it show me another error String must use singlequote. eslint(quotes) here is the screenshot: What i want is, how to remove error messages about using single

Advertisement