File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -13,9 +13,19 @@ npm install --save-dev eslint eslint-plugin-prefer-arrow-functions
1313
1414### Flat
1515
16- For ESLint 9 and above.
16+ For ESLint 9 and above, use the shared config ` all ` in ` eslint.config.mjs ` :
1717
18- ` eslint.config.mjs ` :
18+ ``` js
19+ import pluginJs from ' @eslint/js' ;
20+ import preferArrowFunctions from ' eslint-plugin-prefer-arrow-functions' ;
21+
22+ export default [
23+ pluginJs .configs .all ,
24+ preferArrowFunctions .configs .all ,
25+ ];
26+ ```
27+
28+ Or configure the rule(s) on your own:
1929
2030``` js
2131import pluginJs from ' @eslint/js' ;
Original file line number Diff line number Diff line change @@ -17,4 +17,14 @@ const plugin: TSESLint.FlatConfig.Plugin = {
1717 rules,
1818} ;
1919
20+ export const configs : TSESLint . FlatConfig . SharedConfigs = {
21+ all : {
22+ plugins : { 'prefer-arrow-functions' : plugin } ,
23+ rules : {
24+ 'prefer-arrow-functions/prefer-arrow-functions' : 'warn' ,
25+ } ,
26+ } ,
27+ } ;
28+ plugin . configs = configs ;
29+
2030export default plugin ;
You can’t perform that action at this time.
0 commit comments