2016-10-09 30 views
0

我期望這與babel,es7的東西或其他。基本奧裏利亞項目有錯誤:預期;在app.js

這行代碼是顯示在Visual Studio

export class App { 
    configureRouter(config, router) { /// <== here is the error 
     this.router = router; 
     config.title = 'Aurelia'; 
     config.map([ 
      { route: ['', 'home'],  name: 'home',  moduleId: 'home/index' }, 
      { route: 'users',   name: 'users',  moduleId: 'users/index', nav: true }, 
      { route: 'users/:id/detail', name: 'userDetail', moduleId: 'users/detail' }, 
      { route: 'files/*path',  name: 'files',  moduleId: 'files/index', href:'#files', nav: true } 
     ]); 
    } 
} 

Expected ';'我創建了所有默認選項的項目,所以它使用babel.I認爲這句法是很常見的。這是我的config.js。

transpiler: "babel", 
    babelOptions: { 
    "optional": [ 
     "runtime", 
     "optimisation.modules.system", 
     "es7.decorators", 
     "es7.classProperties" 
    ] 
    }, 
+1

您ES6是正確的......大概VS問題 – weagle08

+0

當我進入這個運行,該錯誤通常上市前行發生井。所以如果你在50行之前有不好的語法,那麼以後可能只會出現50行,特別是當它使用大括號或分號時。 –

回答

0

如果您使用ReSharper,請嘗試在ReSharper中更改打字稿選項。 轉到ReSharper-> Options-> Code Editing-> TypeScript-> Inspections,然後設置TypeScript的所需版本。

enter image description here