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

Fix false positives shouldForwardProp in property-no-unknown #4639

Closed
alexandrzavalii opened this issue Mar 5, 2020 · 3 comments
Closed
Labels
status: ready to implement is ready to be worked on by someone syntax: css-in-js relates to JS objects & template literals type: bug a problem with a feature or rule upstream relates to an upstream package

Comments

@alexandrzavalii
Copy link

alexandrzavalii commented Mar 5, 2020

Stylint throws an error when using shouldForwardProp from styled-system

What code is needed to reproduce the bug?

import styled from '@emotion/styled'
import shouldForwardProp from '@styled-system/should-forward-prop'

export const Box = styled('div', { shouldForwardProp })({
    boxSizing: 'border-box',
  },
  props => props.css,
)

What stylelint configuration is needed to reproduce the bug?

    "@emotion/core": "10.0.27",
    "@emotion/styled": "10.0.27",
    "@styled-system/should-forward-prop": "5.1.5",
    "styled-system": "5.1.5",
    "stylelint": "13.2.0",
module.exports = {
  extends: ['stylelint-config-recommended', 'stylelint-config-rational-order'],
  ignoreFiles: ['**/storybook-static/**'],
  rules: {
    'at-rule-no-unknown': null,
    'plugin/rational-order': [
      true,
      {
        'border-in-box-model': true,
        'empty-line-between-groups': false,
      },
    ],
  },
};

@jeddy3 jeddy3 changed the title Bug: Unexpected unknown property "should-forward-prop" property-no-unknown Fix false positives shouldForwardProp in property-no-unknown Mar 8, 2020
@jeddy3 jeddy3 added status: ready to implement is ready to be worked on by someone syntax: css-in-js relates to JS objects & template literals type: bug a problem with a feature or rule upstream relates to an upstream package labels Mar 8, 2020
@jeddy3
Copy link
Member

jeddy3 commented Mar 8, 2020

@alexandrzavalii Thanks for the report.

I can reproduce this with the demo.

I believe it's an issue with the syntax that stylelint uses to support CSS-in-JS. Please consider contributing to the syntax if you have time.

I've added this issue to the CSS-in-JS umbrella issue.

@AhmedBHameed
Copy link

I confirm the same issue here
issue

@jeddy3
Copy link
Member

jeddy3 commented Jan 18, 2022

Closing as the syntax option was removed for the 14.0.0 release. (See the migration guide.)

We'll also be deprecating our forked CSS-in-JS package, in favour of leaner custom syntaxes.

Please consider writing a custom syntax specific to the CSS-in-JS library in this issue and fixing the bug there.

@jeddy3 jeddy3 closed this as completed Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready to implement is ready to be worked on by someone syntax: css-in-js relates to JS objects & template literals type: bug a problem with a feature or rule upstream relates to an upstream package
Development

No branches or pull requests

3 participants