You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [plugin`meta`object](plugins#meta-data-in-plugins) providesinformationaboutthepluginitself. Whenaprocessorisspecifiedusingthestringformat`plugin-name/processor-name`, ESLintautomaticallyusestheplugin`meta`togenerateanamefortheprocessor. Thisisthemostcommoncaseforprocessors.
150
+
151
+
Example:
152
+
153
+
```js
154
+
// eslint.config.js
155
+
import example from "eslint-plugin-example";
156
+
157
+
export default [
158
+
{
159
+
plugins: {
160
+
example
161
+
},
162
+
processor: "example/processor-name"
163
+
},
164
+
// ... other configs
165
+
];
166
+
```
167
+
168
+
Inthisexample, theprocessornameis`"example/processor-name"`, andthat's the value that will be used for serializing configurations.
169
+
170
+
#### Processor`meta`Object
171
+
172
+
Eachprocessorcanalsospecifyitsown`meta`object. Thisinformationisusedwhentheprocessorobjectispasseddirectlyto`processor`inaconfiguration. Inthatcase, ESLintdoesn't know which plugin the processor belongs to. The `meta.name` property should match the processor name and the `meta.version` property should match the npm package version for your processors. The easiest way to accomplish this is by reading this information from your `package.json`.
173
+
174
+
Example:
175
+
176
+
```js
177
+
// eslint.config.js
178
+
import example from "eslint-plugin-example";
179
+
180
+
export default [
181
+
{
182
+
processor: example.processors["processor-name"]
183
+
},
184
+
// ... other configs
185
+
];
186
+
```
187
+
188
+
Inthisexample, specifying`example.processors["processor-name"]`directlyusestheprocessor's own `meta` object, which must be defined to ensure proper handling when the processor is not referenced through the plugin name.
Copy file name to clipboardExpand all lines: docs/src/extend/plugin-migration-flat-config.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,9 @@ No changes are necessary for the `rules` key in your plugin. Everything works th
63
63
64
64
## Migrating Processors for Flat Config
65
65
66
-
No changes are necessary for the `processors` key in your plugin as long as you aren't using file extension-named processors. If you have any [file extension-named processors](custom-processors-deprecated#file-extension-named-processor), you must update the name to a valid identifier (numbers and letters). File extension-named processors were automatically applied in the old configuration system but are not automatically applied when using flat config. Here is an example of a file extension-named processor:
66
+
Each processor should specify a `meta` object. For more information, see the [full documentation](custom-processors).
67
+
68
+
No other changes are necessary for the `processors` key in your plugin as long as you aren't using file extension-named processors. If you have any [file extension-named processors](custom-processors-deprecated#file-extension-named-processor), you must update the name to a valid identifier (numbers and letters). File extension-named processors were automatically applied in the old configuration system but are not automatically applied when using flat config. Here is an example of a file extension-named processor:
0 commit comments