Parsing error: Unterminated regular expression literal.

See original GitHub issue

Hey,

first of all thanks for building this. I really appreciate the work you put into this project.

I’m running into a problem with linting MDX files alongside react and typescript. I have a working setup for all of the react parts, but whatever i try, i am not able to get .mdx linting to work.

The linter shows ‘Parsing error: Unterminated regular expression literal.’ on jsx in MDX files.

<div>Lorem</div>
-----------^----

I made a small test case here: https://github.com/tizzle/mdx-lint-bug

Do you have any idea what could be going on and can point me towards a solution? That would be great.

Best

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
JounQincommented, Sep 30, 2019

What means you should use:

{
  "extends": ["plugin:mdx/recommended"],
  "overrides": [
    {
      "files": ".{ts,tsx}", // only parse `.ts` and `.tsx` files as TypeScript
      "parser": "@typescript-eslint/parser"
    }
  ]
}
0reactions
tizzlecommented, Sep 30, 2019

Hey @JounQin,

this works like a charm. Thank you so much for the quick response and prompt resolution.

Cheers

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "Unterminated regular expression literal" error in ...
Your regular expression ends with \/ , which means that the last / is interpreted as part of the expression and not the...
Read more >
SyntaxError: unterminated string literal - JavaScript | MDN
The JavaScript error "unterminated string literal" occurs when there is an unterminated string literal somewhere. String literals must be enclosed by single ...
Read more >
8.4- What does "SyntaxError: unterminated regular expression ...
Answer 4fd79696ee44af0003002cf4​​ Easy: That slash in do/while begins a regular expression that is nowhere terminated in your program :-) The glossary explains ...
Read more >
[RESOLVED] Uncaught SyntaxError: unterminated regular ...
just have one error in the console. Uncaught SyntaxError: unterminated regular expression literal. Which seems to be caused by the strange <p> </p>...
Read more >
Issue in unterminated regular expression literal w... - 12345658
Hi, I am creating a fillable form on Acrobat Pro DC (acroform) and I would like to parse my xml but in this...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found