Commits
Click on a commit to change the comparison rangechore(linter): fix clippy error chore(linter): fix fmt error Merge branch 'main' into feature/20240704no-useless-undefined refactor(linter): optimize `no_useless_undefined` rule implementation
- Updated `no_useless_undefined` rule to handle cases where `undefined` is used in parameter initializers, assignment expressions, and return statements in functions with explicit return types.
- Added utility function `is_has_function_return_type` to check if a function has an explicit return type.
- Added multiple new test cases to cover scenarios including:
- Object properties and class fields with `undefined`.
- Functions and methods returning `undefined`.
- Various valid uses of `undefined` that should not trigger the rule.
- Improved handling of nested functions returning `undefined`.
- Improved existing test cases to ensure the rule correctly ignores cases where `undefined` is necessary.
- Added TODO comments for potential future enhancements. feat(linter): correct `no_useless_undefined` rule and adjust lint category
- Changed the category of `NoUselessUndefined` rule from `pedantic` to `suspicious` for better classification.
- Fixed `is_undefined` function to handle cases where the argument is not an expression.
- Ensured `is_undefined` function correctly checks for undefined identifiers in arguments. feat(linter): correct comment handling in `no_useless_undefined` rule feat(linter): update rule severity for no_useless_undefined