From a0111a3a5a0c715df349c93cead14b9ea1610abf Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Thu, 12 Jan 2023 11:27:32 -0500 Subject: [PATCH] automatically use import/typescript config in base (#705) --- lib/config/base.js | 1 + lib/config/typescript.js | 7 +++---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/config/base.js b/lib/config/base.js index 29bb46c1..922645f2 100644 --- a/lib/config/base.js +++ b/lib/config/base.js @@ -154,6 +154,7 @@ module.exports = { { // Tweaks for TypeScript files that we can apply for users even if they don't happen to use our `typescript` config. files: ['*.ts'], + extends: ['plugin:import/typescript'], rules: { // Last parameter allows for exporting from a .d.ts file 'filenames/match-exported': ['error', 'kebab', '\\.d$'], diff --git a/lib/config/typescript.js b/lib/config/typescript.js index bfb2933c..0fb7d0ab 100644 --- a/lib/config/typescript.js +++ b/lib/config/typescript.js @@ -1,6 +1,8 @@ 'use strict'; // This configuration is intended for use in TypeScript projects. +// Any TypeScript config we can automatically apply for TypeScript files should be done in the `base` config override instead. +// @typescript-eslint related config must stay in this separate config as moving it to `base` would require a package.json dependency on typescript. module.exports = { extends: [require.resolve('./base')], @@ -9,10 +11,7 @@ module.exports = { overrides: [ { files: ['*.ts'], - extends: [ - 'plugin:@typescript-eslint/recommended', - 'plugin:import/typescript', - ], + extends: ['plugin:@typescript-eslint/recommended'], rules: { // https://github.com/typescript-eslint/typescript-eslint/issues/15#issuecomment-458224762 'no-useless-constructor': 'off',