From 39c8ec33e52b54dcb2b8cb0b20f0842ad3e410f8 Mon Sep 17 00:00:00 2001 From: Will Schurman Date: Thu, 9 Apr 2026 09:51:52 -0700 Subject: [PATCH] chore: explicitly enable more rules that are on by default --- shared/typescript-analysis.js | 4 ++++ shared/typescript.js | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/shared/typescript-analysis.js b/shared/typescript-analysis.js index face932..53f4488 100644 --- a/shared/typescript-analysis.js +++ b/shared/typescript-analysis.js @@ -15,13 +15,17 @@ export default defineConfig({ }, rules: { 'typescript/await-thenable': 'warn', + 'typescript/no-array-delete': 'warn', 'typescript/no-confusing-non-null-assertion': 'warn', 'typescript/no-confusing-void-expression': 'warn', 'typescript/no-extra-non-null-assertion': 'warn', 'typescript/no-floating-promises': 'warn', 'typescript/no-implied-eval': 'warn', 'typescript/no-for-in-array': 'error', + 'typescript/no-meaningless-void-operator': 'warn', 'typescript/no-misused-promises': ['error', { checksVoidReturn: false }], + 'typescript/no-misused-spread': 'warn', + 'typescript/no-this-alias': 'warn', 'typescript/no-unnecessary-type-assertion': 'warn', 'typescript/only-throw-error': 'warn', 'typescript/prefer-as-const': 'warn', diff --git a/shared/typescript.js b/shared/typescript.js index ea4d909..ccd6a74 100644 --- a/shared/typescript.js +++ b/shared/typescript.js @@ -6,8 +6,19 @@ import { defineConfig } from 'oxlint'; export default defineConfig({ plugins: ['typescript'], rules: { + 'typescript/array-type': ['warn', { default: 'array' }], + 'typescript/consistent-type-assertions': [ + 'warn', + { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }, + ], 'typescript/no-dupe-class-members': 'warn', + 'typescript/no-duplicate-enum-values': 'warn', + 'typescript/no-empty-object-type': ['warn', { allowInterfaces: 'with-single-extends' }], + 'typescript/no-extra-non-null-assertion': 'warn', + 'typescript/no-misused-new': 'warn', 'typescript/no-redeclare': 'warn', + 'typescript/no-unsafe-declaration-merging': 'warn', + 'typescript/no-unnecessary-parameter-property-assignment': 'warn', 'typescript/no-unused-expressions': ['warn', { allowShortCircuit: true, enforceForJSX: true }], 'typescript/no-unused-vars': [ 'warn', @@ -20,14 +31,9 @@ export default defineConfig({ }, ], 'typescript/no-useless-constructor': 'warn', - 'typescript/array-type': ['warn', { default: 'array' }], - 'typescript/no-empty-object-type': ['warn', { allowInterfaces: 'with-single-extends' }], + 'typescript/no-useless-empty-export': 'warn', 'typescript/no-wrapper-object-types': 'warn', - 'typescript/consistent-type-assertions': [ - 'warn', - { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }, - ], - 'typescript/no-extra-non-null-assertion': 'warn', + 'typescript/triple-slash-reference': 'warn', // The typescript-eslint FAQ recommends turning off "no-undef" in favor // of letting tsc check for undefined variables, including types