From 3f94c58fd523e732c92266856f7c6a63ee72dc62 Mon Sep 17 00:00:00 2001 From: "Shahar \"Dawn\" Or" Date: Sat, 9 Dec 2023 14:55:56 +0700 Subject: [PATCH] feat: @typescript-eslint/non-nullable-type-assertion-style BREAKING CHANGE: add rule @typescript-eslint/non-nullable-type-assertion-style Co-authored-by: Rostislav Simonik --- src/index.test.ts | 2 +- src/index.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.test.ts b/src/index.test.ts index 3d7e2ab4..299182a5 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -236,6 +236,7 @@ test('export', (t): void => { '@typescript-eslint/no-namespace': 'error', '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', '@typescript-eslint/no-non-null-assertion': 'error', + '@typescript-eslint/non-nullable-type-assertion-style': 'error', '@typescript-eslint/no-this-alias': ['error', { allowDestructuring: true }], '@typescript-eslint/no-extra-parens': ['error', 'functions'], '@typescript-eslint/no-redeclare': ['error', { builtinGlobals: false }], @@ -472,7 +473,6 @@ test('all plugin rules are considered', (t) => { 'no-unsafe-member-access', 'no-unsafe-return', 'no-useless-empty-export', - 'non-nullable-type-assertion-style', 'parameter-properties', 'prefer-as-const', 'prefer-enum-initializers', diff --git a/src/index.ts b/src/index.ts index 2d86d91b..c4511957 100644 --- a/src/index.ts +++ b/src/index.ts @@ -200,6 +200,7 @@ const config: Linter.Config = { '@typescript-eslint/no-unnecessary-type-assertion': 'error', '@typescript-eslint/no-unnecessary-type-constraint': 'error', '@typescript-eslint/no-var-requires': 'error', + '@typescript-eslint/non-nullable-type-assertion-style': 'error', '@typescript-eslint/prefer-function-type': 'error', '@typescript-eslint/prefer-includes': 'error', '@typescript-eslint/prefer-nullish-coalescing': ['error', { ignoreConditionalTests: false, ignoreMixedLogicalExpressions: false }],