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

Receiving Parsing error: not implemented on v2.24.0 #1759

Closed
biehlerj opened this issue Mar 17, 2020 · 8 comments · Fixed by #2004
Closed

Receiving Parsing error: not implemented on v2.24.0 #1759

biehlerj opened this issue Mar 17, 2020 · 8 comments · Fixed by #2004
Labels
bug Something isn't working package: parser Issues related to @typescript-eslint/parser

Comments

@biehlerj
Copy link

What code were you trying to parse?

import { app, ipcMain } from 'electron';

What did you expect to happen?

No error on the first line of code

What actually happened?

Received an error stating Parsing error: not implemented

Versions

package version
@typescript-eslint/parser 2.24.0
TypeScript 3.2.2
ESLint ^6.8.0
node 12.6.1
npm 6.13.4

When I manually pin my @typescript-eslint/parser dependency to 2.23.0 that error no longer happens and eslint uses the rules in the project's .eslintrc.json. If necessary I can post the debug log in a gist.

@biehlerj biehlerj added package: parser Issues related to @typescript-eslint/parser triage Waiting for maintainers to take a look labels Mar 17, 2020
@bradzacher
Copy link
Member

Could you provide some more information?
This by itself is not a lot to go on.

eg
What does your config look like?
What does the eslint --debug look like?

@bradzacher bradzacher added awaiting response Issues waiting for a reply from the OP or another party and removed triage Waiting for maintainers to take a look labels Mar 17, 2020
@biehlerj
Copy link
Author

The config:

{
  "env": {
    "browser": true,
    "es6": true,
    "node": true
  },
  "extends": [
    "airbnb-typescript",
    "plugin:@typescript-eslint/eslint-recommended",
    "plugin:@typescript-eslint/recommended"
  ],
  "globals": {
    "Atomics": "readonly",
    "SharedArrayBuffer": "readonly"
  },
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json",
    "ecmaFeatures": {
      "jsx": true
    },
    "ecmaVersion": 2018,
    "sourceType": "module"
  },
  "plugins": [
    "@typescript-eslint",
    "react"
  ],
  "rules": {
    "max-len": [
      2,
      {
        "code": 120,
        "tabWidth": 4
      }
    ],
    "indent": [
      "warn",
      4,
      {
        "FunctionDeclaration": {
          "parameters": "first"
        },
        "SwitchCase": 1
      }
    ],
    "@typescript-eslint/indent": [
      "warn",
      4,
      {
        "FunctionDeclaration": {
          "parameters": "first"
        },
        "SwitchCase": 1
      }
    ],
    "import/prefer-default-export": 0,
    "no-trailing-spaces": 2,
    "react/jsx-filename-extension": [
      1,
      {
        "extensions": [
          ".jsx",
          ".tsx"
        ]
      }
    ],
    "@typescript-eslint/no-unused-vars": "warn",
    "@typescript-eslint/no-use-before-define": 0,
    "@typescript-eslint/no-inferrable-types": 0,
    "import/no-extraneous-dependencies": 0,
    "import/no-cycle": 0,
    "no-underscore-dangle": "off",
    "comma-dangle": [
      2,
      {
        "arrays": "always-multiline",
        "objects": "always-multiline",
        "imports": "always-multiline",
        "exports": "always-multiline",
        "functions": "ignore"
      }
    ],
    "semi": [
      "error",
      "always"
    ],
    "object-curly-newline": [
      "error",
      {
        "ObjectExpression": {
          "multiline": true
        },
        "ObjectPattern": {
          "multiline": true
        },
        "ImportDeclaration": {
          "consistent": true
        },
        "ExportDeclaration": {
          "consistent": true
        }
      }
    ]
  }
}

The eslint --debug: https://gist.github.com/biehlerj/8151a81c3edb5dbb40bff3ab130589b2

@bradzacher
Copy link
Member

Hmm. I see you're on typescript 3.2.2
That's a very old version of typescript.

having a quick dig around, it looks like #1693 broke this for you, as it switched to ts.createAbstractBuilder.
In TS 3.2.2, ts.createAbstractBuilder throws an error for all methods other than getProgram:

https://github.com/microsoft/TypeScript/blob/v3.2.2/src/compiler/builder.ts#L710-L730

cc @uniqueiniquity @sheetalkamat

@bradzacher bradzacher added bug Something isn't working and removed awaiting response Issues waiting for a reply from the OP or another party labels Mar 17, 2020
@sheetalkamat
Copy link
Contributor

I think abstract builder shouldnt throw but needs to redirect methods to program. Definitely issue with typescript here. But given that should we use abstract builder for 3.9 onwards in eslint and for rest semantic builder like before #1693

@sheetalkamat
Copy link
Contributor

Oh and thats actually been fixed since 3.2.2 .. will figure out when abstract builder was fixed to redirect instead

@sheetalkamat
Copy link
Contributor

Update typescript@3.3 has this fixed

@bradzacher
Copy link
Member

@biehlerj can you update to TS3.3?
Is there something that's blocking you from that?

@biehlerj
Copy link
Author

biehlerj commented Mar 17, 2020

@bradzacher that's the requirement for a project which is a work-related project and I don't have control over what version of typescript we use. I've tested it and it looks like as long as @typescript-eslint/parser is < 2.24.0 our config works and if we can't upgrade to typescript >= 3.3 I'll just pin it to that version.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: parser Issues related to @typescript-eslint/parser
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants