sindresorhus / eslint-plugin-unicorn

More than 100 powerful ESLint rules
MIT License
4.31k stars 366 forks source link

`no-unused-properties` rule does not support styled when using as react component #1799

Open mc-petry opened 2 years ago

mc-petry commented 2 years ago

When using react styled components (and similar libraries like emotion, stitches etc.) as styles rule don't work.

no-unused-properties

const styles = {
  wrapper: styled('div', {}),
  unused: styled('div', {}),
}

function Component() {
  return <styles.wrapper />
}
fregante commented 9 months ago

Its main example use case mentions CSS-in-JS exactly. If this still doesn't work, it's likely a bug

https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unused-properties.md