Skip to content

Commit 2902611

Browse files
committed
Require ESM
1 parent ed00234 commit 2902611

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

index.js

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -365,18 +365,12 @@ module.exports = {
365365
checksVoidReturn: false
366366
}
367367
],
368-
369-
// TODO: Enable this again when I target ESM output in all my TypeScript projects
370-
// '@typescript-eslint/no-namespace': 'error',
371-
368+
'@typescript-eslint/no-namespace': 'error',
372369
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
373370
'@typescript-eslint/no-non-null-assertion': 'error',
374371
'no-redeclare': 'off',
375372
'@typescript-eslint/no-redeclare': 'error',
376-
377-
// TODO: Enable this again when I target ESM output in all my TypeScript projects
378-
// '@typescript-eslint/no-require-imports': 'error',
379-
373+
'@typescript-eslint/no-require-imports': 'error',
380374
'@typescript-eslint/no-this-alias': [
381375
'error',
382376
{
@@ -402,13 +396,10 @@ module.exports = {
402396
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
403397
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
404398
'@typescript-eslint/no-unsafe-argument': 'error',
405-
406-
// TODO: Enable these again when we can use ESM natively in Node.js. These rules cause problems with syntax like `import x = require('x');`
407-
// '@typescript-eslint/no-unsafe-assignment': 'error',
408-
// '@typescript-eslint/no-unsafe-call': 'error',
409-
// '@typescript-eslint/no-unsafe-member-access': 'error',
410-
// '@typescript-eslint/no-unsafe-return': 'error',
411-
399+
'@typescript-eslint/no-unsafe-assignment': 'error',
400+
'@typescript-eslint/no-unsafe-call': 'error',
401+
'@typescript-eslint/no-unsafe-member-access': 'error',
402+
'@typescript-eslint/no-unsafe-return': 'error',
412403
'no-unused-expressions': 'off',
413404
'@typescript-eslint/no-unused-expressions': 'error',
414405
'no-unused-vars': 'off',
@@ -518,9 +509,8 @@ module.exports = {
518509
'error',
519510
{
520511
path: 'never',
521-
522-
// Cannot enable this until `@types/node` no longer has the `NodeJS` global
523-
// types: 'never'
512+
types: 'never',
513+
lib: 'never'
524514
}
525515
],
526516
'@typescript-eslint/type-annotation-spacing': 'error',

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
> ESLint [shareable config](https://eslint.org/docs/developer-guide/shareable-configs.html) for TypeScript to be used with [eslint-config-xo](https://github.com/xojs/eslint-config-xo)
44
5+
**This config assumes your project is [ESM](https://nodejs.org/api/esm.html).**
6+
57
## Install
68

79
```

0 commit comments

Comments
 (0)