简体   繁体   中英

Prettier eslint: use 'prettier' or 'plugin:prettier/recommended' with React Typescript airbnb eslint config

In my React Typescript project I updated prettier , eslint-plugin-prettier and eslint-config-prettier to latest version. I am also using eslint-config-airbnb-typescript .

I have below in the extend property inside eslintrc.js :

extends: [
    'airbnb',
    'airbnb-typescript',
    'airbnb/hooks',
    // "plugin:@typescript-eslint/recommended",
    // "plugin:@typescript-eslint/recommended-requiring-type-checking",
    // "plugin:eslint-comments/recommended",
    'plugin:react/recommended',
    'plugin:jest/recommended',
    // 'plugin:prettier/recommended', <- Should I add this?
    // 'prettier' <- or this?
  ],

I am confused after reading the changelog . Should I use prettier or plugin:prettier/recommended in the extend property inside eslintrc.js eslint config?

plugin:prettier 可以解决问题@meez。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM