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

error: unknown option `--print-config' in a new nestjs project #106

Closed
itays opened this issue Jul 16, 2019 · 7 comments · Fixed by #107
Closed

error: unknown option `--print-config' in a new nestjs project #106

itays opened this issue Jul 16, 2019 · 7 comments · Fixed by #107
Assignees
Labels
status: accepting prs Please, send in a PR to resolve this! ✨ type: bug Something isn't working

Comments

@itays
Copy link

itays commented Jul 16, 2019

🐛 Bug Report

  • tslint-to-eslint-config version: 0.1.9
  • ESLint version: 6.0.1
  • Node version: 12.4.0

Actual Behavior

currently nestjs framework still ships with tslint. I created a new nestjs project and run npx tslint-to-eslint-config and got:

Could not start tslint-to-eslint:
Command failed: tslint --print-config "./tslint.json"
error: unknown option `--print-config'

Expected Behavior

eslint json file should be created

Reproduction

install the nestjs cli tool:
npm i -g @nestjs/cli
create a nestjs project:
nest new project-name
cd into the newly created project and run npx tslint-to-eslint-config

@JoshuaKGoldberg JoshuaKGoldberg self-assigned this Jul 16, 2019
@JoshuaKGoldberg JoshuaKGoldberg added the type: bug Something isn't working label Jul 16, 2019
@JoshuaKGoldberg
Copy link
Member

👋 Thanks for the bug report @itays! If you update your TSLint version to 5.18.0, the issue will go away.

The problem is that TSLint added the --print-config flag only recently, and tslint-to-eslint-config relies on it. I'll send a PR to add an explicit dependency to this package on sufficient tslint and typescript versions.

@JoshuaKGoldberg JoshuaKGoldberg added the status: accepting prs Please, send in a PR to resolve this! ✨ label Jul 16, 2019
@JoshuaKGoldberg
Copy link
Member

This should be fixed in 0.2.0:

npx tslint-to-eslint-config@0.2

Please do post here if that doesn't fix this bug for you! 🚀

@JoshuaKGoldberg
Copy link
Member

FYI: as of 0.2.2, the error message when the TSLint version is too low will explicitly indicate it should be updated.

❌ Could not start tslint-to-eslint: ❌
TSLint v5.18 required. Please update your version.

@Yavorss
Copy link

Yavorss commented Nov 20, 2019

@JoshuaKGoldberg Do I need exactly 5.18v?

image

@JoshuaKGoldberg
Copy link
Member

JoshuaKGoldberg commented Nov 20, 2019

Oh interesting. You should be able to use 5.20.1, and generally anything >=5.18. Would you mind filing a new issue with your project details?

@bephrem1
Copy link

bephrem1 commented Jan 25, 2021

Oddly still getting this in a NextJS project where we use TSLint:

bephrem in web (⍒ master)$ npx tslint-to-eslint-config    
npx: installed 60 in 6.359s
❌ Could not start tslint-to-eslint: ❌
  Command failed: tslint --print-config "./tslint.json"
Failed to load /Users/bephrem/web/tslint.json: Cannot read property 'func' of undefined

Package.json:

"dependencies": {
    "framer-motion": "^3.1.1",
    "joi": "^17.3.0",
    "jsonp": "^0.2.1",
    "next": "10.0.4",
    "react": "17.0.1",
    "react-dom": "17.0.1",
    "react-spring": "^8.0.27",
    "styled-components": "^5.2.1",
    "toasted-notes": "^3.2.0",
    "typescript": "^4.1.3"
  },
  "devDependencies": {
    "@types/jest": "^26.0.19",
    "@types/jsonp": "^0.2.0",
    "@types/node": "^14.14.17",
    "@types/react": "^17.0.0",
    "@types/react-dom": "^17.0.0",
    "@types/styled-components": "^5.1.7",
    "@typescript-eslint/eslint-plugin": "^4.14.0",
    "@typescript-eslint/parser": "^4.14.0",
    "eslint": "^7.18.0",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-react-hooks": "^4.2.0",
    "react-hooks": "^1.0.1",
    "tslint": "5.20.1",
    "tslint-config-prettier": "^1.18.0",
    "tslint-plugin-prettier": "^2.3.0",
    "tslint-react": "^5.0.0"
  }

tslint.json:

{
  "extends": ["tslint-react", "tslint-config-prettier", "react-hooks"],
  "rules": {
    "class-name": true,
    "comment-format": [true, "check-space"],
    "curly": true,
    "eofline": true,
    "forin": true,
    "jsx-no-lambda": false,
    "jsx-boolean-value": false,
    "label-position": true,
    "max-line-length": [false, 220],
    "member-ordering": [
      true,
      {
        "order": [
          "public-static-field",
          "public-instance-field",
          "private-static-field",
          "private-instance-field",
          "public-constructor",
          "private-constructor",
          "public-instance-method",
          "protected-instance-method",
          "private-instance-method"
        ]
      }
    ],
    "no-arg": true,
    "no-bitwise": true,
    "no-console": [true, "debug", "info", "time", "timeEnd", "trace"],
    "no-construct": true,
    "no-debugger": true,
    "no-duplicate-variable": true,
    "no-empty": false,
    "no-eval": true,
    "no-inferrable-types": [true, "ignore-params"],
    "no-shadowed-variable": true,
    "no-string-literal": false,
    "no-switch-case-fall-through": true,
    "no-unused-expression": false,
    "no-use-before-declare": false,
    "no-var-keyword": false,
    "no-consecutive-blank-lines": true,
    "one-line": [true, "check-open-brace", "check-catch", "check-else"],
    "no-boolean-literal-compare": true,
    "newline-before-return": true,
    "prefer-const": true,
    "radix": true,
    "semicolon": [true, "always"],
    "triple-equals": [true, "allow-null-check"],
    "typedef": [false, "call-signature", "parameter"],
    "variable-name": [true, "check-format", "allow-leading-underscore", "allow-pascal-case"],
    "trailing-comma": [
      true,
      {
        "multiline": "never",
        "singleline": "never"
      }
    ],
    "no-trailing-whitespace": true,
    "whitespace": [
      true,
      "check-branch",
      "check-decl",
      "check-operator",
      "check-module",
      "check-separator",
      "check-rest-spread",
      "check-type",
      "check-typecast",
      "check-type-operator",
      "check-preblock"
    ],
    "space-before-function-paren": [
      true,
      {
        "anonymous": "never",
        "named": "never",
        "asyncArrow": "always",
        "method": "never"
      }
    ],
    "space-within-parens": [true, 0],
    "typedef-whitespace": [
      true,
      {
        "call-signature": "nospace",
        "index-signature": "nospace",
        "parameter": "nospace",
        "property-declaration": "nospace",
        "variable-declaration": "nospace"
      },
      {
        "call-signature": "onespace",
        "index-signature": "onespace",
        "parameter": "onespace",
        "property-declaration": "onespace",
        "variable-declaration": "onespace"
      }
    ],
    "import-spacing": true
  }
}

@bephrem1
Copy link

bephrem1 commented Jan 25, 2021

Ah, it was:
"extends": ["tslint-react", "tslint-config-prettier", "react-hooks"],

react-hooks never resolved, I don't even remember if that ever resolved to anything or when that was added. Removed and works.

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: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants