From 637a24792ce524f45d2325c04536fade8a97787b Mon Sep 17 00:00:00 2001 From: Bjarke Madsen <bjarke@nordu.net> Date: Mon, 10 Feb 2025 11:31:07 +0100 Subject: [PATCH] Unify eslint config with output from default vscode typescript features formatting --- compendium-frontend/eslint.config.mjs | 14 +++++++++++--- compendium-frontend/package.json | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/compendium-frontend/eslint.config.mjs b/compendium-frontend/eslint.config.mjs index ef146e45..b9603c34 100644 --- a/compendium-frontend/eslint.config.mjs +++ b/compendium-frontend/eslint.config.mjs @@ -46,10 +46,11 @@ export default [ }, rules: { - // these are not needed with React 19 + // react import isn't needed with React 19 "react/jsx-uses-react": "off", "react/react-in-jsx-scope": "off", - + + // general rules "react-hooks/rules-of-hooks": "error", "react-hooks/exhaustive-deps": "warn", "react/prop-types": "off", @@ -60,8 +61,15 @@ export default [ argsIgnorePattern: "^_", }, ], + "no-multiple-empty-lines": [ + "error", + { + max: 1, + maxBOF: 0, + maxEOF: 0, + }, + ] - "@typescript-eslint/no-empty-function": "off", }, }, ]; diff --git a/compendium-frontend/package.json b/compendium-frontend/package.json index 9dce0314..9c5d982a 100644 --- a/compendium-frontend/package.json +++ b/compendium-frontend/package.json @@ -24,7 +24,8 @@ "scripts": { "start": "vite", "build": "(eslint && vite build --emptyOutDir) || echo 'eslint failed, build aborted'", - "lint": "eslint" + "lint": "eslint", + "lint:fix": "eslint --fix" }, "dependencies": { "bootstrap": "~5.3.3", -- GitLab