From 8ae3d7bb3b4a025aed238147502ab6d10f15541c Mon Sep 17 00:00:00 2001 From: michael faith Date: Fri, 20 Jun 2025 13:03:01 -0500 Subject: [PATCH] build: fix eslint.config following esm update This change updates the eslint config to use `sourceType: 'module'`, and swaps n's `flat/mixed-esm-and-cjs` config for `flat/recommended` which will use the module type from the nearest `package.json`. --- eslint.config.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index e789fccf..f34afb74 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -13,13 +13,21 @@ const compat = new FlatCompat({ }); export default [ + // Global ignores + { + ignores: ['node_modules', 'coverage'], + }, + // Global settings + { + languageOptions: { sourceType: 'module' }, + }, ...compat.extends( 'not-an-aardvark/node', 'plugin:@eslint-community/eslint-comments/recommended', 'plugin:prettier/recommended', 'plugin:unicorn/recommended', ), - ...pluginN.configs['flat/mixed-esm-and-cjs'], + pluginN.configs['flat/recommended'], { rules: { '@eslint-community/eslint-comments/no-unused-disable': 'error', @@ -52,10 +60,6 @@ export default [ ], }, }, - { - files: ['tests/**/*.js'], - languageOptions: { sourceType: 'module' }, - }, { files: ['**/*.md'], plugins: { markdown },