tkqubo / codeclimate-tslint

Code Climate TSLint-Engine
40 stars 20 forks source link

TSLint does not seem executed in the correct directory #46

Open victornoel opened 6 years ago

victornoel commented 6 years ago

I have the following directory structure:

I configured the plugin with config: frontend/tslint.json and because my configuration contains:

{
  "extends": [
    "./tslint-ng.json",
    "tslint-config-prettier"
  ],
  ...
}

I get the following error when executing the analysis:

Running tslint: Done!
error: (CC::CLI::Analyze::EngineFailure) engine tslint failed with status 1 and stderr 
/usr/src/app/node_modules/tslint/lib/configuration.js:55
        throw new error_1.FatalError("Failed to load " + configPath + ": " + error.message, error);
        ^

FatalError: Failed to load /tmp/codeclimate-tslint/9ddea5fbe123e05b4a94f1fd95a13b767785a76dd11b5242cac373a8bedca685.json: Invalid "extends" configuration value - could not require "./tslint-ng.json". Review the Node lookup algorithm (https://nodejs.org/api/modules.html#modules_all_together) for the approximate method TSLint uses to find the referenced configuration file.
    at FatalError.Error (native)
    at new FatalError (/usr/src/app/node_modules/tslint/lib/error.js:27:28)
    at Object.findConfiguration (/usr/src/app/node_modules/tslint/lib/configuration.js:55:15)
    at new TsLinter (/usr/src/app/dist/tsLinter.js:33:57)
    at Object.<anonymous> (/usr/src/app/dist/index.js:26:18)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)
larkinscott commented 6 years ago

Hey @tkqubo! Stumbled across this issue because I was also investigating it. I was able to replicate a similar issue on a few open source projects:

https://github.com/ReactiveX/rxjs https://github.com/angular/material2

/usr/src/app/node_modules/tslint/lib/configuration.js:55
        throw new error_1.FatalError("Failed to load " + configPath + ": " + error.message, error);
        ^
jakeleboeuf commented 6 years ago

Me too! Need any help fixing this?

cice commented 6 years ago

having the same problem here...

cice commented 6 years ago

any updates on this? any workarounds? at the moment we are not able to use tslint in codeclimate at all...

PhilippMeissner commented 6 years ago

Bump. Would be nice to get some sort of feedback on this one.

arboleya commented 6 years ago

There seems to be a bunch of issues connected to this problem, such as: https://github.com/tkqubo/codeclimate-tslint/issues/51

mltsy commented 5 years ago

Does anybody have any idea why this is happening? I'm having the same problem trying to use "rulesDirectory": ["codelyzer"]:

FatalError: Failed to load /tmp/codeclimate-tslint/05f2da994f0ff2d0b33365fad2d0b1298e0e03b0f232cb890ff97b4ecc48f69b.json: Could not find custom rule directory: /code/codelyzer
    at new FatalError (/usr/src/app/node_modules/tslint/lib/error.js:27:28)
    at Object.findConfiguration (/usr/src/app/node_modules/tslint/lib/configuration.js:57:15)
    ...

Is this an issue with this plugin, or an issue in CodeClimate's plugin system?