-
Notifications
You must be signed in to change notification settings - Fork 0
/
esm.js
33 lines (28 loc) · 1.07 KB
/
esm.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
require('@rushstack/eslint-patch/modern-module-resolution');
/**
* @type {import('eslint').Linter.Config}
**/
const eslintConfigESM = {
plugins: ['unicorn', 'import'],
rules: {
/**
* Prefer using ESM over legacy CommonJS modules
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md
*/
'unicorn/prefer-module': 'error',
/**
* Prefer using the `node:` protocol when importing Node.js builtin modules
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
*/
'unicorn/prefer-node-protocol': 'error',
/**
* Prefer top-level await over top-level promises and async function calls
* @see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-top-level-await.md
*/
'unicorn/prefer-top-level-await': 'error',
'import/extensions': ['error', 'always', { ignorePackages: true }],
'import/no-commonjs': 'error',
},
};
// eslint-disable-next-line no-undef
module.exports = eslintConfigESM;