microsoft / TypeScript-Sublime-Plugin

IO wrapper around TypeScript language services, allowing for easy consumption by editor plugins
Apache License 2.0
1.72k stars 235 forks source link

typescript sublime ionic 2 throwing errors in node_modules folder #533

Open phice opened 8 years ago

phice commented 8 years ago

I'm trying to start with ionic2 rc0, sublime text 3 and Microsoft/TypeScript-Sublime-Plugin: when I build the compiler goes well on the ionic side, so in the shell I can see that the app has been built. On the Sublime's output console I see a lot of these error outputs (this is an example):

node_modules/@angular/core/src/application_ref.d.ts [4 errors]
    (106, 67) Cannot find name 'Promise'.
    (122, 101) Cannot find name 'Promise'.
    (148, 67) Cannot find name 'Promise'.
    (150, 101) Cannot find name 'Promise'.

Your system information:

Cordova CLI: 6.3.1 Gulp version: CLI version 3.9.1 Gulp local:
Ionic Framework Version: 2.0.0-rc.0 Ionic CLI Version: 2.1.0 Ionic App Lib Version: 2.1.0-beta.1 ios-deploy version: 1.8.5 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v4.4.0 Xcode version: Xcode 8.0 Build version 8A218a

my tsconfig.json

{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es6"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "target": "es5"
  },
  "files" :[
    "node_modules/typescript/lib/lib.es6.d.ts"
  ],
  "exclude": [
      "node_modules"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }
}

my plugin config file

{
    "typescript_auto_format": false,
    "enable_typescript_language_service": true
}

and user settings

{
    "color_scheme": "Packages/JavaScriptNext - ES6 Syntax/Monokai Phoenix.tmTheme",
    "font_size": 11,
    "ignored_packages":
    [
        "Vintage"
    ],
    "typescript_auto_format": false
}

this is making impossible to work with the plugin turned on. any idea to let it work well?

zhengbli commented 8 years ago

Currently the TS version shipped with this plugin is 1.8, which doesn't recognize the --lib compiler options (a TS 2.0 feature). A new release is coming soon. In the meantime you can point the tsdk to a installed 2.0 TS by adding the following to your user settings:

"typescript_tsdk": "<path to your folder>/node_modules/typescript/lib"
phice commented 8 years ago

thanks for the fast reaction! Btw by doing that I still have the same problem, even after restarting sublime. I will wait for the new version then.

itajaja commented 7 years ago

same problem here, even after pointing to updated tsdk (-v 2.1.5)