eslint-plugin-enforce-angular-signal-call
v1.0.9
Published
An eslint plugin that enforces Angular signals to be called via their getter
Downloads
1
Readme
enforce-angular-signal-call
An eslint plugin which enforces that Angular signals are called with the getter.
Rules
| Name | Description | | :----------------------------------------------------------------------- | :------------------------------------------------------ | | enforce-angular-signal-call | Enforce that Angular signals are called with the getter |
Example
const mySignal = signal(false);
console.log(mySignal); // ❌
console.log(mySignal()); // ✅
if (mySignal) { // ❌
console.log('mySignal is truthy');
}
if (mySignal()) { // ✅
console.log('mySignal() is truthy');
}
Installation
npm install --save-dev eslint-plugin-angular-signal-call
Usage
Add angular-signal-call
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"enforce-angular-signal-call"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"enforce-angular-signal-call/enforce-angular-signal-call": "warn"
}
}