From 10f58c143f855eec82eec63867795c4702a59b36 Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 25 Dec 2025 07:18:44 +0000 Subject: [PATCH 1/2] feat: simplify ESLint config - use Prettier for formatting, ESLint for correctness only --- .eslintrc.json | 63 ++++-------------------------------------------- .prettierrc.json | 8 +++--- 2 files changed, 8 insertions(+), 63 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 825c5fe69..23f47f386 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,67 +1,14 @@ { - "env": { - "browser": true, - "es2021": true, - "node": true, - "jest": true - }, + "root": true, + "parser": "@typescript-eslint/parser", + "plugins": ["@typescript-eslint", "simple-import-sort"], "extends": [ "eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier" ], - "overrides": [], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint", - "simple-import-sort", - "unused-imports" - ], "rules": { - "indent": [ - "error", - 2 - ], - "quotes": [ - "error", - "single", - { - "avoidEscape": true, - "allowTemplateLiterals": true - } - ], - "quote-props": [ - "error", - "as-needed" - ], - "semi": [ - "error", - "always" - ], - "comma-dangle": [ - "error", - "never" - ], - "simple-import-sort/imports": 1, - "simple-import-sort/exports": 1, - "unused-imports/no-unused-imports": 1, - "@typescript-eslint/no-unused-vars": [ - 1, - { - "argsIgnorePattern": "React|res|next|^_" - } - ], - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/no-var-requires": 0, - "no-console": 0, - "@typescript-eslint/ban-ts-comment": 0, - "prefer-const": 0, - "no-case-declarations": 0, - "no-implicit-globals": 0, - "@typescript-eslint/no-unsafe-declaration-merging": 0 + "simple-import-sort/imports": "error", + "simple-import-sort/exports": "error" } } diff --git a/.prettierrc.json b/.prettierrc.json index db6adc6e0..c06cd1fd0 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,8 +1,6 @@ { - "trailingComma": "es5", - "tabWidth": 2, + "printWidth": 80, "semi": true, - "useTabs": false, "singleQuote": true, - "jsxSingleQuote": false -} \ No newline at end of file + "trailingComma": "all" +} From 822c776f8a6828d7811a15b62ad7d7522204465b Mon Sep 17 00:00:00 2001 From: Dan Lynch Date: Thu, 25 Dec 2025 07:20:09 +0000 Subject: [PATCH 2/2] chore: switch to ESLint flat config (required for ESLint 9) --- .eslintrc.json | 14 -------------- eslint.config.js | 31 +++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 14 deletions(-) delete mode 100644 .eslintrc.json create mode 100644 eslint.config.js diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 23f47f386..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint", "simple-import-sort"], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "prettier" - ], - "rules": { - "simple-import-sort/imports": "error", - "simple-import-sort/exports": "error" - } -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 000000000..da73072fd --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,31 @@ +const tseslint = require('@typescript-eslint/eslint-plugin'); +const tsparser = require('@typescript-eslint/parser'); +const simpleImportSort = require('eslint-plugin-simple-import-sort'); +const prettierConfig = require('eslint-config-prettier'); + +module.exports = [ + { + ignores: ['**/node_modules/**', '**/dist/**', '**/build/**', '**/coverage/**'], + }, + { + files: ['**/*.ts', '**/*.tsx'], + languageOptions: { + parser: tsparser, + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + }, + }, + plugins: { + '@typescript-eslint': tseslint, + 'simple-import-sort': simpleImportSort, + }, + rules: { + ...tseslint.configs.recommended.rules, + 'simple-import-sort/imports': 'error', + 'simple-import-sort/exports': 'error', + 'no-undef': 'off', + }, + }, + prettierConfig, +];