vs код удаляет пробел из общего вызова RestService.get <SomeModel> - PullRequest
0 голосов
/ 16 февраля 2019

В файлах VS Code .vue щелкните правой кнопкой мыши и выберите формат документов, удаляя пробелы из моих общих вызовов.Например, RestService.get () для RestService.get ().Когда я запускаю npm, запускаю dev, я получаю сообщение об ошибке с просьбой добавить пробелы.Я использую TypeScript в своих файлах .vue.

Спасибо,

Ниже приведены мои настройки:

.eslintrc.js

module.exports = {
  root: true,
  parser: 'babel-eslint',
  parserOptions: {
    sourceType: 'module'
  },
  extends: 'standard',
  // required to lint *.vue files
  plugins: [
    'html'
  ],
  rules: {
    "space-before-function-paren": ["error", {
      "anonymous": "never",
      "named": "never",
      "asyncArrow": "never"
    }]
  }
}

VS Codeфайл настроек:

{
  "files.exclude": {
    "**/node_modules": true,
    "**/dist": true
  },
  "editor.formatOnPaste": false,
  "editor.formatOnSave": false,
  "typescript.tsdk": "node_modules\\typescript\\lib",
  "javascript.format.insertSpaceBeforeFunctionParenthesis": false,
  "typescript.format.insertSpaceBeforeFunctionParenthesis": false,
  "vetur.format.defaultFormatterOptions": {
    "prettier": {
      // Prettier option here
      "semi": false,
      "singleQuote": true, // Prefer sigle quotes over double quotes
    }
  }
}

package.json

"babel-core": "^6.26.0",
    "babel-eslint": "^7.2.3",
    "babel-loader": "^7.1.2",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-2": "^6.24.1",
"eslint": "^4.5.0",
    "eslint-config-standard": "^10.2.1",
    "eslint-loader": "^1.9.0",
    "eslint-plugin-html": "^3.2.0",
    "eslint-plugin-import": "^2.7.0",
    "eslint-plugin-node": "^5.1.1",
    "eslint-plugin-promise": "^3.5.0",
    "eslint-plugin-standard": "^3.0.1",
    "eslint-plugin-vue": "^4.0.0",
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...