An eslint plugin which enforces that Angular signals are called with the getter.
Name | Description |
---|---|
enforce-angular-signal-call | Enforce that Angular signals are called with the getter |
const mySignal = signal(false);
console.log(mySignal); // ❌
console.log(mySignal()); // ✅
if (mySignal) { // ❌
console.log('mySignal is truthy');
}
if (mySignal()) { // ✅
console.log('mySignal() is truthy');
}
npm install --save-dev eslint-plugin-angular-signal-call
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"
}
}