From 8b2fa78ff4e58543ad34fa9783ff9e3298e8a57a Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Sat, 20 Feb 2021 16:56:50 +0700 Subject: [PATCH] Re-enable `import/extensions` --- config/plugins.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/config/plugins.js b/config/plugins.js index 4870641a..ea9ffd70 100644 --- a/config/plugins.js +++ b/config/plugins.js @@ -186,20 +186,18 @@ module.exports = { 'promise/prefer-await-to-then': 'error', 'import/default': 'error', 'import/export': 'error', - - // Disabled as we use `node/file-extension-in-import` instead as it has an auto-fix. - // 'import/extensions': [ - // 'error', - // 'always', - // { - // ignorePackages: true, - // // TypeScript doesn't yet support using extensions and fails with error TS2691. - // pattern: { - // ts: 'never', - // tsx: 'never' - // } - // } - // ], + 'import/extensions': [ + 'error', + 'always', + { + ignorePackages: true, + // TypeScript doesn't yet support using extensions and fails with error TS2691. + pattern: { + ts: 'never', + tsx: 'never' + } + } + ], // Disabled as it causes problems with TypeScript when you use mixed ESM and CommonJS. // TODO: Enable again when I target only ESM. @@ -283,6 +281,8 @@ module.exports = { // 'node/no-missing-require': 'error', 'node/no-unpublished-bin': 'error', + + // We have this enabled in addition to `import/extensions` as this one has an auto-fix. 'node/file-extension-in-import': [ 'error', 'always',