Skip to content

Commit dd30aa3

Browse files
committed
feat: support eslint 9
Add flat config preset
1 parent c3ddcd9 commit dd30aa3

File tree

1 file changed

+25
-13
lines changed

1 file changed

+25
-13
lines changed

lib/index.js

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
11
"use strict";
22

3-
module.exports = {
4-
configs: {
5-
"getify-says": {
6-
plugins: [ "@getify/proper-arrows", ],
7-
rules: {
8-
"@getify/proper-arrows/params": [ "error", { "unused": "trailing", "count": 2, "length": 3, "allowed": [ "e", "v", "cb", "fn", "pr", ], }, ],
9-
"@getify/proper-arrows/name": "error",
10-
"@getify/proper-arrows/return": [ "error", { "ternary": 1, }, ],
11-
"@getify/proper-arrows/where": "error",
12-
"@getify/proper-arrows/this": [ "error", "nested", { "no-global": true, }, ],
13-
},
14-
},
15-
},
3+
var recommendedRulesConfig = {
4+
"@getify/proper-arrows/params": [ "error", { "unused": "trailing", "count": 2, "length": 3, "allowed": [ "e", "v", "cb", "fn", "pr", ], }, ],
5+
"@getify/proper-arrows/name": "error",
6+
"@getify/proper-arrows/return": [ "error", { "ternary": 1, }, ],
7+
"@getify/proper-arrows/where": "error",
8+
"@getify/proper-arrows/this": [ "error", "nested", { "no-global": true, }, ],
9+
}
10+
11+
var plugin = {
1612
rules: {
1713
"params": {
1814
meta: {
@@ -636,6 +632,20 @@ module.exports = {
636632
},
637633
};
638634

635+
plugin.configs = {
636+
"getify-says": {
637+
plugins: [ "@getify/proper-arrows", ],
638+
rules: recommendedRulesConfig,
639+
},
640+
"getify-says/flat": {
641+
name: "getify-says/flat",
642+
plugins: {
643+
"@getify/proper-arrows": plugin
644+
},
645+
rules: recommendedRulesConfig,
646+
},
647+
};
648+
639649

640650
// ***************************
641651

@@ -837,3 +847,5 @@ var getAncestors = (context, sourceCode, node) => {
837847
);
838848
return getAncestors(context, sourceCode, node);
839849
};
850+
851+
module.exports = plugin;

0 commit comments

Comments
 (0)