-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Working with tslint-loader #15
Comments
Sorry for the late response. Is this still a problem? Maybe we could implement an option for specifying excluded modules names that should not be resolved with tsconfig-paths |
As far as I know, this is still a problem. A workaround I have used is setting |
In my opinion, this implementation is more correct and also solves the problem above Module._resolveFilename = function(request: string, _parent: any): string {
try {
// tslint:disable-next-line:no-invalid-this
return originalResolveFilename.apply(this, arguments);
} catch (err) {
const found = matchPath(request);
if (found) {
const modifiedArguments = [found, ...[].slice.call(arguments, 1)]; // Passes all arguments. Even those that is not specified above.
// tslint:disable-next-line:no-invalid-this
return originalResolveFilename.apply(this, modifiedArguments);
}
throw err;
}
}; |
Just to clarify let me see if I understand how to re-create the problem:
Is that correct? Also, iIf someone would like to provide a repo which reproduces the problem that would also save us some time to try and re-create it. |
I recreated the problem in the sandbox. You need to download the project and run |
I think my solution will not cause performance problems. It may be worth checking the type of error. For example: try {
// tslint:disable-next-line:no-invalid-this
return originalResolveFilename.apply(this, arguments);
} catch (err) {
if (err.code === 'MODULE_NOT_FOUND') {
const found = matchPath(request);
if (found) {
const modifiedArguments = [found, ...[].slice.call(arguments, 1)]; // Passes all arguments. Even those that is not specified above.
// tslint:disable-next-line:no-invalid-this
return originalResolveFilename.apply(this, modifiedArguments);
}
}
throw err;
} |
what about adding an option disabled by default to enabled this behavior ? |
Hello, since I'm using tslint-loader I have issue with tsconfig-paths.
My problem is that tslint-loader try to load tslint using
var Lint = require('tslint');
https://github.com/wbuchwalter/tslint-loader/blob/4d166651d916a0c43dd5a11099d6ff532350e27b/index.js#L8
but same file exists in my project so while tslint-loader try to load tslint from node_modules then it's receiving tslint from my project.
Would somebody help me please?
The text was updated successfully, but these errors were encountered: