From a21171309fd86fe05521ae80994398551f40f1a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20B=C3=B6hm?= Date: Wed, 31 Aug 2022 10:50:38 +0200 Subject: [PATCH] feat(eslint): add more typescript specific rules (#25) --- .changeset/spotty-coats-carry.md | 5 +++++ packages/eslint-config/base.js | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 .changeset/spotty-coats-carry.md diff --git a/.changeset/spotty-coats-carry.md b/.changeset/spotty-coats-carry.md new file mode 100644 index 0000000..ddf7507 --- /dev/null +++ b/.changeset/spotty-coats-carry.md @@ -0,0 +1,5 @@ +--- +"@mheob/eslint-config": patch +--- + +Add more typescript specific rules. diff --git a/packages/eslint-config/base.js b/packages/eslint-config/base.js index 9a5ec01..c97b0c4 100644 --- a/packages/eslint-config/base.js +++ b/packages/eslint-config/base.js @@ -33,13 +33,19 @@ module.exports = { rules: { 'unicorn/filename-case': ['error', { case: 'camelCase' }] }, }, { - files: ['*.ts'], + files: ['*.ts', '*.tsx'], extends: ['plugin:@typescript-eslint/recommended'], rules: { + '@typescript-eslint/consistent-type-imports': 'error', '@typescript-eslint/explicit-function-return-type': [ 'warn', { allowExpressions: true, allowTypedFunctionExpressions: true }, ], + '@typescript-eslint/no-unused-vars': [ + 'warn', + { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }, + ], + '@typescript-eslint/quotes': ['warn', 'single', { avoidEscape: true }], }, }, ],