vetur icon indicating copy to clipboard operation
vetur copied to clipboard

VTI type checking doesn't match Vetur

Open rchl opened this issue 4 years ago • 3 comments

  • [x] I have searched through existing issues
  • [x] I have read through docs
  • [x] I have read FAQ
  • [ ] I have tried restarting VS Code or running Vetur: Restart VLS

Info

  • Platform: macOS
  • Vetur version: VTI 0.1.5
  • VS Code version: -

Problem

VTI has problems with type checking files that Vetur doesn't have issue with.

Reproducible Case

  1. Clone https://github.com/rchl/lsp-log-parser
  2. Run yarn to install dependencies
  3. Run vti diagnostics ./pages/

Getting diagnostics like:

File : /Users/rafal/workspace/lsp/lsp-log-parser/pages/index.vue:1:1
Error: Cannot find name '__vlsComponentData'.
> 1 | <template>
    | ^
  2 |   <v-app>
  3 |     <app-bar />
  4 |     <app-drawer />

whereas Vetur doesn't have any issue with type checking that file itself.

Here is the full configuration that my client is sending for Vetur:

{
  "settings": {
    "css": {
      "completion": {
        "completePropertyWithSemicolon": true,
        "triggerPropertyValueCompletion": true
      },
      "customData": [],
      "lint": {
        "argumentsInColorFunction": "error",
        "boxModel": "ignore",
        "compatibleVendorPrefixes": "ignore",
        "duplicateProperties": "ignore",
        "emptyRules": "warning",
        "float": "ignore",
        "fontFaceProperties": "warning",
        "hexColorLength": "error",
        "idSelector": "ignore",
        "ieHack": "ignore",
        "importStatement": "ignore",
        "important": "ignore",
        "propertyIgnoredDueToDisplay": "warning",
        "universalSelector": "ignore",
        "unknownAtRules": "warning",
        "unknownProperties": "warning",
        "unknownVendorSpecificProperties": "ignore",
        "validProperties": [],
        "vendorPrefix": "warning",
        "zeroUnits": "ignore"
      },
      "validate": true
    },
    "emmet": {},
    "html": {
      "suggest": {}
    },
    "javascript": {
      "format": {}
    },
    "stylusSupremacy": {},
    "typescript": {
      "format": {}
    },
    "vetur": {
      "completion": {
        "autoImport": true,
        "scaffoldSnippetSources": {
          "user": "🗒️",
          "vetur": "✌",
          "workspace": "💼"
        },
        "tagCasing": "kebab"
      },
      "experimental": {
        "templateInterpolationService": true
      },
      "format": {
        "defaultFormatter": {
          "css": "prettier",
          "html": "none",
          "js": "none",
          "less": "prettier",
          "postcss": "prettier",
          "pug": "prettier",
          "sass": "sass-formatter",
          "scss": "none",
          "stylus": "stylus-supremacy",
          "ts": "none"
        },
        "defaultFormatterOptions": {},
        "enable": true,
        "options": {
          "tabSize": 2,
          "useTabs": false
        },
        "scriptInitialIndent": false,
        "styleInitialIndent": false
      },
      "ignoreProjectWarning": false,
      "languageFeatures": {
        "codeActions": true,
        "updateImportOnFileMove": true
      },
      "useWorkspaceDependencies": true,
      "validation": {
        "interpolation": true,
        "script": true,
        "style": false,
        "template": false,
        "templateProps": true
      }
    }
  }
}

I understand that VTI doesn't receive the same options but I still don't see why would it report such serious issues with those Vue files.

rchl avatar Nov 27 '21 14:11 rchl

@rchl I have the exact issue. Did you manage to resolve it or is it still an open case for you?

jmosawy avatar Nov 29 '21 16:11 jmosawy

@rchl I managed to resolve the issue. Take a look at this page: https://vuejs.github.io/vetur/reference/#vetur-config-js By placing a vetur.config.js file in my project's root, seems like the issue was resolved.

jmosawy avatar Dec 07 '21 12:12 jmosawy

It doesn't fix it here. Are you able to make it work with the repo I've provided?

In any case, it would still be a bug IMO, even if it worked, because I don't see why an explicit configuration should need to exist.

rchl avatar Dec 07 '21 12:12 rchl