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

fails to use tslint rules from sonarTS #48

Open
abenhamdine opened this issue Jun 6, 2018 · 3 comments
Open

fails to use tslint rules from sonarTS #48

abenhamdine opened this issue Jun 6, 2018 · 3 comments

Comments

@abenhamdine
Copy link

When I try to use CodeClimate on ts files with SonarTS tslint plugin, I encounter the following error :

/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/a550b73b242c7b7d3edc418468b8310b4f8de8536e008b0b6d93cb3c73e2a5c9.json: Invalid "extends" configuration value - could not require "tslint-sonarts". 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)

According to your support :

Dave Henton (Code Climate)

Jun 1, 12:03 PM EDT

Hey Arnaud,
Thanks for writing in, and sorry about the trouble with this. I believe what's happening here is related to us not installing a repo's node_modules when running our plugins. For other repos where I've seen this pop up:
when you run npm install locally to get a local node_modules directory containing the library (and then use our CLI to analyze your repo locally), you won't encounter this issue.
The catch with that is we haven't figured out a good way to install the node_modules that are specified in a project that doesn't break aspects of the limits we place on engines for security reasons, and so it's going to take a bit more work on our side to map that work out and get it moving.
Really sorry about the inconvenience with this in the meantime. I'd encourage you to reach out to the devs over at the Github repo for this engine. It looks like there are some dependencies they've included in the engine in order to support certain rules on Code Climate, so perhaps you could open a PR to get support for those modules you're using.
In the meantime, you should be able to disable those rules which rely on NPM modules, and then see a successful analysis.
Thanks,
Dave
Dave Henton, Support Specialist / Stay tuned to our Changelog for all the latest news: https://codeclimate.com/changelog and https://codeclimate.com/changelog.rss

Could you guys do something to solve that ?
Sonar linters are very powerful profesionnal analysis tools, it would be convenient to be able to run it with CodeClimate.

FWIW, I also opened an issue in SonarTS repo : SonarSource/SonarTS#653

@rafaelrinaldi
Copy link

I am running into the same issue.

@koladilip
Copy link

Same issue for me as well.

@k3nsei
Copy link

k3nsei commented Dec 15, 2018

Same here

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

4 participants