Skip to content

Commit 8f811cd

Browse files
committed
chore: update readme
1 parent 262f9c5 commit 8f811cd

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

README.md

+5
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ export default [
9393
parser: typescriptParser,
9494
},
9595
rules: {
96+
// Configure rules here
97+
'@pandacss/no-debug': 'error',
98+
// You can also use the recommended rules
9699
...panda.configs.recommended.rules,
100+
// Or all rules
101+
...panda.configs.all.rules,
97102
},
98103
},
99104
]

README.md.template

+51
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,39 @@ Or enable all rules in extends:
7272
> [!WARNING]
7373
> This is not recommended. You should only enable the rules you need.
7474

75+
### Flat Config
76+
77+
If you use [the flat config format](https://eslint.org/docs/latest/use/configure/configuration-files), you can import
78+
the plugin and rules from `@pandacss/eslint-plugin` and put it into your config.
79+
80+
```js filename="eslint.config.mjs"
81+
import typescriptParser from '@typescript-eslint/parser'
82+
import panda from '@pandacss/eslint-plugin'
83+
84+
export default [
85+
{
86+
files: ['**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx'],
87+
ignores: ['**/*.d.ts', 'styled-system'],
88+
plugins: {
89+
'@pandacss': panda,
90+
},
91+
languageOptions: {
92+
parser: typescriptParser,
93+
},
94+
rules: {
95+
// Configure rules here
96+
"@pandacss/no-debug": "error",
97+
// You can also use the recommended rules
98+
...panda.configs.recommended.rules,
99+
// Or all rules
100+
...panda.configs.all.rules,
101+
},
102+
},
103+
]
104+
```
105+
106+
You can see an example using `typescript-eslint` at [sandbox/v9/eslint.config.mjs](./sandbox/v9/eslint.config.mjs).
107+
75108
## Rules
76109

77110
Rules with ⚙️ have options. Click on the rule to see the options.
@@ -98,3 +131,21 @@ module.exports = {
98131
},
99132
}
100133
```
134+
135+
#### Flat Config
136+
137+
```js filename="eslint.config.mjs"
138+
import panda from '@pandacss/eslint-plugin'
139+
import path from 'node:path'
140+
141+
export default [
142+
{
143+
plugins: {
144+
'@pandacss': panda,
145+
},
146+
settings: {
147+
'@pandacss/configPath': path.join('PATH-TO/panda.config.js'),
148+
},
149+
},
150+
]
151+
```

0 commit comments

Comments
 (0)