feat: implement '@typescript/no-non-null-assertion'#217
Merged
hardfist merged 6 commits intoweb-infra-dev:mainfrom Aug 11, 2025
betterhyq:feature_hyq-main-rslint-20250810-no_non_null_assertion
Merged
feat: implement '@typescript/no-non-null-assertion'#217hardfist merged 6 commits intoweb-infra-dev:mainfrom betterhyq:feature_hyq-main-rslint-20250810-no_non_null_assertion
hardfist merged 6 commits intoweb-infra-dev:mainfrom
betterhyq:feature_hyq-main-rslint-20250810-no_non_null_assertion
Conversation
Contributor
|
thanks! if you met any test runner problems, please let me know |
hardfist
approved these changes
Aug 11, 2025
hardfist
reviewed
Aug 11, 2025
Contributor
There was a problem hiding this comment.
@holyfata this is wrong test path it should be ./tests/typescript-eslint/rules/no-non-null-assertion.test.ts, so the test is actually not running, I have to revert this
Contributor
There was a problem hiding this comment.
BTW why do you 2email for pr?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements three TypeScript ESLint rules for the rslint project:
1. @typescript-eslint/no-non-null-assertion
TypeScript's ! non-null assertion operator asserts to the type system that an expression is non-nullable, as in not null or undefined. Using assertions to tell the type system new information is often a sign that code is not fully type-safe. It's generally better to structure program logic so that TypeScript understands when values may be nullable.
Test Coverage
Quality Checks