ESLint 使用 Prettier 产生冲突

问题描述

在我的设备上,我收到来自 prettier/prettier 包的错误。我怎么解决这个问题? PS,这是CRA模板。

.eslintconfig

{
    "plugins": ["jsx-a11y","prettier","import"],"extends": ["airbnb","react-app","react-app/jest","plugin:jsx-a11y/recommended"],"settings": {
        "import/extensions": [".js",".jsx",".ts",".tsx"],"import/resolver": {
            "node": {
                "extensions": [".js",".tsx"]
            }
        }
    },"rules": {
        "jsx-a11y/label-has-associated-control": "off","import/extensions": "off","react/prop-types": 0,"no-debugger": "warn","semi": 0,"react/jsx-filename-extension": [
            1,{
                "extensions": [".js",".tsx"]
            }
        ],"prettier/prettier": "error","react/react-in-jsx-scope": "off","no-unused-vars": [
            "warn",{
                "vars": "all","args": "after-used","ignoreRestSiblings": false
            }
        ],"import/prefer-default-export": "off","no-param-reassign": "off","react/jsx-props-no-spreading": "off","arrow-body-style": ["error","as-needed"],"import/no-extraneous-dependencies": "off","prefer-promise-reject-errors": "off","import/order": [
            2,{
                "groups": [
                    "builtin","external","internal","parent",[
                        "sibling","index"
                    ],"type"
                ],"newlines-between": "always"
            }
        ],"newline-before-return": 1,"no-console": 0
    }
}

.prettierrc

{
    "printWidth": 100,"tabWidth": 2,"semi": true,"singleQuote": true,"arrowParens": "avoid","trailingComma": "all","endOfLine": "auto"
}

package.json

"eslint-config-airbnb": "^18.2.1","eslint-config-prettier": "^8.1.0","eslint-plugin-import": "^2.23.4","eslint-plugin-jsx-a11y": "^6.4.1","eslint-plugin-prettier": "^3.3.1","local-cors-proxy": "^1.1.0","prettier": "^2.2.1","redux-devtools-extension": "^2.13.8","stylelint": "^13.11.0","stylelint-config-prettier": "^8.0.2","stylelint-config-recommended": "^3.0.0","stylelint-config-standard": "^20.0.0","stylelint-prettier": "^1.1.2",

我尝试将我的节点版本更新到最后一个,并降级到 v12。相同的结果

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...