From 50b334eb0e945308215f0e3b6432c31865435d67 Mon Sep 17 00:00:00 2001 From: Marc-Antoine Parent Date: Mon, 30 Jun 2025 20:57:40 -0400 Subject: [PATCH] add preferArrows, naming conventions, max-params. --- package-lock.json | 14 ++++++++++++++ packages/eslint-config/base.js | 20 ++++++++++++++++++++ packages/eslint-config/package.json | 1 + 3 files changed, 35 insertions(+) diff --git a/package-lock.json b/package-lock.json index 984df8a78..b55ecf36b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12113,6 +12113,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint-plugin-prefer-arrow-functions": { + "version": "3.4.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow-functions/-/eslint-plugin-prefer-arrow-functions-3.4.2.tgz", + "integrity": "sha512-lwmu9Q4EfxR/R0g1xJ6XvhkMHKJlv3BtW9+RHctGIiDK+IjvhB7WkNtao646EOhFDLs9QoLUBVE+pnymarCk6w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.0.0" + }, + "peerDependencies": { + "eslint": ">=8.0.0" + } + }, "node_modules/eslint-plugin-react": { "version": "7.37.2", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.2.tgz", @@ -19837,6 +19850,7 @@ "eslint-config-prettier": "^10.1.5", "eslint-config-turbo": "^2.5.4", "eslint-plugin-only-warn": "^1.1.0", + "eslint-plugin-prefer-arrow-functions": "3.4.2", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^5.2.0", "globals": "16.2.0", diff --git a/packages/eslint-config/base.js b/packages/eslint-config/base.js index 24562df27..61a18c274 100644 --- a/packages/eslint-config/base.js +++ b/packages/eslint-config/base.js @@ -3,6 +3,7 @@ import eslintConfigPrettier from "eslint-config-prettier"; import turboPlugin from "eslint-plugin-turbo"; import tseslint from "typescript-eslint"; import onlyWarn from "eslint-plugin-only-warn"; +import preferArrows from "eslint-plugin-prefer-arrow-functions"; /** * A shared ESLint configuration for the repository. @@ -21,6 +22,25 @@ export const config = [ "turbo/no-undeclared-env-vars": "warn", }, }, + { + plugins: { + preferArrows, + }, + rules: { + "max-params": ["error", 3], + "@typescript-eslint/naming-convention": "error", + "preferArrows/prefer-arrow-functions": [ + "warn", + { + allowNamedFunctions: false, + classPropertiesAllowed: false, + disallowPrototype: false, + returnStyle: "unchanged", + singleReturnOnly: false, + }, + ], + }, + }, { plugins: { onlyWarn, diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 835255f6e..abb9d3dc6 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -16,6 +16,7 @@ "eslint-config-prettier": "^10.1.5", "eslint-config-turbo": "^2.5.4", "eslint-plugin-only-warn": "^1.1.0", + "eslint-plugin-prefer-arrow-functions": "3.4.2", "eslint-plugin-react": "^7.37.2", "eslint-plugin-react-hooks": "^5.2.0", "eslint": "^8.57.1",