From 7970f59a712ea5d5244021190b8f7fd2bd234575 Mon Sep 17 00:00:00 2001 From: CyanSalt Date: Mon, 8 Apr 2024 19:38:44 +0800 Subject: [PATCH] fix: re-enable eslint rules for ts --- flat/typescript/base.mjs | 28 ++++++++++++++++++++++++---- typescript/base.js | 20 ++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/flat/typescript/base.mjs b/flat/typescript/base.mjs index 53de77e..e01d303 100644 --- a/flat/typescript/base.mjs +++ b/flat/typescript/base.mjs @@ -1,6 +1,6 @@ -import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin'; -import typescriptEslintParser from '@typescript-eslint/parser'; -import { PATTERN_ALL } from '../pattern.mjs'; +import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin' +import typescriptEslintParser from '@typescript-eslint/parser' +import { PATTERN_ALL } from '../pattern.mjs' export default [ { @@ -22,5 +22,25 @@ export default [ plugins: { '@typescript-eslint': typescriptEslintPlugin, }, + rules: { + 'constructor-super': 'error', + 'getter-return': 'error', + 'no-const-assign': 'error', + 'no-dupe-args': 'error', + 'no-dupe-class-members': 'error', + 'no-dupe-keys': 'error', + 'no-func-assign': 'error', + 'no-import-assign': 'error', + 'no-new-symbol': 'error', + 'no-obj-calls': 'error', + // TS overload + // 'no-redeclare': 'error', + 'no-setter-return': 'error', + 'no-this-before-super': 'error', + // Global namespaces + // 'no-undef': 'error', + 'no-unreachable': 'error', + 'no-unsafe-negation': 'error', + }, }, -]; +] diff --git a/typescript/base.js b/typescript/base.js index 5bec86d..eb6dfc1 100644 --- a/typescript/base.js +++ b/typescript/base.js @@ -5,4 +5,24 @@ module.exports = { jsx: true, }, }, + rules: { + 'constructor-super': 'error', + 'getter-return': 'error', + 'no-const-assign': 'error', + 'no-dupe-args': 'error', + 'no-dupe-class-members': 'error', + 'no-dupe-keys': 'error', + 'no-func-assign': 'error', + 'no-import-assign': 'error', + 'no-new-symbol': 'error', + 'no-obj-calls': 'error', + // TS overload + // 'no-redeclare': 'error', + 'no-setter-return': 'error', + 'no-this-before-super': 'error', + // Global namespaces + // 'no-undef': 'error', + 'no-unreachable': 'error', + 'no-unsafe-negation': 'error', + }, }