prograhammer / vscode-tslint-vue

TSLint for Visual Studio Code and VueJS
Other
65 stars 6 forks source link

Ability to use tsconfig and src folder in different location #5

Open dkulchenko opened 6 years ago

dkulchenko commented 6 years ago
[Info  - 11:10:22] vscode-tslint: 'Path must be a string. Received undefined' while validating: /Users/daniilk/code/front/src/components/ForgotPassword.vue stacktrace: TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at getParsedTsConfig (/Users/daniilk/.vscode/extensions/prograhammer.tslint-vue-1.4.2/server/server.js:544:127)
    at createProgram (/Users/daniilk/.vscode/extensions/prograhammer.tslint-vue-1.4.2/server/server.js:458:20)
    at /Users/daniilk/.vscode/extensions/prograhammer.tslint-vue-1.4.2/server/server.js:420:31
    at Generator.next (<anonymous>)
    at fulfilled (/Users/daniilk/.vscode/extensions/prograhammer.tslint-vue-1.4.2/server/server.js:7:58)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:109:7)

There is a tsconfig.json file in the project (<workspace root>/code/front <- in here). vue files in question are at <workspace root>/code/front/src/components/*.vue.

prograhammer commented 6 years ago

Ah yeah, that's a flexibility problem. It wants your config at the workspace root and also wants src at [workspace root]/src. This is mentioned in the README. I'm looking to have v2.0.0 out in the next day or so (see this issue) so I'll take care of that then and close this issue then. Hang in there a bit more.

prograhammer commented 6 years ago

@dkulchenko If you want a quick hack for the meantime, search for your .vscode/extensions/prograhammer... folder and open up server/server.js. If in latest version (v1.4.2), modify the line #518 (it's inside the resolveNonTsModuleName function) and hard code in the path to your src/ folder. Then restart the editor.

prograhammer commented 6 years ago

@dkulchenko And look at line #532 to hardcode a different location for tsconfig.json. Sorry for the inconvenience. Flexibility coming in version 2. Stay tuned.

dkulchenko commented 6 years ago

That does the trick for now - thanks so much! Will wait eagerly for v2.