Skip to content

Unclear error message when tslint.json doesn't exist #823

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

Closed
kumaresan-subramani opened this issue Nov 9, 2020 · 14 comments · Fixed by #827
Closed

Unclear error message when tslint.json doesn't exist #823

kumaresan-subramani opened this issue Nov 9, 2020 · 14 comments · Fixed by #827
Assignees
Labels
status: accepting prs Please, send in a PR to resolve this! ✨ type: enhancement New feature or request

Comments

@kumaresan-subramani
Copy link

🐛 Bug Report

  • tslint-to-eslint-config version: X.X.X
  • ESLint version: 7.13.0
  • Node version: 8.11.3

When i run these commands one by one, i am facing below issue

Docs - https://eslint.org/docs/user-guide/getting-started#installation-and-usage

image

@kumaresan-subramani
Copy link
Author

when i try below command, throws below error

image

@kumaresan-subramani
Copy link
Author

@kumaresan-subramani
Copy link
Author

my appplicatoin - https://github.com/kumaresan-subramani/ESlint-tester

please share steps to switch from TS-lint to Es-lint

@JoshuaKGoldberg
Copy link
Member

Hi @kumaresan-subramani! Per this repository's README, tslint-to-eslint-config requires Node >=10. You're running Node 8. Please update your version of Node. Given that both npx eslint --init and npx tslint-to-eslint-config are giving you the same Path must be a string. Received undefined error, I doubt the issues you're facing are unique to tslint-to-eslint-config.

Closing this issue for housekeeping, but if you update to Node >=10 (I recommend the latest versions, 14 or 15), and the issue persists, please do feel free to post here again and we can take another look. Thanks!

@JoshuaKGoldberg JoshuaKGoldberg added question Further information is requested status: external Not related to this repository. labels Nov 9, 2020
@kumaresan-subramani
Copy link
Author

kumaresan-subramani commented Nov 10, 2020

HI @JoshuaKGoldberg ,

Same issue after upgrading node version too.

image

Can you please proper docs to switch tslint to eslint

@JoshuaKGoldberg JoshuaKGoldberg added status: needs investigation Let's dig deeper into this before drawing conclusions. and removed status: external Not related to this repository. labels Nov 11, 2020
@KingDarBoja
Copy link
Collaborator

The main issue I see is the lack of tslint.json file on the repository, which is required to perform the migration to ESLint 🧐

@kumaresan-subramani
Copy link
Author

Hi @KingDarBoja , thank for reply.

that will refer from here

https://github.com/kumaresan-subramani/ESlint-tester/blob/main/gulpfile.js#L1

i have tslint.json file in @syncfusion/ej2-build-check package. i have also tried creating tslint.json file in root but same issue

@JoshuaKGoldberg JoshuaKGoldberg changed the title Path must be a string. Received undefined "Path must be a string. Received undefined" when tslint.json doesn't exist Nov 15, 2020
@JoshuaKGoldberg JoshuaKGoldberg changed the title "Path must be a string. Received undefined" when tslint.json doesn't exist Unclear error message when tslint.json doesn't exist Nov 15, 2020
@JoshuaKGoldberg
Copy link
Member

https://github.com/kumaresan-subramani/ESlint-tester/blob/main/gulpfile.js#L1

Yup, there's your issue! tslint-to-eslint-config requires an actual tslint.json file to exist on disk. It won't try to parse through Gulp configurations or whatnot.

I can reproduce the latest error you posted as-is in the repository after running npx tslint-to-eslint-config. When I add a tslint.json file, it starts to works. Let's consider this issue to be tracking improving that error message to be explicit about the requested TSLint file (in this case, the default tslint.json) not existing.

FWIW not having a tslint.json exist is a very unusual thing. For both ESLint and TSLint, you need a configuration file on disk under a name known to the linter so editor extensions can read it.

@JoshuaKGoldberg JoshuaKGoldberg added status: accepting prs Please, send in a PR to resolve this! ✨ type: enhancement New feature or request and removed question Further information is requested status: needs investigation Let's dig deeper into this before drawing conclusions. labels Nov 15, 2020
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Nov 15, 2020
@kumaresan-subramani
Copy link
Author

i have tslint.json file in @syncfusion/ej2-build-check package. i have also tried creating tslint.json file in root but same issue

Hi @JoshuaKGoldberg ,

I have also tried to add tslint.json file in root and tried still same issue

@kumaresan-subramani
Copy link
Author

@kumaresan-subramani
Copy link
Author

@JoshuaKGoldberg , any update on this

@JoshuaKGoldberg
Copy link
Member

Hey again @kumaresan-subramani -- I've sent a PR (#827) to improve the error message for when the tslint.json file doesn't exist, but otherwise no, not since you posted yesterday that the issue is still happening.

It's great that you're excited to switch from TSLint to ESLint, so if this issue that appears to be only happening for your specific repository is blocking your switch, I'd encourage you to take a look at debugging through tslint-to-eslint-config locally. You can take a look at our development docs here: https://github.com/typescript-eslint/tslint-to-eslint-config/blob/main/docs/Development.md. If that's a bit too high intensity for what you're able to spend time on now, you could try putting some console.log calls through the tslint-to-eslint-config path in your node_modules/.

We should also note that tslint-to-eslint-config is a purely volunteer project. Two maintainers (myself and KingDarBoja) do this in our spare time because we enjoy the work and like the idea of helping folks move from TSLint to ESLint. As with most open source projects, daily updates are asking more from us than we can put in now. You're more likely to get better responses if you ask for updates in weeks rather than days... and even better responses if you take the time yourself to debug through and fix the issue. 😉

@kumaresan-subramani
Copy link
Author

i found my issue

i have tslint version at 4.0.2
when i upgrade latest it wokrs fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: accepting prs Please, send in a PR to resolve this! ✨ type: enhancement New feature or request
Projects
None yet
3 participants