-
Notifications
You must be signed in to change notification settings - Fork 0
/
esm.js
42 lines (40 loc) · 931 Bytes
/
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
34
35
36
37
38
39
40
41
42
module.exports = {
// Include unicorn and import plugin
"plugins": [
"import",
"unicorn",
],
"rules": {
// Reason: Error on use of any non-module API
"unicorn/prefer-module": "error",
// Reason: File paths and extensions must fully resolve for the current version of ESM
"import/extensions": [
"error",
"always",
// Packages will always be resolved by node or a bundler
{
ignorePackages: true,
pattern: {
ts: "never",
cts: "never",
mts: "never",
tsx: "never",
},
},
],
// Reason: Doesn't work correctly when using ESM
// See: https://github.com/import-js/eslint-plugin-import/issues/2442
"import/no-named-as-default-member": "off",
},
"overrides": [
{
"files": [
"**/*.{cjs,cts}",
],
"rules": {
// Reason: Using `.cjs` is an explicit opt-out of the package's default module behavior
"unicorn/prefer-module": "off",
},
},
],
};