Skip to main content

eslint- prettier conflict

冲突

alt text

解决

module.exports = {
env: {
browser: false,
es2021: true,
mocha: true,
node: true,
},
plugins: ["@typescript-eslint"],
extends: ["standard", "plugin:prettier/recommended", "plugin:node/recommended"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: 12,
},
rules: {
"node/no-unsupported-features/es-syntax": ["error", { ignores: ["modules"] }],
"single-quote": "off",
},
// here is solve the conflict
// @link https://github.com/prettier/eslint-plugin-prettier#options
{
"prettier/prettier": [
"error",
{},
{
"usePrettierrc": false
}
]
}
};

alt text