Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Issue with eslint and JSX #58

Closed
keul opened this issue Mar 1, 2017 · 1 comment
Closed

Issue with eslint and JSX #58

keul opened this issue Mar 1, 2017 · 1 comment
Labels

Comments

@keul
Copy link

keul commented Mar 1, 2017

On a react.js project with eslint atom plugin configured, if I use the prettier format I get this code:

return [
  (
    <div>
      <input
        type="checkbox"
        name="invalidateCache"
        id={uniqueId}
        onChange={this.onInvalidateCache}
        checked={this.props.workflowDataStorage.cacheInvalidation}
      />
      <label htmlFor={uniqueId}>Invalidate cache on requests</label>
    </div>
  )
];

... but eslint raise a warning:

schermata 2017-03-01 alle 15 18 16

So it seems that eslint is happy with a code like this:

return [
  (
  <div>
    <input
      type="checkbox"
      name="invalidateCache"
      id={uniqueId}
      onChange={this.onInvalidateCache}
      checked={this.props.workflowDataStorage.cacheInvalidation}
    />
    <label htmlFor={uniqueId}>Invalidate cache on requests</label>
  </div>
)
];

Although the code formatted by prettier-atom is nicer IMHO, I'm wondering how to make eslint and this coexists. Maybe is a bug in eslint/jsx but I've no element to know.

Any hint?

@robwise
Copy link
Collaborator

robwise commented Mar 1, 2017

@keul I am currently working on integrating prettier-eslint into this repo. Until that's ready, I would check out https://github.com/kentcdodds/prettier-eslint-atom

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants