Skip to content
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

TSLint does not seem executed in the correct directory #46

Open
victornoel opened this issue Feb 28, 2018 · 7 comments
Open

TSLint does not seem executed in the correct directory #46

victornoel opened this issue Feb 28, 2018 · 7 comments

Comments

@victornoel
Copy link

victornoel commented Feb 28, 2018

I have the following directory structure:

  • frontend/
    • tslint.json
    • src/
  • backend
    • ...

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
Copy link

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
Copy link

Me too! Need any help fixing this?

@cice
Copy link

cice commented May 8, 2018

having the same problem here...

@cice
Copy link

cice commented May 24, 2018

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

@PhilippMeissner
Copy link

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

@arboleya
Copy link

There seems to be a bunch of issues connected to this problem, such as:
#51

@mltsy
Copy link

mltsy commented May 31, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants