diff --git a/.eslintrc.json b/.eslintrc.json index 7e7ac3a2..b42aaf5c 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -10,8 +10,9 @@ "plugins": [ "compat", "deprecation", - "@typescript-eslint", - "simple-import-sort" + "prefer-arrow-functions", + "simple-import-sort", + "@typescript-eslint" ], "extends": [ "eslint:recommended", @@ -20,13 +21,20 @@ "plugin:@typescript-eslint/stylistic-type-checked" ], "rules": { + "arrow-body-style": ["error", "as-needed"], "camelcase": "error", + "no-warning-comments": "warn", + "strict": ["error", "never"], "compat/compat": "warn", "deprecation/deprecation": "warn", - "no-warning-comments": "warn", + "prefer-arrow-functions/prefer-arrow-functions": [ + "error", + { + "allowNamedFunctions": true + } + ], "simple-import-sort/imports": "error", "simple-import-sort/exports": "error", - "strict": ["error", "never"], "@typescript-eslint/array-type": ["error", {"default": "generic"}], "@typescript-eslint/consistent-type-exports": "error", "@typescript-eslint/consistent-type-imports": "error", diff --git a/package-lock.json b/package-lock.json index f66033cf..e388956c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -32,6 +32,7 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-compat": "^4.2.0", "eslint-plugin-deprecation": "^2.0.0", + "eslint-plugin-prefer-arrow-functions": "^3.2.4", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-simple-import-sort": "^10.0.0", "gulp": "^4.0.2", @@ -5439,6 +5440,15 @@ } } }, + "node_modules/eslint-plugin-prefer-arrow-functions": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow-functions/-/eslint-plugin-prefer-arrow-functions-3.2.4.tgz", + "integrity": "sha512-HbPmlbO/iYQeVs2fuShNkGVJDfVfgSd84Vzxv+xlh+nIVoSsZvTj6yOqszw4mtG9JbiqMShVWqbVeoVsejE59w==", + "dev": true, + "peerDependencies": { + "eslint": ">=5.0.0" + } + }, "node_modules/eslint-plugin-prettier": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-5.0.1.tgz", diff --git a/package.json b/package.json index 810241fb..6b53c7ea 100644 --- a/package.json +++ b/package.json @@ -56,6 +56,7 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-compat": "^4.2.0", "eslint-plugin-deprecation": "^2.0.0", + "eslint-plugin-prefer-arrow-functions": "^3.2.4", "eslint-plugin-prettier": "^5.0.1", "eslint-plugin-simple-import-sort": "^10.0.0", "gulp": "^4.0.2",