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

Can you please tell me where to put the config file for tslint #252

Open
homeday opened this issue Mar 22, 2019 · 4 comments
Open

Can you please tell me where to put the config file for tslint #252

homeday opened this issue Mar 22, 2019 · 4 comments

Comments

@homeday
Copy link

homeday commented Mar 22, 2019

Always get "Your tslint configuration file is missing or invalid. Please ensure that tslint.json exists and is valid JSON."
The tslint.json exists in the root folder of my own working repo.
i have used

[tool_tslint]
config = tslint.json
or
[tool_tslint]
config = ./tslint.json

setting, but the review doesn't work. Can you please help me and thank you in advance.

@markstory
Copy link
Owner

markstory commented Mar 22, 2019

Is the config file in the root of your repository? With the tslint.json in the root of your repository, config = ./tslint.json should work. You may need to modify the code and add more logging to find out what the resolved path is though. I'm not able to help much more as the config path has tests that are working.

@homeday
Copy link
Author

homeday commented Mar 25, 2019

I added some script in the tslint.py to output log.
here is the result:
Failed to load /src/tslint.json: Could not find custom rule directory: node_modules/codelyzer
It seems that the tslint can't find the node module codelyzer, therefore I recreate the nodejs image, added this module at package.json. and after it, I can find module in the new image. But the problem still remains.
Any idea? Do I need to install the module globally? currently it is in the /tool directory
Thanks

@markstory
Copy link
Owner

@homeday When I add packages I use the package.json and things usually work out. I've never used codelyzer so I can't help much.

@homeday
Copy link
Author

homeday commented Mar 27, 2019

found a workaround, link the /tool/node_modules to current work directory.
since nodejs image work as a job not services, we can create a bash file and put it in somewhere inside container like /tool, in it
link the /tool/node_modules to current work directory, so that the relevant modules can be referred.
like:
ln -s -f /tool/node_modules /src/node_modules
shift 1
./node_modules/.bin/tslint $*
And add ENTRYPOINT at nodejs.dockerfile
ENTRYPOINT ["/bin/bash", "/tool/tslinterwrapper.sh"], so that the original arguments can be passed to the tslint command.

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

2 participants