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

[eslint-plugin-emotion] the syntax-preference rule does not check css props #1253

Closed
Nouzbe opened this issue Mar 1, 2019 · 1 comment
Closed
Milestone

Comments

@Nouzbe
Copy link

Nouzbe commented Mar 1, 2019

  • emotion version: 10.0.7
  • react version: 16.6.0

Relevant code:

// eslintrc.js
rules: {
  ...
  'emotion/syntax-preference': ['error', 'string'],
  ...
}

// MyComponent.js
// Despite using the object syntax, the following line doesn't raise an ESLint error
const MyComponent = () => <div css={{background: 'red'}} />;

Problem description:

The syntax-preference ESLint rule currently works for styled but not with the CSS prop.

Suggested solution:

It would be nice if this rule could also enforce a syntax choice for projects using CSS props.

@Andarist Andarist added this to the v10-todo milestone Nov 3, 2019
@Andarist Andarist modified the milestones: v11-after, v11 Nov 26, 2019
@Andarist
Copy link
Member

Andarist commented Dec 8, 2019

This has been implemented in #1659 and will be a part of the upcoming v11 release.

@Andarist Andarist closed this as completed Dec 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants