diff --git a/config/eslint.js b/config/eslint.js index f05cc4c..6f16894 100644 --- a/config/eslint.js +++ b/config/eslint.js @@ -344,6 +344,18 @@ export const config = [ { allowTernary: true }, ], '@typescript-eslint/unified-signatures': ERROR, + // Disallow the TypeScript `as` operator for type assertions. + // Using `assertionStyle: "never"` forbids both `as` and angle-bracket + // assertions, effectively preventing all direct casts. + '@typescript-eslint/consistent-type-assertions': [ + ERROR, + { + assertionStyle: 'never', + }, + ], + + // Disallow non-null assertions (the `!` postfix operator). + '@typescript-eslint/no-non-null-assertion': ERROR, 'import/consistent-type-specifier-style': [ERROR, 'prefer-inline'], // Disable rules from presets