Skip to content

Commit d23bb68

Browse files
committed
add preferArrows, naming conventions, max-params.
1 parent bc72442 commit d23bb68

File tree

4 files changed

+48
-2
lines changed

4 files changed

+48
-2
lines changed

package-lock.json

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/eslint-config/next.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { fileURLToPath } from "url";
55
import tseslint from "@typescript-eslint/eslint-plugin";
66
import prettier from "eslint-config-prettier";
77
import onlyWarn from "eslint-plugin-only-warn";
8+
import preferArrows from "eslint-plugin-prefer-arrow-functions";
89
import vercel from "@vercel/style-guide/eslint/next";
910
import globals from "globals";
1011
import next_eslint from "@next/eslint-plugin-next";
@@ -45,14 +46,29 @@ export default [
4546
},
4647
},
4748
},
48-
plugins: { "only-warn": onlyWarn },
49+
plugins: { "only-warn": onlyWarn, "prefer-arrow-functions": preferArrows },
4950
settings: {
5051
"import/resolver": {
5152
typescript: {
5253
project: "tsconfig.lint.json",
5354
},
5455
},
5556
},
57+
rules: {
58+
"max-params": ["error", 3],
59+
"@typescript-eslint/naming-convention": "error",
60+
"prefer-arrow-functions/prefer-arrow-functions": [
61+
"warn",
62+
{
63+
allowNamedFunctions: false,
64+
classPropertiesAllowed: false,
65+
disallowPrototype: false,
66+
returnStyle: "unchanged",
67+
singleReturnOnly: false,
68+
},
69+
],
70+
},
71+
// Force ESLint to detect .tsx files
5672
files: ["**/*.ts?(x)", "**/*.js?(x)"],
5773
},
5874
{

packages/eslint-config/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"eslint-config-turbo": "^2.3.0",
2020
"eslint-plugin-only-warn": "^1.1.0",
2121
"eslint": "^8.57.1",
22+
"eslint-plugin-prefer-arrow-functions": "3.4.2",
2223
"globals": "16.2.0",
2324
"typescript": "5.5.4"
2425
}

packages/eslint-config/react-internal.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { fileURLToPath } from "url";
55
import tseslint from "@typescript-eslint/eslint-plugin";
66
import prettier from "eslint-config-prettier";
77
import onlyWarn from "eslint-plugin-only-warn";
8+
import preferArrows from "eslint-plugin-prefer-arrow-functions";
89
import globals from "globals";
910

1011
// this could just be import.meta.dirname if we set minimun node to 20.11
@@ -41,14 +42,28 @@ export default [
4142
},
4243
},
4344
},
44-
plugins: { "only-warn": onlyWarn },
45+
plugins: { "only-warn": onlyWarn, "prefer-arrow-functions": preferArrows },
4546
settings: {
4647
"import/resolver": {
4748
typescript: {
4849
project: "tsconfig.lint.json",
4950
},
5051
},
5152
},
53+
rules: {
54+
"max-params": ["error", 3],
55+
"@typescript-eslint/naming-convention": "error",
56+
"prefer-arrow-functions/prefer-arrow-functions": [
57+
"warn",
58+
{
59+
allowNamedFunctions: false,
60+
classPropertiesAllowed: false,
61+
disallowPrototype: false,
62+
returnStyle: "unchanged",
63+
singleReturnOnly: false,
64+
},
65+
],
66+
},
5267
// Force ESLint to detect .tsx files
5368
files: ["**/*.ts?(x)", "**/*.js?(x)"],
5469
},

0 commit comments

Comments
 (0)