From 6fbec1f7e228f05abf32c952e561748537744fa5 Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sun, 11 Aug 2024 14:14:38 -0400 Subject: [PATCH] Update eslint to flat config --- eslint.config.js | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 9b32c44..12cca90 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,22 +1,28 @@ -// eslint.config.js -export default { - env: { - node: true, - es2021: true, - }, - extends: [ - 'eslint:recommended', - 'plugin:prettier/recommended', - ], - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', +// eslint.config.js (flat config) +import configRecommended from "eslint-config-eslint"; +import configPrettier from "eslint-config-prettier"; +import pluginPrettier from "eslint-plugin-prettier"; +import globals from "globals"; +import unusedImports from "eslint-plugin-unused-imports"; +import js from "@eslint/js"; + +export default [ + { + languageOptions: { + ecmaVersion: "latest", + sourceType: "module", + globals: { + ...globals.node, + }, }, rules: { - // Add your custom rules here - 'no-console': 'warn', - 'no-unused-vars': 'warn', - // Example: 'semi': ['error', 'always'] + "no-console": "warn", + "no-unused-vars": "warn", + "unused-imports/no-unused-imports": 1, }, - }; - \ No newline at end of file + }, + js.configs.recommended, + pluginPrettier.configs.recommended, + configPrettier, + unusedImports.configs.recommended, +];