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 not working after node update #1227

Closed
hnjoshi opened this issue Mar 30, 2021 · 16 comments
Closed

Eslint not working after node update #1227

hnjoshi opened this issue Mar 30, 2021 · 16 comments
Labels
info-needed Issue requires more information from poster

Comments

@hnjoshi
Copy link

hnjoshi commented Mar 30, 2021

eslint status

[Info  - 14:18:24] ESLint server is running.
(node:56109) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): SyntaxError: Unexpected token ...
(node:56109) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:56109) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): SyntaxError: Unexpected token ...
(node:56109) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): SyntaxError: Unexpected token ...

Node v14.16.0
eslint v7.23.0

any suggestion?

@dbaeumer
Copy link
Member

@hnjoshi does eslint work in the terminal correctly?

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Mar 31, 2021
@hnjoshi
Copy link
Author

hnjoshi commented Mar 31, 2021

@dbaeumer Yes, it works fine in the terminal.

@hnjoshi
Copy link
Author

hnjoshi commented Mar 31, 2021

image
The new settings are shown as "unknown configuration settings".
old settings don't show unknown configuration settings nor they work.

@dbaeumer
Copy link
Member

dbaeumer commented Apr 1, 2021

Do you use the eslint.runtime setting. If yes, you need to confirm the setting now. See https://github.com/microsoft/vscode-eslint/blob/main/README.md. To confirm the setting run the command ESLint: Select Node Runtime

@hnjoshi
Copy link
Author

hnjoshi commented Apr 1, 2021

No I didn't use eslint.runtime setting. eslint.runtime is also shown as Unknown configuration setting in VS code

@hnjoshi
Copy link
Author

hnjoshi commented Apr 1, 2021

.eslintrc.json

{
  "root": true,
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaVersion": 2016,
    "sourceType": "module"
  },
  "env": {
    "browser": true,
    "node": true,
    "es6": true,
    "jest": true
  },
  "extends": [
    "airbnb",
    "prettier",
    "prettier/react",
    "plugin:jest/recommended"
  ],
  "plugins": [
    "prettier",
    "jest"
  ],
  "rules": {
    "prefer-destructuring": "off",
    "camelcase": "off",
    "import/no-named-as-default": 0,
    "react/destructuring-assignment": "off",
    "react/jsx-filename-extension": "off",
    "react/jsx-sort-props": ["error", {
      "ignoreCase": true,
      "reservedFirst": false
    }],
    "react/prefer-stateless-function": "off",
    "class-methods-use-this": "off",
    "jsx-a11y/label-has-associated-control": [ "error", {
      "required": {
        "some": [ "nesting", "id"  ]
      }
    }],
    "jsx-a11y/label-has-for": [ "error", {
      "required": {
        "some": [ "nesting", "id"  ]
      }
    }],
    "prettier/prettier": [
      "error",
      {
        "bracketSpacing": true,
        "trailingComma": "all",
        "singleQuote": true
      }
    ]
  }
}

@hnjoshi
Copy link
Author

hnjoshi commented Apr 1, 2021

"lint": "eslint src config webpack --fix" - script in pkg json

$ npm run lint

> eslint src config webpack --fix


/Users/hnjoshi/repos/x-ui/src/client/components/custom-resolver/CreateCustomResolver.js
  11:10  error  'SidePanel' is defined but never used           no-unused-vars
  11:21  error  'SidePanelContainer' is defined but never used  no-unused-vars

/Users/hnjoshi/repos/x-ui/src/client/containers/CustomResolverActionHandler.js
   7:10  error  'DialogType' is defined but never used  no-unused-vars
  10:1   error  Prefer default export                   import/prefer-default-export

/Users/hnjoshi/repos/x-ui/src/client/containers/CustomResolverContainer.js
  14:10  error  'showCreateResolver' is defined but never used  no-unused-vars

✖ 5 problems (5 errors, 0 warnings)

linter works fine in terminal, but I don't see these errors in VS code.

@dbaeumer
Copy link
Member

dbaeumer commented Apr 6, 2021

Can you please provide me with a GitHub repository I can clone that demos what you are experiencing.

@hnjoshi
Copy link
Author

hnjoshi commented Apr 8, 2021

It's not a public repository so I can't share.

@dbaeumer
Copy link
Member

dbaeumer commented Apr 9, 2021

@hnjoshi can you distill one?

@kanizer
Copy link

kanizer commented Jun 9, 2021

I get the same output error - here's a sample project for reference.

MacOS 11.4
Code v1.22.2
Node v14.11.0
eslint v6.5.1
ESLint plugin v1.4.10 (this is the version auto-installed; manually installed newer releases do not work?)

@hnjoshi
Copy link
Author

hnjoshi commented Jun 9, 2021

My issue had got resolved after I got new laptop. So I think there was some caching problem in older setup.
I would suggest clean install / clear cache.

@kanizer
Copy link

kanizer commented Jun 9, 2021

I would suggest clean install / clear cache

@hnjoshi Thx for the context - were you referring to the extension? VSCode?

@dbaeumer
Copy link
Member

@kanizer can you please update to the latest VS Code (which is 1.56.0) which will update the ESLint extension to 2.1.20

The versions you are using are ~ 2 years old.

@hnjoshi
Copy link
Author

hnjoshi commented Jun 10, 2021

I would suggest clean install / clear cache

@hnjoshi Thx for the context - were you referring to the extension? VSCode?

I was already on latest version of vs code and extension but due to caching issue I was running into eslint errors. New/Clean setup solved the issue.

Closing this issue as it can't be reproduced.

@hnjoshi hnjoshi closed this as completed Jun 10, 2021
@kanizer
Copy link

kanizer commented Jun 10, 2021

The versions you are using are ~ 2 years old.

I guess that would explain things 🤦 - I tried updating through the app menu, but downloading the current version worked as expected. Ty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

3 participants