Coder Social home page Coder Social logo

Comments (7)

Brianzchen avatar Brianzchen commented on June 20, 2024 1

Give v2.0.1 a go

from eslint-plugin-ft-flow.

maxcnunes avatar maxcnunes commented on June 20, 2024

This setting from the recommended configuration that was causing the issue for me:

"babelOptions": {
      "parserOpts": {
        "plugins": [
          "flow",
          "jsx"
        ]
      }
    }

Actually, it is only the "flow" plugin that causes the problem.

I got it solved by setting an empty babelOptions:{} on my eslint configuration while I don't figure out why that setting isn't working for me.

Thanks for the plugin btw 🙇

from eslint-plugin-ft-flow.

Brianzchen avatar Brianzchen commented on June 20, 2024

I'll be honest I've never used flow enums yet, I'll give it a go today and see what could fix it

from eslint-plugin-ft-flow.

maxcnunes avatar maxcnunes commented on June 20, 2024

@Brianzchen It seems this should be configuration instead, I couldn't find a flow plugin for babel at least:

  "parserOptions": {
    "babelOptions": {
      "parserOpts": {
        "presets": ["@babel/preset-flow"],
        "plugins": ["jsx", "babel-plugin-transform-flow-enums"]
      }
    }
  }

from eslint-plugin-ft-flow.

Brianzchen avatar Brianzchen commented on June 20, 2024

Ok I just tested this and this is what I've realised, babelOptions is basically an overwrite to babel.config.js or .babelrc.js specified in your root project, when you don't have parserOptions defined it will just read your babel config instead which should always work, you basically NEED to have that configured otherwise your code doesn't actually run so we're just doubling up code to match eslint with any other babel parsing.

My suggestion here is that we just remove this property completely from the recommended setting, whatever you have defined in your babel config to traverse your code for runtime, testing and now eslint will all be the same. This project won't need to maintain all sorts of settings for different use cases.

Also note that this property was originally added before @babel/eslint-parser was a thing but now pulling from babel configs is the standard.

Is that ok with you @maxcnunes? I can make this change quickly and then ship a patch immediately after

from eslint-plugin-ft-flow.

maxcnunes avatar maxcnunes commented on June 20, 2024

Yeah, makes sense to me, thanks.

from eslint-plugin-ft-flow.

maxcnunes avatar maxcnunes commented on June 20, 2024

That worked, thanks!

from eslint-plugin-ft-flow.

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.