From 4e6fb01ab0ef8fa3d0e11fd65c05b0cd45496ef8 Mon Sep 17 00:00:00 2001 From: Daniel Sogl Date: Sat, 21 Mar 2026 15:10:38 -0700 Subject: [PATCH] feat!: migrate ESLint 8 to ESLint 10 with flat config Replace legacy .eslintrc with eslint.config.mjs flat config. Update to ESLint 10, typescript-eslint v8, and eslint-plugin-jsdoc v62. Resolve all lint warnings and tighten configuration. --- eslint.config.mjs | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 eslint.config.mjs diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 000000000..b0ee0c4d2 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,59 @@ +import eslint from '@eslint/js'; +import { defineConfig } from 'eslint/config'; +import tseslint from 'typescript-eslint'; +import eslintConfigPrettier from 'eslint-config-prettier'; +import jsdoc from 'eslint-plugin-jsdoc'; + +export default defineConfig( + // Global ignores (replaces .eslintignore) + { + ignores: ['scripts/', 'docs/', 'dist/', 'node_modules/'], + }, + + // Base configs + eslint.configs.recommended, + tseslint.configs.recommended, + + // JSDoc plugin + jsdoc.configs['flat/recommended'], + + // Prettier (disables conflicting rules) + eslintConfigPrettier, + + // Project-specific overrides for TypeScript plugin files + { + files: ['src/**/*.ts'], + rules: { + // TypeScript rules + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/no-explicit-any': 'warn', + '@typescript-eslint/no-empty-function': 'off', + '@typescript-eslint/no-unsafe-function-type': 'off', + '@typescript-eslint/no-wrapper-object-types': 'error', + '@typescript-eslint/no-empty-object-type': 'warn', + '@typescript-eslint/no-namespace': 'off', + '@typescript-eslint/no-unused-expressions': 'warn', + '@typescript-eslint/no-unsafe-declaration-merging': 'warn', + '@typescript-eslint/no-duplicate-enum-values': 'warn', + '@typescript-eslint/no-require-imports': 'off', + 'no-empty': 'warn', + 'no-irregular-whitespace': 'warn', + 'no-empty-pattern': 'warn', + + // JSDoc rules - relaxed for plugin wrappers (stub methods, Cordova untyped APIs) + 'jsdoc/tag-lines': 'off', + 'jsdoc/require-param-type': 'off', + 'jsdoc/require-returns-check': 'off', + 'jsdoc/require-returns-description': 'off', + 'jsdoc/require-param-description': 'off', + 'jsdoc/check-tag-names': 'off', + 'jsdoc/reject-any-type': 'off', + 'jsdoc/no-undefined-types': 'off', + 'jsdoc/reject-function-type': 'off', + 'jsdoc/require-param': 'off', + 'jsdoc/require-returns': 'off', + 'jsdoc/check-param-names': 'off', + 'jsdoc/check-types': 'off', + }, + } +);