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

Fragment error when using the settings in a JSX project #2818

Closed
DanielRuf opened this issue Oct 2, 2020 · 6 comments
Closed

Fragment error when using the settings in a JSX project #2818

DanielRuf opened this issue Oct 2, 2020 · 6 comments

Comments

@DanielRuf
Copy link

I'm getting the following error with the example settings in .eslintrc.js:

Fragment pragma React.Fragment is not a valid identifier

@DanielRuf
Copy link
Author

@DanielRuf
Copy link
Author

DanielRuf commented Oct 2, 2020

Ah it looks like the wrong default branch is used (master instead of next) or the readme is just outdated.

The next branch shows the following in the readme:

{
  "settings": {
    "react": {
      "createClass": "createReactClass", // Regex for Component Factory to use,
                                         // default to "createReactClass"
      "pragma": "React",  // Pragma to use, default to "React"
      "version": "detect", // React version. "detect" automatically picks the version you have installed.
                           // You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
                           // default to latest and warns if missing
                           // It will default to "detect" in the future
      "flowVersion": "0.53" // Flow version
    },
    "propWrapperFunctions": [
        // The names of any function used to wrap propTypes, e.g. `forbidExtraProps`. If this isn't set, any propTypes wrapped in a function will be skipped.
        "forbidExtraProps",
        {"property": "freeze", "object": "Object"},
        {"property": "myFavoriteWrapper"}
    ],
    "linkComponents": [
      // Components used as alternatives to <a> for linking, eg. <Link to={ url } />
      "Hyperlink",
      {"name": "Link", "linkAttribute": "to"}
    ]
  }
}

PS: this repo should probably be under an org to ease future maintenance and onboard more maintainers and contributors.

@DanielRuf
Copy link
Author

cc @ljharb regarding the org statement. It looks like you have more rights for this repo.

@ljharb
Copy link
Member

ljharb commented Oct 2, 2020

@DanielRuf so far there hasn't been any issue with it not being in an org, but if the owner is open to it, i could certainly make one.

As to your question, where in the readme do you see a "develop" branch referenced? The "next" branch isn't something I've ever used and is pretty outdated. The pragma should be "React".

@DanielRuf
Copy link
Author

You are right, I've meant next, not develop.

The current default branch has the wrong example in the readme (which is also shown on npmjs).

@ljharb
Copy link
Member

ljharb commented Oct 2, 2020

ah, you're right. that should be updated to say "Fragment".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants