[eslint-plugin] Add null-prototype-dictionaries rule and refine no-null rule#5759
Draft
[eslint-plugin] Add null-prototype-dictionaries rule and refine no-null rule#5759
Conversation
Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/88c04cb4-f442-4fe2-8991-6a20aa3c6f9b Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
…r Record types Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/88c04cb4-f442-4fe2-8991-6a20aa3c6f9b Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
…ate(null) for empty ones Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/39bd15e2-0089-46b6-99ac-4bd914e5ba0a Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
…null in no-null Agent-Logs-Url: https://github.com/microsoft/rushstack/sessions/1d063584-7336-4ab7-b4d0-e2a46bebba49 Co-authored-by: dmichon-msft <26827560+dmichon-msft@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
dmichon-msft
April 8, 2026 23:58
View session
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.
Object.create(null)exemption to theno-nullESLint rule so that creating prototype-less dictionaries doesn't trigger a lint error__proto__: nullexemption to theno-nullESLint rule (both identifier and string-literal key forms) so that object literals with null prototype don't trigger a lint errornull-prototype-dictionariesESLint rule that flags empty{}object literals typed asRecord<string, T>(or{ [key: string]: T }), recommendingObject.create(null)insteadnull-prototype-dictionariesrule in the plugin'sindex.tsno-nullrule covering: null comparisons (allowed),Object.create(null)(allowed),__proto__: null(allowed), and various invalid usages (flagged)null-prototype-dictionariesrule covering: empty dictionary literals (flagged),Object.create(null)(allowed), non-empty literals (allowed), non-dictionary types (allowed), and edge cases likeRecord<"a"|"b", T>and interfaces with index signatures