From 01cd9e1008800bb010c84458acea2728ae22c64a Mon Sep 17 00:00:00 2001 From: beefchimi Date: Thu, 30 May 2024 15:21:36 -0400 Subject: [PATCH] :hammer_and_wrench: [Eslint] Migrate config file --- .eslintignore | 3 --- eslint.config.mjs | 49 ++++++++++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 21 deletions(-) delete mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 06c3eac..0000000 --- a/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/ -coverage/ -dist/ diff --git a/eslint.config.mjs b/eslint.config.mjs index ad82916..1ca9d16 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -1,20 +1,33 @@ -{ - "env": { - "browser": true, - "es2022": true, +import globals from 'globals'; +import configLove from 'eslint-config-love'; +// Includes both `config` and `plugin`. +import pluginPrettier from 'eslint-plugin-prettier/recommended'; + +export default [ + { + ignores: ['coverage/**', 'dist/**'], }, - "extends": ["love", "plugin:prettier/recommended"], - "parserOptions": { - "ecmaVersion": "latest", - "sourceType": "module", - "project": "./tsconfig.json", + configLove, + pluginPrettier, + { + name: 'custom-rules', + files: ['**/*.ts', '**/*.js', '**/*.mjs'], + languageOptions: { + ...configLove.languageOptions, + globals: { + ...globals.browser, + }, + ecmaVersion: 2022, + sourceType: 'module', + }, + rules: { + 'no-console': 'warn', + '@typescript-eslint/explicit-function-return-type': 'off', + // '@typescript-eslint/strict-boolean-expressions': 'off', + '@typescript-eslint/consistent-indexed-object-style': [ + 'error', + 'index-signature', + ], + }, }, - "rules": { - "no-console": "warn", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/consistent-indexed-object-style": [ - "error", - "index-signature", - ], - }, -} +];