Skip to content

Commit

Permalink
automatically use import/typescript config in base (#705)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish authored Jan 12, 2023
1 parent 40371bb commit a0111a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/config/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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$'],
Expand Down
7 changes: 3 additions & 4 deletions lib/config/typescript.js
Original file line number Diff line number Diff line change
@@ -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')],
Expand All @@ -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',
Expand Down

0 comments on commit a0111a3

Please sign in to comment.