Skip to content

Commit

Permalink
Update recommended config
Browse files Browse the repository at this point in the history
  • Loading branch information
anubra266 committed Feb 11, 2024
1 parent ce94e6f commit db8ac8e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .changeset/long-beans-juggle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pandacss/eslint-plugin": patch
---

Update recommended config
8 changes: 3 additions & 5 deletions docs/rules/prefer-unified-property-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ Discourage against mixing atomic and composite forms of the same property in a s
```js
import { css } from './panda/css';

const color = 'red.100';
const styles = css({ borderRadius:"lg", borderTopRightRadius: "0" });
const styles = css({ margin:"2", marginLeft: "5" });
```
```js

import { Circle } from './panda/jsx';

function App(){
const bool = true;
return <Circle border="solid 1px" borderColor="gray.800" />;
}
```
Expand All @@ -31,14 +29,14 @@ function App(){
```js
import { css } from './panda/css';

const styles = css({ borderColor: 'gray.900', borderWidth: '1px' });
const styles = css({ marginTop: "2", marginRight: "2", marginBottom: "2", marginLeft: "5" });
```
```js

import { Circle } from './panda/jsx';

function App(){
return <Circle marginTop="2" marginRight="3" />;
return <Circle borderStyle="solid" borderColor="gray.900" borderWidth="1px" />;
}
```

Expand Down
2 changes: 1 addition & 1 deletion plugin/src/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export default {
'@pandacss/no-invalid-nesting': 'error',
'@pandacss/no-invalid-token-paths': 'error',
'@pandacss/no-property-renaming': 'warn',
'@pandacss/prefer-unified-property-style': 'warn',
'@pandacss/no-unsafe-token-fn-usage': 'warn',
},
}
8 changes: 3 additions & 5 deletions plugin/tests/prefer-unified-property-style.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const valids = [
code: javascript`
import { css } from './panda/css';
const styles = css({ borderColor: 'gray.900', borderWidth: '1px' })`,
const styles = css({ marginTop: "2", marginRight: "2", marginBottom: "2", marginLeft: "5" })`,
},

{
code: javascript`
import { Circle } from './panda/jsx';
function App(){
return <Circle marginTop="2" marginRight="3" />;
return <Circle borderStyle="solid" borderColor="gray.900" borderWidth="1px" />;
}`,
},
]
Expand All @@ -26,16 +26,14 @@ const invalids = [
code: javascript`
import { css } from './panda/css';
const color = 'red.100';
const styles = css({ borderRadius:"lg", borderTopRightRadius: "0" })`,
const styles = css({ margin:"2", marginLeft: "5" })`,
},

{
code: javascript`
import { Circle } from './panda/jsx';
function App(){
const bool = true;
return <Circle border="solid 1px" borderColor="gray.800" />;
}`,
},
Expand Down

0 comments on commit db8ac8e

Please sign in to comment.