Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Finding tslint.json doesn't work like it used to after update. #3050

Closed
vhakulinen opened this issue Jul 18, 2017 · 1 comment · Fixed by #3309
Closed

Finding tslint.json doesn't work like it used to after update. #3050

vhakulinen opened this issue Jul 18, 2017 · 1 comment · Fixed by #3309
Assignees

Comments

@vhakulinen
Copy link

Bug Report

After upgrading from tslint from 4.0.2 to 5.5.0, tslint doesn't find tslint.json anymore unless it sits in the some directory you're running tslint from. @ajafff suggested that this relates to some recent refactoring of the code that finds the config file.

One notable (maybe a bit unique) note on the code base I'm working in; it has multiple (nested) typescript "projects" (aka tsconfig.json files) and one global tslint.json file on the root of the code base. The tslint.json file is found if I open my editor (or run tslint from command line) in the directory where tslint.json file is. IIRC, my co workers have the same issue with vscode also. Currently I have some viml written to check for the file (in the path) and pass it as commandline option.

  • 5.5.0:
  • 2.4.1:
  • Running TSLint via: (neo)vim's plugin and/or command line

TypeScript code being linted

Can be anything.

with tslint.json configuration:

This can also be anything.

Actual behavior

tslint.json file is not found.

Expected behavior

tslint.json file is found and it's rules loaded.

@ajafff
Copy link
Contributor

ajafff commented Jul 18, 2017

findup-sync used to search until the root directory is reached.
IIRC the current implementation stops at the current directory (when using relative paths). To fix this, the path needs to be resolved to an absolute one before the lookup.

@ajafff ajafff self-assigned this Oct 9, 2017
adidahiya pushed a commit that referenced this issue Oct 19, 2017
[bugfix] fixed regression where the lookup of `tslint.json` stopped at the current directory.
Fixes: #3050
HyphnKnight pushed a commit to HyphnKnight/tslint that referenced this issue Apr 9, 2018
[bugfix] fixed regression where the lookup of `tslint.json` stopped at the current directory.
Fixes: palantir#3050
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants