Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(eslint-plugin): [no-unsafe-enum-comparison] add rule (#6107)
* feat: adding enums to member-ordering rule * feat(eslint-plugin): [strict-enums] adding check for null/undefined * feat(eslint-plugin): [strict-enums] refactoring tests to separate files * feat(eslint-plugin): [strict-enums] allowing more operators * fix(eslint-plugin): [strict-enums] adding union test * fix(eslint-plugin): [strict-enums] refactoring + adding failing class test * fix(eslint-plugin): [strict-enums] adding constraint code * fix(eslint-plugin): [strict-enums] better eslint messages * fix(eslint-plugin): [strict-enums] removing vscode setting changes * fix: changing function definition to reflect reality * fix: pass string enum literal into function that take string * fix: allow passing enums to functions with any/unknown * fix: using flags instead of names also fixes for codebase * fix: adding test that breaks the rule * fix: adding test for variadic functions * fix: adding isSymbolFlagSet internally * fix: adding ignoring for remaining lint failures * fix: better comments * fix: broken test * fix: adding failing test for generic functions * fix: refactoring tests + adding tests * fix: refactoring enum helper function locations * fix: cleanup * fix: refactoring + fixing tests * fix: more tests * fix: refactoring and making tests pass * fix: adding array code, all tests pass now * fix: adding failing test * fix: allow empty arrays * fix: adding logic for arrays with no enums * fix: adding more tests * fix: fixing test * fix: fixing linter * fix: reverting comment fixes * fix: removing refactor * fix: removing fixes to dot-notation * fix: removing semi refactor * fix: removing jest logic * fix: removing comparison operators check * fix: adding failing test * fix: making test pass * fix: adding comment * fix: adding back in bitwise operator checks since apparently they are needed * fix: remove bad comment * fix: removing unnecessary comments * fix: remove types from error messages * fix: removing isArray + refactoring * Update packages/eslint-plugin/src/rules/strict-enums.ts Co-authored-by: Brad Zacher <brad.zacher@gmail.com> * fix: removing strict-enums from recommended * fix: simplify * fix: undoing refactoring * fix: undoing refactoring * fix: moving tests into subdirectory * Update packages/eslint-plugin/src/rules/strict-enums.ts Co-authored-by: Brad Zacher <brad.zacher@gmail.com> * Update packages/eslint-plugin/src/rules/strict-enums.ts Co-authored-by: Brad Zacher <brad.zacher@gmail.com> * fix: adding failing test * fix: making boolean tests pass * fix: refactor tests + fix linter * fix: adding brads tests * fix: brads tests now pass * Update packages/eslint-plugin/docs/rules/strict-enums.md Co-authored-by: Joshua Chen <sidachen2003@gmail.com> * Update packages/eslint-plugin/src/rules/strict-enums.ts Co-authored-by: Brad Zacher <brad.zacher@gmail.com> * Update packages/eslint-plugin/src/rules/strict-enums.ts Co-authored-by: Brad Zacher <brad.zacher@gmail.com> * Update packages/eslint-plugin/src/rules/strict-enums.ts Co-authored-by: Brad Zacher <brad.zacher@gmail.com> * fix: make brads updates actually compile * Update strict-enums.ts * Continued fixing merge conflicts * Continued fixing the build * Passing build * Update packages/eslint-plugin/src/rules/strict-enums.ts * Update packages/eslint-plugin/src/rules/strict-enums.ts * A few more reverts * Just a bit more changing typeFlagUtils * Fixed strict-enums.md build * Convert tests to not pushing * Simplified the rule a whole bunch * Add back getEnumNames * Even more trimming down * ...and just a bit more * Undo some JSDoc changes * Progress: no-unsafe-enum-assignment is tested * A bit more testing for assignments, as requested * Finished testing and sharing * Added comparison operators * Added back no-unsafe-enum-comparison * Remove unrelated changes * Reduce coverage * Touched up docs --------- Co-authored-by: James <5511220+Zamiell@users.noreply.github.com> Co-authored-by: Brad Zacher <brad.zacher@gmail.com> Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
- Loading branch information