Skip to content

Rule Change: Support nested object paths in no-restricted-properties #19809

Closed as not planned
@sethamus

Description

@sethamus

What rule do you want to change?

no-restricted-properties

What change do you want to make?

Generate more warnings

How do you think the change should be implemented?

A new default behavior

Example code

/* eslint no-restricted-properties: [2, {
    "object": "config.apiKey",
    "allowProperties": ["settings"]
}] */

config.apiKey.settings = "12345";
config.apiKey.other = "value";

What does the rule currently do for this code?

The rule currently doesn't report any errors.

What will the rule do after it's changed?

config.apiKey.settings = "12345"; // No error
config.apiKey.other = "value"; // Error: 'config.apiKey.other' is restricted from being used

Participation

  • I am willing to submit a pull request to implement this change.

Additional comments

No response

Metadata

Metadata

Assignees

Labels

enhancementThis change enhances an existing feature of ESLintruleRelates to ESLint's core rules

Type

No type

Projects

Status

Complete

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy