Visual studio code 漂亮的错误格式化文档,然后快速更正
从上周一开始,我的漂亮的VSCode插件给我带来了奇怪的行为,这非常烦人,我找不到它的根本原因 一旦我点击CMD+S,我就有两种可能的结果:Visual studio code 漂亮的错误格式化文档,然后快速更正,visual-studio-code,eslint,prettier,Visual Studio Code,Eslint,Prettier,从上周一开始,我的漂亮的VSCode插件给我带来了奇怪的行为,这非常烦人,我找不到它的根本原因 一旦我点击CMD+S,我就有两种可能的结果: 文档会短暂地变为不需要的格式,并恢复正常 文档变成了不需要的格式,我必须再次点击CMD+S来更正它 下面是一个小的.gif来解释情况 我更漂亮的版本: package.json:“prettier”:“^1.19.1” vscode插件:3.8.0 My.eslintrc.json: { "extends": ["airbnb-base", "p
“prettier”:“^1.19.1”
vscode插件:3.8.0
My.eslintrc.json:
{
"extends": ["airbnb-base", "plugin:prettier/recommended", "plugin:react/recommended"],
"parser": "babel-eslint",
"rules": {
"semi": ["warn", "never"],
"import/no-extraneous-dependencies": [
"error",
{
"devDependencies": true
}
],
"quotes": ["warn", "single"],
"no-restricted-syntax": 0,
"no-await-in-loop": 0,
"object-curly-newline": 0,
"no-constant-condition": 2,
"react/jsx-filename-extension": [
1,
{
"extensions": [".js", ".jsx"]
}
],
"react/state-in-constructor": [2, "never"],
"no-mixed-operators": 0,
"react/forbid-prop-types": 0,
"react/no-unused-prop-types": 2,
"jsx-a11y/media-has-caption": 0,
"no-console": ["error", { "allow": ["warn", "error"] }],
"no-underscore-dangle": 0,
"no-global-assign": 0,
"prefer-const": [
"error",
{
"destructuring": "any",
"ignoreReadBeforeAssign": false
}
],
"import/prefer-default-export": 0,
"import/no-named-as-default": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/click-events-have-key-events": 0,
"max-lines": [
"error",
{
"max": 500,
"skipBlankLines": true,
"skipComments": true
}
],
"max-len": [
"error",
100,
{
"ignoreComments": true,
"ignoreTemplateLiterals": true,
"ignoreStrings": true
}
],
"curly": 0,
"consistent-return": 0,
"arrow-parens": 0,
"react/no-array-index-key": 0,
"no-return-assign": 0,
"comma-dangle": 0,
"jsx-a11y/href-no-hash": "off",
"jsx-a11y/anchor-is-valid": 0,
"no-multi-str": 0,
"newline-before-return": 2,
"newline-after-var": 2,
"newline-per-chained-call": 2,
"import/newline-after-import": 2,
"react/jsx-props-no-spreading": 0,
"react/require-default-props": 0
},
"plugins": ["prettier"]
}