ember-cli / ember-cli/eslint-plugin-ember

False positives for `ember/use-ember-get-and-set`

Open
#1,520 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
263
Forks
214
Avg merge
30m
Merged PRs (30d)
5

Description

When using structures that like TrackedMap or URLSearchParams, which have getters, the lint rule identifies this as a violation.
Ex:

`ember/use-ember-get-and-set `

```js
import { TrackedMap } from 'tracked-built-ins'; // https://www.npmjs.com/package/tracked-built-ins

class CustomNavigationContextRouterService extends Service {
someMap = new TrackedMap();

@service('router')
router;

someMapMethod() {
const value = someMap.get('someKey'); // violation
// do stuff
}

someURLParamsMethod() {
const urlParamString = this.router.currentURL.split('?').pop();
const urlParams = new URLSearchParams(urlParamString);
const value = urlParams.get('someParamKey'); // violation
// do stuff
}
}

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.