【发布时间】:2019-12-19 11:33:51
【问题描述】:
我的 eslinting 规则如下
module.exports = {
env: {
es6: true,
node: true,
mocha: true
},
extends: [
"standard-with-typescript"
],
parser: '@typescript-eslint/parser',
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
project: "./tsconfig.json"
},
rules: {
"quotes": ["warn", "single"],
"indent": ["warn", "tab", { "ignoreComments": true }],
"no-tabs": 0,
"padded-blocks": 0,
"semi": 0,
"no-trailing-spaces": 0,
"spaced-comment": 0,
"no-multiple-empty-lines": 0,
"space-before-function-paren": 0,
"camelcase": 0,
"prefer-const": "warn",
"space-infix-ops": "warn",
"@typescript-eslint/strict-boolean-expressions": ["warn", {"allowNullable": true}]
},
plugins: [
'@typescript-eslint',
],
}
当我打开一个未正确格式化为选项卡的新文件时,我得到:
很公平,所以我使用 VScode 将缩进更改为制表符,现在我得到:
???
我已经配置了我的设置,以便所有扩展都从项目根目录中的一个 eslintrc 文件中读取...
【问题讨论】:
标签: typescript visual-studio-code eslint