@@ -72,6 +72,39 @@ Or enable all rules in extends:
72
72
> [!WARNING]
73
73
> This is not recommended. You should only enable the rules you need.
74
74
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
+
75
108
## Rules
76
109
77
110
Rules with ⚙️ have options. Click on the rule to see the options.
@@ -98,3 +131,21 @@ module.exports = {
98
131
},
99
132
}
100
133
```
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