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

not working with es6 #2

Closed
Bnaimy opened this issue Oct 16, 2019 · 4 comments
Closed

not working with es6 #2

Bnaimy opened this issue Oct 16, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@Bnaimy
Copy link

Bnaimy commented Oct 16, 2019

hi I am really like this project because is very difficult to write code without directive
I really I don't know why is not working ,
just if you can init a project with configuration of your project ??

@Bnaimy Bnaimy added the bug Something isn't working label Oct 16, 2019
@peakchen90
Copy link
Owner

@Bnaimy
Thank you for using and like it.
Can you provide the babel configuration, code, error logs? Provide screenshots is better.

@Bnaimy
Copy link
Author

Bnaimy commented Oct 17, 2019

this is file .babelrc inside package.json

{ "name": "app", "version": "1.0.0", "babel": { "presets": [ ], "plugins": ["react-directives"], "options": { "prefix": "x", "pragmaType": "React" } }

@peakchen90
Copy link
Owner

peakchen90 commented Oct 17, 2019

@Bnaimy
Your babel configuration looks like this:

{
  "name": "app",
  "version": "1.0.0",
  "babel": {
    "presets": [],
    "plugins": [
      "react-directives"
    ],
    "options": {
      "prefix": "x",
      "pragmaType": "React"
    }
  }
}

It is invalid, correct configuration:

{
  "name": "app",
  "version": "1.0.0",
  "babel": {
    "presets": [],
    "plugins": [
      [
        "react-directives",
        {
          "prefix": "x",
          "pragmaType": "React"
        }
      ]
    ]
  }
}

You can learn more at https://babeljs.io/docs/en/plugins#plugin-options, and optimize the documentation later.

And the option prefix = "x", pragmaType = "React" is the default option, you can omit the options section as follows:

{
  "name": "app",
  "version": "1.0.0",
  "babel": {
    "presets": [],
    "plugins": [
      "react-directives"
    ]
  }
}

@Bnaimy
Copy link
Author

Bnaimy commented Oct 17, 2019

it's work thanks and waiting for features good jobs

@peakchen90 peakchen90 pinned this issue Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants