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

ESLint fails to generate an eslintrc file when I ask it to analyse my TypeScript based project #13149

Closed
rajat1saxena opened this issue Apr 6, 2020 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon

Comments

@rajat1saxena
Copy link

Tell us about your environment
Ubuntu 18.04
Environment Info:

Node version: v12.16.1
npm version: v6.14.4
Local ESLint version: Not found
Global ESLint version: Not found

  • ESLint Version: 6.8.0
  • Node Version: v12.16.1
  • npm Version: 6.14.4

What parser (default, Babel-ESLint, etc.) are you using? typescript-parser

Please show your full configuration:

Configuration
{
  "name": "eslinttest",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "^2.26.0",
    "@typescript-eslint/parser": "^2.26.0",
    "eslint": "^6.8.0",
    "typescript": "^3.8.3"
  }
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
I was trying to initialize ESLint for a TypeScript based project. I wanted to let ESLint to analyse my code base and set itself up accordingly. Following are the options I chose.

? How would you like to use ESLint? To check syntax, find problems, and enforce code style
? What type of modules does your project use? JavaScript modules (import/export)
? Which framework does your project use? None of these
? Does your project use TypeScript? Yes
? Where does your code run? Node
? How would you like to define a style for your project? Inspect your JavaScript file(s)
? Which file(s), path(s), or glob(s) should be examined? src/*.ts
? What format do you want your config file to be in? JavaScript
Determining Config: 100% [==============================] 0.1s elapsed, eta 0.0s 
Determining Config: 100% [==============================] 0.2s elapsed, eta 0.0s 

Enabled 275 out of 275 rules based on 1 file.
config.extends.push is not a function
TypeError: config.extends.push is not a function
    at processAnswers (/home/guest/dev/opensource/eslint/node_modules/eslint/lib/init/config-initializer.js:330:24)
    at /home/guest/dev/opensource/eslint/node_modules/eslint/lib/init/config-initializer.js:614:28
    at processTicksAndRejections (internal/process/task_queues.js:97:5)

What did you expect to happen?
It should create a .eslintrc.js file.

What actually happened? Please include the actual, raw output from ESLint.
I got the above mentioned error and no eslintrc.js was generated

Are you willing to submit a pull request to fix this bug?
Yes

@rajat1saxena rajat1saxena added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Apr 6, 2020
rajat1saxena pushed a commit to rajat1saxena/eslint that referenced this issue Apr 6, 2020
…slint#13149)

It fixes the issue where ESLint encounters an error while generating eslintrc file if you have a TypeScript project and you chose the option 'Inspect your JavaScript file(s)' from the initialization wizard.
@mdjermanovic
Copy link
Member

Hi @rajat1saxena, thanks for the bug report!

I think this is a duplicate of #12707, which will be fixed by PR #12738.

@mdjermanovic
Copy link
Member

Closing this as it's fixed by #12738 (merged now).

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Oct 4, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Oct 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon
Projects
None yet
Development

No branches or pull requests

2 participants