Skip to content

Commit 0b708d7

Browse files
authored
build: fix eslint.config following esm update (eslint-community#527)
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`.
1 parent 9cd5af8 commit 0b708d7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

eslint.config.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@ const compat = new FlatCompat({
1313
});
1414

1515
export default [
16+
// Global ignores
17+
{
18+
ignores: ['node_modules', 'coverage'],
19+
},
20+
// Global settings
21+
{
22+
languageOptions: { sourceType: 'module' },
23+
},
1624
...compat.extends(
1725
'not-an-aardvark/node',
1826
'plugin:@eslint-community/eslint-comments/recommended',
1927
'plugin:prettier/recommended',
2028
'plugin:unicorn/recommended',
2129
),
22-
...pluginN.configs['flat/mixed-esm-and-cjs'],
30+
pluginN.configs['flat/recommended'],
2331
{
2432
rules: {
2533
'@eslint-community/eslint-comments/no-unused-disable': 'error',
@@ -52,10 +60,6 @@ export default [
5260
],
5361
},
5462
},
55-
{
56-
files: ['tests/**/*.js'],
57-
languageOptions: { sourceType: 'module' },
58-
},
5963
{
6064
files: ['**/*.md'],
6165
plugins: { markdown },

0 commit comments

Comments
 (0)