forbidden-properties
Conformance is available on Enterprise plans
The rule type enables you to disallow reading from, writing to, and/or calling one or more properties.
- Disallowing use of global properties
- You want to disallow calling
- You want to disallow using browser-only APIs in a component library that may be server-rendered
- You want to disallow calls to usage of in favor of another solution.
- Disallowing use of deprecated features
- You want to disallow using
- You want to disallow specific strings from being used within code
To create a custom rule, you'll need to configure the below required properties:
| Property | Type | Description |
|---|---|---|
| The property to target. | ||
| The operation(s) to target. At least one operation is required. |
The example below configures a rule named that disallows calling .
Note that a property's assignments are tracked by this custom rule type.
Using our example rule (above), the following calls will both result in errors.
The example below enables the custom rule. In this example, the custom rule is also restricted to the and workspaces, which is optional.
;
Was this helpful?