Coder Social home page Coder Social logo

Comments (6)

jackkrone avatar jackkrone commented on May 20, 2024 9

@JounQin Sure. I just figured it out, as indicated in #251 (comment)

This is what my overrides array looks like in eslintrc:

  "overrides": [
    {
      "files": [".tsx", ".ts"],
      "extends": "plugin:@typescript-eslint/recommended-requiring-type-checking"
    },
    {
      "files": ["*.mdx"],
      "extends": "plugin:mdx/recommended"
    }
  ]

I've found that this is required if using the @typescript-eslint/parser and the @typescript-eslint/recommended-requiring-type-checking plugin

from eslint-mdx.

JounQin avatar JounQin commented on May 20, 2024 1

Don't enable @typescript-eslint/recommended-requiring-type-checking for all files.

from eslint-mdx.

JounQin avatar JounQin commented on May 20, 2024

Please provide more detail.

Including your eslint config, or a minimal runnable reproduction.

(This seems a usage question, instead of bug, IMO)

You can always use overrides feature of eslint, check https://github.com/1stG/configs/blob/master/packages/eslint-config/overrides.js as reference or demo.

from eslint-mdx.

daviddelusenet avatar daviddelusenet commented on May 20, 2024

I was also experiencing this issue, I solved it by doing the following:

  • Removed @typescript-eslint/recommended-requiring-type-checking from my extends.
  • Added the following part to the overrides section in my ESLint configuration:
{
  "files": ["*.tsx"],
  "extends": ["plugin:@typescript-eslint/recommended-requiring-type-checking"]
}

The error went away and linting works fine!

from eslint-mdx.

jackkrone avatar jackkrone commented on May 20, 2024

I was also experiencing this issue, I solved it by doing the following:

  • Removed @typescript-eslint/recommended-requiring-type-checking from my extends.
  • Added the following part to the overrides section in my ESLint configuration:
{
  "files": ["*.tsx"],
  "extends": ["plugin:@typescript-eslint/recommended-requiring-type-checking"]
}

The error went away and linting works fine!

Could you share your full eslintrc setup? When I use your solution I get the same eslint error in all of my mdx files: Parsing error: Expression expected

from eslint-mdx.

JounQin avatar JounQin commented on May 20, 2024

@jackkrone You'd better provide your reproduction instead.

from eslint-mdx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.