Skip to content

Commit 773a8e8

Browse files
committed
fix rule cloning issue
1 parent 597e4c2 commit 773a8e8

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.changeset/neat-parrots-return.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'eslint-config-widen-emotion': minor
3+
---
4+
5+
Work through cloning issues.

packages/eslint-config-widen-emotion/src/rules/no-conditional-css-prop.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function detectConditionalExpression(
2121
}
2222
}
2323

24-
export default {
24+
const noConditionalCssProp: Rule.RuleModule = {
2525
create(context) {
2626
return {
2727
JSXAttribute(node: any) {
@@ -46,9 +46,8 @@ export default {
4646
meta: {
4747
docs: {
4848
category: 'Best Practices',
49-
description:
50-
'Disallow conditionals within the css prop, move them to the style prop. This increases the render performance.',
51-
example: `
49+
description: `Disallow conditionals within the css prop, move them to the style prop. This increases the render performance.,
50+
5251
// Before
5352
<div css={[randomDivStyle, isRed ? {color: "red"} : null]} />
5453
@@ -60,4 +59,6 @@ export default {
6059
schema: [],
6160
type: 'suggestion',
6261
},
63-
} as Rule.RuleModule
62+
}
63+
64+
export default noConditionalCssProp

0 commit comments

Comments
 (0)