From a462291659eebcaa6bf506c2e47b50806cfa7b58 Mon Sep 17 00:00:00 2001 From: Exoridus Date: Tue, 23 Jun 2026 13:32:51 +0200 Subject: [PATCH 1/2] refactor(lint): tighten no-shadow + unified-signatures to error; enable noUncheckedSideEffectImports Verified 0 violations across src + all packages (measured by setting each rule to error and running lint:strict + lint:packages). noUncheckedSideEffectImports likewise 0 errors across root + all package typechecks. - @typescript-eslint/no-shadow: warn -> error (src + packages) - @typescript-eslint/unified-signatures: warn -> error (src + packages) - tsconfig base: noUncheckedSideEffectImports: true --- eslint.config.ts | 8 ++++---- packages/exojs-config/typescript/base.json | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/eslint.config.ts b/eslint.config.ts index d60031cf..f74c95f9 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -168,7 +168,7 @@ export default defineConfig([ '@typescript-eslint/no-non-null-assertion': 'error', '@typescript-eslint/no-redundant-type-constituents': 'warn', '@typescript-eslint/no-require-imports': 'warn', - '@typescript-eslint/no-shadow': 'warn', + '@typescript-eslint/no-shadow': 'error', '@typescript-eslint/no-unsafe-call': 'warn', '@typescript-eslint/no-unsafe-enum-comparison': 'warn', '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', @@ -209,7 +209,7 @@ export default defineConfig([ '@typescript-eslint/strict-boolean-expressions': 'warn', '@typescript-eslint/switch-exhaustiveness-check': 'error', '@typescript-eslint/unbound-method': 'warn', - '@typescript-eslint/unified-signatures': 'warn', + '@typescript-eslint/unified-signatures': 'error', // Engine-specific naming convention '@typescript-eslint/naming-convention': [ @@ -417,7 +417,7 @@ export default defineConfig([ '@typescript-eslint/no-non-null-assertion': 'warn', '@typescript-eslint/no-redundant-type-constituents': 'warn', '@typescript-eslint/no-require-imports': 'warn', - '@typescript-eslint/no-shadow': 'warn', + '@typescript-eslint/no-shadow': 'error', '@typescript-eslint/no-unsafe-call': 'warn', '@typescript-eslint/no-unsafe-enum-comparison': 'warn', '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error', @@ -457,7 +457,7 @@ export default defineConfig([ '@typescript-eslint/strict-boolean-expressions': 'warn', '@typescript-eslint/switch-exhaustiveness-check': 'error', '@typescript-eslint/unbound-method': 'warn', - '@typescript-eslint/unified-signatures': 'warn', + '@typescript-eslint/unified-signatures': 'error', // Engine-standard naming convention '@typescript-eslint/naming-convention': [ diff --git a/packages/exojs-config/typescript/base.json b/packages/exojs-config/typescript/base.json index 45f5d3e4..5d978194 100644 --- a/packages/exojs-config/typescript/base.json +++ b/packages/exojs-config/typescript/base.json @@ -15,6 +15,7 @@ "noImplicitOverride": true, "noImplicitReturns": true, "noFallthroughCasesInSwitch": true, + "noUncheckedSideEffectImports": true, "skipLibCheck": true } } From 0bef18f2b0bc4c78c77a361b5001e03726b71abb Mon Sep 17 00:00:00 2001 From: Exoridus Date: Tue, 23 Jun 2026 13:47:43 +0200 Subject: [PATCH 2/2] refactor(lint): drop redundant preset-default rules + dead no-var-requires These rules set exactly the value recommendedTypeChecked / stylisticTypeChecked already provide. Verified via `eslint --print-config` that all 14 type-checked defaults stay active as error in BOTH src and packages after removal (behaviour-identical). prefer-ts-expect-error is deprecated (ban-ts-comment with ts-ignore:false covers it); no-var-requires was renamed to no-require-imports in typescript-eslint v6 (dead key). no-floating-promises kept (also set in site/, not redundant there); dot-notation:off kept (documenting pair with no-shadow:off). - 16 redundant @typescript-eslint defaults removed from src + packages blocks - Core prefer-promise-reject-errors removed (preset prefers the TS variant) - dead no-var-requires removed from scripts block - net -33 lines, 0 behaviour change (proven via print-config) --- eslint.config.ts | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/eslint.config.ts b/eslint.config.ts index f74c95f9..e6815e81 100644 --- a/eslint.config.ts +++ b/eslint.config.ts @@ -98,7 +98,6 @@ export default defineConfig([ 'no-useless-return': 'error', 'object-shorthand': 'error', 'prefer-object-spread': 'error', - 'prefer-promise-reject-errors': 'error', 'prefer-template': 'error', radix: 'error', // Base rules disabled in favor of TS / plugin variants. @@ -107,7 +106,6 @@ export default defineConfig([ // TypeScript correctness '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], - '@typescript-eslint/await-thenable': 'error', '@typescript-eslint/ban-ts-comment': [ 'error', { @@ -118,7 +116,6 @@ export default defineConfig([ }, ], '@typescript-eslint/class-literal-property-style': 'warn', - '@typescript-eslint/consistent-indexed-object-style': ['error', 'record'], '@typescript-eslint/consistent-type-assertions': [ 'error', { @@ -126,7 +123,6 @@ export default defineConfig([ objectLiteralTypeAssertions: 'never', }, ], - '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: false, fixStyle: 'inline-type-imports' }], '@typescript-eslint/default-param-last': 'error', '@typescript-eslint/explicit-function-return-type': [ @@ -138,20 +134,15 @@ export default defineConfig([ }, ], '@typescript-eslint/explicit-member-accessibility': 'warn', - '@typescript-eslint/no-base-to-string': 'error', '@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true }], '@typescript-eslint/no-deprecated': 'warn', - '@typescript-eslint/no-duplicate-enum-values': 'error', - '@typescript-eslint/no-duplicate-type-constituents': 'error', '@typescript-eslint/no-empty-function': [ 'warn', { allow: ['private-constructors', 'protected-constructors', 'decoratedFunctions', 'overrideMethods'], }, ], - '@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/no-floating-promises': 'error', - '@typescript-eslint/no-for-in-array': 'error', '@typescript-eslint/no-meaningless-void-operator': 'error', '@typescript-eslint/no-misused-promises': [ 'error', @@ -164,7 +155,6 @@ export default defineConfig([ ], '@typescript-eslint/no-mixed-enums': 'error', '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', - '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', '@typescript-eslint/no-non-null-assertion': 'error', '@typescript-eslint/no-redundant-type-constituents': 'warn', '@typescript-eslint/no-require-imports': 'warn', @@ -182,18 +172,12 @@ export default defineConfig([ // Base no-unused-vars handled by `unused-imports/no-unused-vars` above. '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/non-nullable-type-assertion-style': 'warn', - '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/prefer-for-of': 'off', - '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-nullish-coalescing': 'warn', '@typescript-eslint/prefer-optional-chain': 'warn', - '@typescript-eslint/prefer-promise-reject-errors': 'error', '@typescript-eslint/prefer-readonly': 'off', '@typescript-eslint/prefer-reduce-type-parameter': 'error', '@typescript-eslint/prefer-regexp-exec': 'off', - '@typescript-eslint/prefer-string-starts-ends-with': 'error', - '@typescript-eslint/prefer-ts-expect-error': 'error', '@typescript-eslint/require-await': 'warn', '@typescript-eslint/restrict-template-expressions': [ 'error', @@ -348,7 +332,6 @@ export default defineConfig([ 'no-useless-return': 'error', 'object-shorthand': 'error', 'prefer-object-spread': 'error', - 'prefer-promise-reject-errors': 'error', 'prefer-template': 'error', radix: 'error', 'no-shadow': 'off', @@ -356,7 +339,6 @@ export default defineConfig([ // TypeScript correctness '@typescript-eslint/array-type': ['error', { default: 'array-simple' }], - '@typescript-eslint/await-thenable': 'error', '@typescript-eslint/ban-ts-comment': [ 'error', { @@ -367,7 +349,6 @@ export default defineConfig([ }, ], '@typescript-eslint/class-literal-property-style': 'warn', - '@typescript-eslint/consistent-indexed-object-style': ['error', 'record'], '@typescript-eslint/consistent-type-assertions': [ 'error', { @@ -375,7 +356,6 @@ export default defineConfig([ objectLiteralTypeAssertions: 'never', }, ], - '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', disallowTypeAnnotations: false, fixStyle: 'inline-type-imports' }], '@typescript-eslint/default-param-last': 'error', '@typescript-eslint/explicit-function-return-type': [ @@ -387,20 +367,15 @@ export default defineConfig([ }, ], '@typescript-eslint/explicit-member-accessibility': 'warn', - '@typescript-eslint/no-base-to-string': 'error', '@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true }], '@typescript-eslint/no-deprecated': 'warn', - '@typescript-eslint/no-duplicate-enum-values': 'error', - '@typescript-eslint/no-duplicate-type-constituents': 'error', '@typescript-eslint/no-empty-function': [ 'warn', { allow: ['private-constructors', 'protected-constructors', 'decoratedFunctions', 'overrideMethods'], }, ], - '@typescript-eslint/no-explicit-any': 'error', '@typescript-eslint/no-floating-promises': 'error', - '@typescript-eslint/no-for-in-array': 'error', '@typescript-eslint/no-meaningless-void-operator': 'error', '@typescript-eslint/no-misused-promises': [ 'error', @@ -413,7 +388,6 @@ export default defineConfig([ ], '@typescript-eslint/no-mixed-enums': 'error', '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', - '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', '@typescript-eslint/no-non-null-assertion': 'warn', '@typescript-eslint/no-redundant-type-constituents': 'warn', '@typescript-eslint/no-require-imports': 'warn', @@ -430,18 +404,12 @@ export default defineConfig([ '@typescript-eslint/no-unsafe-return': 'warn', '@typescript-eslint/no-unused-vars': 'off', '@typescript-eslint/non-nullable-type-assertion-style': 'warn', - '@typescript-eslint/only-throw-error': 'error', '@typescript-eslint/prefer-for-of': 'off', - '@typescript-eslint/prefer-function-type': 'error', - '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-nullish-coalescing': 'warn', '@typescript-eslint/prefer-optional-chain': 'warn', - '@typescript-eslint/prefer-promise-reject-errors': 'error', '@typescript-eslint/prefer-readonly': 'off', '@typescript-eslint/prefer-reduce-type-parameter': 'error', '@typescript-eslint/prefer-regexp-exec': 'off', - '@typescript-eslint/prefer-string-starts-ends-with': 'error', - '@typescript-eslint/prefer-ts-expect-error': 'error', '@typescript-eslint/require-await': 'warn', '@typescript-eslint/restrict-template-expressions': [ 'error', @@ -1105,7 +1073,6 @@ export default defineConfig([ }, rules: { 'no-console': 'warn', - '@typescript-eslint/no-var-requires': 'off', '@typescript-eslint/no-require-imports': 'warn', '@typescript-eslint/no-unused-vars': 'warn', '@typescript-eslint/no-unsafe-assignment': 'warn',