tkqubo / codeclimate-tslint

Code Climate TSLint-Engine
40 stars 20 forks source link

Could not find custom rule directory (codelyzer) #67

Open efueger opened 5 years ago

efueger commented 5 years ago

Hi @tkqubo! Thanks for the request to bump the plugin -- we updated that on June 19.

I'm working with a user who's running into the "Could not find custom rule directory" when using Codelyzer. There have been a couple of other issues related to this:

Troubleshooting with an oss repo, I'm seeing:

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

FatalError: Failed to load /tmp/codeclimate-tslint/322be5549801493ac98a0cf91b90a10adf8628140a83a36d8272795ac3f5be9d.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)
    at new TsLinter (/usr/src/app/dist/tsLinter.js:35:57)
    at Object.<anonymous> (/usr/src/app/dist/index.js:15:18)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:690:17)

Do you have any ideas of how to troubleshoot this further? Typically, these dependencies work when packaged with the plugin, and codelyzer already is. 🤔 I'm not as familiar with Codelyzer and how it interacts with TSLint, so I'd love to see if you can help on that side.

Thanks 👍

efueger commented 5 years ago

@tkqubo 👋 Checking to see if you have any ideas on this. Thanks!

efueger commented 5 years ago

@tkqubo - any info I can help with from this side?

efueger commented 5 years ago

Hi @tkqubo -

If you're interested, we can transfer this repository to our codeclimate-community organization, with you as a maintainer, so we can share the maintenance load. Just let us know.

Thanks, Emily

PS: If you hit any permission errors, you might need to give me admin permissions for this repo and then I'll be able to transfer it. 👌

mltsy commented 5 years ago

Aha! So, it turns out all I had to do to fix this was change "rulesDirectory": ["codelyzer"] to "rulesDirectory": ["node_modules/codelyzer"]! I don't know if the version update of this plugin helped as well, perhaps (this other issue had that exact syntax and was not working at the time: https://github.com/tkqubo/codeclimate-tslint/issues/26). But in any case, that worked for me 😄

Sampath-Lokuge commented 4 years ago

This works for me:

npm i codelyzer

 "rulesDirectory": [
    "node_modules/codelyzer"
  ],
andreisas06 commented 2 years ago

This works for me:

npm i codelyzer

 "rulesDirectory": [
    "node_modules/codelyzer"
  ],

This worked for me as well! Cheers 🍻