From dd76d5d8d9e0f016a00ab92f65cadb1655395c1c Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Sun, 12 Dec 2021 08:17:49 +0800 Subject: [PATCH] feat: update ts rules, enforce import type --- packages/basic/index.js | 1 + packages/typescript/index.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/basic/index.js b/packages/basic/index.js index dbd8002..fc1e996 100644 --- a/packages/basic/index.js +++ b/packages/basic/index.js @@ -228,5 +228,6 @@ module.exports = { 'no-use-before-define': ['error', { functions: false, classes: false, variables: true }], 'eslint-comments/disable-enable-pair': 'off', + 'import/no-named-as-default-member': 'off', }, } diff --git a/packages/typescript/index.js b/packages/typescript/index.js index 6fcb14e..1159768 100644 --- a/packages/typescript/index.js +++ b/packages/typescript/index.js @@ -11,17 +11,21 @@ module.exports = { 'import/named': 'off', // TS - 'no-useless-constructor': 'off', '@typescript-eslint/semi': ['error', 'never'], '@typescript-eslint/member-delimiter-style': ['error', { multiline: { delimiter: 'none' } }], '@typescript-eslint/type-annotation-spacing': ['error', {}], + '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: false }], + // Override JS + 'no-useless-constructor': 'off', 'indent': 'off', '@typescript-eslint/indent': ['error', 2], 'no-unused-vars': 'off', '@typescript-eslint/no-unused-vars': 'error', 'no-redeclare': 'off', '@typescript-eslint/no-redeclare': 'error', + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': ['error'], // off '@typescript-eslint/camelcase': 'off',