-
Notifications
You must be signed in to change notification settings - Fork 341
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
baseDir should be an absolute path #202
Comments
ESLint has no configuration property baseDir, but TypeScript has which provides the JS smartness in VS Code. Does this happen if you disable ESLint for the workspace? Which version of VS Code are you using? |
Hi, thanks for the reply! I just updated to 1.9.1 this morning, and the issue persists. I'm still getting to know VSCode, having switched from Sublime, but I don't believe I can disable ESLint for the workspace because I'm not opening a folder - just a file. However, I tried disabling the extension altogether. When I did that, the error went away. When I re-enabled the extension, it came back. I used to get errors and warnings, but now it is just 0 and 0. And, the "ESLint" on the right side in the status bar is greyed out. When I open the OUTPUT for ESLint I see: [Info - 9:57:31 AM] ESLint server is running. Also, it may be worth noting that this started happening days after I upgraded to v1.9.0 of VSCode. It worked well for a number of days, then stopped with the last two updates to ESLint. Let me know if I can provide any other logs or diagnostic information. Thanks, |
@stephen-hardy can you provide me a little more information about you setup:
And could you enable eslint tracing to get more information. To do so please set the user settings |
@stephen-hardy I think I know what is going on. How does the path of the file look like. Is it a UNC path or is the server directory mounted as a drive letter? |
In noder function getRelativePath(filepath, baseDir) {
let relativePath;
if (!path.isAbsolute(filepath)) {
filepath = path.resolve(filepath);
}
if (baseDir) {
if (!path.isAbsolute(baseDir)) {
throw new Error("baseDir should be an absolute path");
}
relativePath = path.relative(baseDir, filepath);
} else {
relativePath = filepath.replace(/^\//, "");
}
return relativePath;
} The change in ESLint that causes the problem is: } else if (!workspaceRoot) {
let dirname = path.dirname(file);
if (dirname) {
newOptions.cwd = dirname;
}
} |
Correct, the file does have a UNC path: \\microsoft.sharepoint.com@SSL\DavWWWRoot\teams... I'm currently on version 1.2.5, and a blank js file will cause the error. |
Thanks. What is wired is that |
Done! Using a mapped drive works, just in case anybody is looking for a workaround. But then, unfortunately, TypeScript breaks (I opened the issue referenced directly above). So, if you want TypeScript you can open the file directly (as of VSCode 1.9.1), or if you want ESLint you can map a drive. |
OK. The underlying problem is that @stephen-hardy what error do you get with TS on a mapped network drive. |
Best described here: microsoft/TypeScript#13997 |
Also, just wanted to confirm that this is fixed. Finally, TypeScript and ESLint working using the same method. :) Thanks for all your help! |
When opening a JavaScript file hosted on SharePoint, accessed on Windows via WebDav, I get the following error on load and every time I type:
"baseDir should be an absolute path"
I don't think I saw this before v1.2.4. Everything was working well, until a couple days ago. Is this a configuration issue?
The text was updated successfully, but these errors were encountered: