【发布时间】:2020-05-04 12:52:39
【问题描述】:
我的项目中有以下打字稿界面:
`
export default interface User {
avatar: string;
email: string;
name: string;
}
`
用 Prettier 格式化后,ESLint 一直告诉我代码末尾缺少分号,现在格式化如下:
`
export default interface User {
avatar: string;
cpf: string;
email: string;
name: string;
};;;;;;;;;;;
`
我可以永远保持格式化和保存,它仍然会在该行的末尾添加分号
我的项目中有以下 .eslintrc
`
module.exports = {
env: {
browser: true,
es6: true
},
extends: [
'plugin:react/recommended',
'standard'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 2018,
sourceType: 'module'
},
plugins: [
'react',
'@typescript-eslint'
],
rules: {
"semi": [2, "always"]
}
}
`
【问题讨论】:
标签: typescript eslint