eslint-plugin-ember
eslint-plugin-ember copied to clipboard
ember/no-assignment-of-untracked-properties-used-in-tracking-contexts applied on `@attr`
The rule ember/no-assignment-of-untracked-properties-used-in-tracking-contexts is reporting error for codes like:
export default class EnvironmentPermissions extends Fragment {
@service declare store: StoreService;
@attr('number') declare environmentId: number;
get environment(): Environment | null {
return this.store.peekRecord('environment', this.environmentId);
}
set environment(value: Environment | null) {
// Here I get the error
this.environmentId = value && Number.parseInt(value.id, 10);
}
But in the doc they don't talk about using set on model so I'm pretty sure it's a mistake
It would be great if this linting rule would consider @attr as @tracked.
There are probably other situations like these (e.g @dedupeTracked from tracked-toolbox), so perhaps it would be good to be able to constumize an ignore list somehow.