Skip to content

Unclear error message when tslint command is not found #836

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
JoshuaKGoldberg opened this issue Nov 21, 2020 · 7 comments Β· Fixed by #837
Closed

Unclear error message when tslint command is not found #836

JoshuaKGoldberg opened this issue Nov 21, 2020 · 7 comments Β· Fixed by #837
Assignees
Labels
good first issue Good for newcomers; welcome aboard! status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working

Comments

@JoshuaKGoldberg
Copy link
Member

πŸ› Bug Report

  • tslint-to-eslint-config version: 2.0.0
  • ESLint version: N/A
  • Node version: N/A

Actual Behavior

❌ Could not start tslint-to-eslint: ❌
  Command failed: tslint --print-config "./tslint.json"
/bin/sh: tslint: command not found

Expected Behavior

❌ Could not start tslint-to-eslint: ❌
    The 'tslint' command was not found. Either install it globally or add it as a devDependency of this repository.

Reproduction

Per @kumaresan-subramani's info in #823:

git clone https://github.com/kumaresan-subramani/ESlint-tester
cd ESlint-tester
npx tslint-to-eslint-config

I'm guessing this hasn't been reported until now because most projects that use TSLint and would want to convert to ESLint already have it as a dependency in their package.json.

I already have a fix for it from just testing this out locally, so I'll send a PR πŸ˜„ .

@JoshuaKGoldberg JoshuaKGoldberg added type: bug Something isn't working status: accepting prs Please, send in a PR to resolve this! ✨ good first issue Good for newcomers; welcome aboard! labels Nov 21, 2020
@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Nov 21, 2020
@kumaresan-subramani
Copy link

@JoshuaKGoldberg , did you find anything regarding this

@JoshuaKGoldberg
Copy link
Member Author

@kumaresan-subramani yup, it should have been resolved in #837. Are you still experiencing it with the latest 2.0.1 version?

@kumaresan-subramani
Copy link

yes brother, same issue latest too

@JoshuaKGoldberg
Copy link
Member Author

Okie, I'll take a look.

To be clear, this issue is reporting that the error message is unclear. The resolution you the consumer will need to do is in the new proposed error message: either install the tslint package globally or add it as a devDependency of your package.

@kumaresan-subramani
Copy link

kumaresan-subramani commented Dec 15, 2020

@JoshuaKGoldberg ,

i think below is an issue cause

image

while using npx tslint-to-eslint-config command it tries to access tslint file from node_modules instead of root.

But works fine when i initialize ES0lint using below doc

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

Below file shows my required rules, i want same rules for es-lint too

https://github.com/kumaresan-subramani/ESlint-tester/blob/main/tslint.json

@kumaresan-subramani
Copy link

Alternate

i have tried below as alternate

https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin-tslint#installation

below is my eslint.json file

{
    "env": {
        "browser": true,
        "es2021": true
    },
    "extends": [
        "eslint:recommended",
        "plugin:@typescript-eslint/recommended"
    ],
    "parser": "@typescript-eslint/parser",
    "plugins": [
        "@typescript-eslint",
        "@typescript-eslint/tslint"
    ],
    "parserOptions": {
        "project": "tsconfig.json"
    },
    "rules": {
        "@typescript-eslint/tslint/config": ["warn", {
          "lintFile": "https://github.com/kumaresan-subramani/ESlint-tester/blob/main/tslint.json", // path to tslint.json of your project
          "rules": {
            },
          "rulesDirectory": [
            // array of paths to directories with rules, e.g. 'node_modules/tslint/lib/rules' (will be used if `lintFile` is not specified)
          ]
        }]
      },
    "reportUnusedDisableDirectives": true

}

while giving below command, i am facing memry issue

yarn run eslint src

issue

javascript heap out of memory

@kumaresan-subramani
Copy link

i found my issue

https://github.com/typescript-eslint/tslint-to-eslint-config#usage

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
good first issue Good for newcomers; welcome aboard! status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants