Skip to content

Commit

Permalink
Merge branch 'master' into tweak-eslint-remote-tester
Browse files Browse the repository at this point in the history
* master: (88 commits)
  Release 11.7.0
  build(deps-dev): Bump @typescript-eslint/parser from 5.59.5 to 5.59.6 (ember-cli#1863)
  Account for only having template tag in `no-empty-glimmer-component-classes` rule (ember-cli#1866)
  Support autofix of numerical property access and ternary expressions in `no-get` rule (ember-cli#1865)
  Release 11.6.0
  build(deps-dev): Bump prettier from 2.8.7 to 2.8.8 (ember-cli#1842)
  build(deps-dev): Bump @typescript-eslint/parser from 5.58.0 to 5.59.5 (ember-cli#1860)
  build(deps-dev): Bump @babel/eslint-parser from 7.21.3 to 7.21.8 (ember-cli#1856)
  build(deps-dev): Bump markdownlint-cli from 0.33.0 to 0.34.0 (ember-cli#1848)
  build(deps-dev): Bump jquery from 3.6.4 to 3.7.0 (ember-cli#1861)
  build(deps-dev): Bump release-it from 15.10.1 to 15.10.3 (ember-cli#1859)
  build(deps): Bump vm2 from 3.9.17 to 3.9.18 (ember-cli#1862)
  Support autofix in gts files (ember-cli#1853)
  Only show `no-undef` errors for templates in gts files (ember-cli#1852)
  Release 11.5.2
  Fix a bug in autofixer and autofix additional cases with `firstObject and `lastObject` in `no-get` rule (ember-cli#1841)
  build(deps-dev): Bump eslint from 8.37.0 to 8.38.0 (ember-cli#1830)
  build(deps-dev): Bump @typescript-eslint/parser from 5.57.0 to 5.58.0 (ember-cli#1837)
  build(deps-dev): Bump typescript from 5.0.3 to 5.0.4 (ember-cli#1832)
  build(deps): Bump vm2 from 3.9.11 to 3.9.17 (ember-cli#1839)
  ...
  • Loading branch information
bmish committed May 21, 2023
2 parents 3155ee9 + 77b4855 commit 1357d67
Show file tree
Hide file tree
Showing 15 changed files with 2,664 additions and 840 deletions.
122 changes: 122 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,128 @@
















## v11.7.0 (2023-05-19)

#### :rocket: Enhancement
* [#1865](https://github.com/ember-cli/eslint-plugin-ember/pull/1865) Support autofix of numerical property access and ternary expressions in `no-get` rule ([@evanjehl](https://github.com/evanjehl))

#### :bug: Bug Fix
* [#1866](https://github.com/ember-cli/eslint-plugin-ember/pull/1866) Account for class only having template tag in `no-empty-glimmer-component-classes` rule ([@chrisrng](https://github.com/chrisrng))

#### Committers: 2
- Chris Ng ([@chrisrng](https://github.com/chrisrng))
- [@evanjehl](https://github.com/evanjehl)


## v11.6.0 (2023-05-16)

#### :rocket: Enhancement
* [#1853](https://github.com/ember-cli/eslint-plugin-ember/pull/1853) Support autofix in gts files ([@patricklx](https://github.com/patricklx))

#### :bug: Bug Fix
* [#1852](https://github.com/ember-cli/eslint-plugin-ember/pull/1852) Only show `no-undef` errors for templates in gts files ([@patricklx](https://github.com/patricklx))

#### Committers: 1
- Patrick Pircher ([@patricklx](https://github.com/patricklx))


## v11.5.2 (2023-04-22)

#### :bug: Bug Fix
* [#1841](https://github.com/ember-cli/eslint-plugin-ember/pull/1841) Fix a bug in autofixer and autofix additional cases with `firstObject and `lastObject` in `no-get` rule ([@ArtixZ](https://github.com/ArtixZ))

#### Committers: 1
- [@ArtixZ](https://github.com/ArtixZ)


## v11.5.1 (2023-04-07)

#### :bug: Bug Fix
* [#1828](https://github.com/ember-cli/eslint-plugin-ember/pull/1828) Clarify error message for `no-pause-test` rule ([@deanmarano](https://github.com/deanmarano))

#### Committers: 1
- Dean Marano ([@deanmarano](https://github.com/deanmarano))


## v11.5.0 (2023-04-05)

#### :rocket: Enhancement
* [#1823](https://github.com/ember-cli/eslint-plugin-ember/pull/1823) Add `getProperties` autofixer to `no-get` rule ([@ArtixZ](https://github.com/ArtixZ))

#### Committers: 1
- [@ArtixZ](https://github.com/ArtixZ)


## v11.4.9 (2023-03-28)

#### :bug: Bug Fix
* [#1819](https://github.com/ember-cli/eslint-plugin-ember/pull/1819) Bump ember-template-imports to 3.4.2 ([@hmajoros](https://github.com/hmajoros))

#### Committers: 1
- Hank Majoros ([@hmajoros](https://github.com/hmajoros))


## v11.4.8 (2023-03-14)

#### :bug: Bug Fix
* [#1801](https://github.com/ember-cli/eslint-plugin-ember/pull/1801) Fix issue with token mapping for lint errors on template tokens in gjs/gts files by displaying eslint error on the opening `<template>` tag ([@hmajoros](https://github.com/hmajoros))
* [#1788](https://github.com/ember-cli/eslint-plugin-ember/pull/1788) Fix `no-array-prototype extensions` undefined error from trying to access callee from non-CallExpression ([@canrozanes](https://github.com/canrozanes))
* [#1795](https://github.com/ember-cli/eslint-plugin-ember/pull/1795) refactor glimmer post-process, better handle template tag ([@hmajoros](https://github.com/hmajoros))

#### Committers: 2
- Can Rozanes ([@canrozanes](https://github.com/canrozanes))
- Hank Majoros ([@hmajoros](https://github.com/hmajoros))


## v11.4.7 (2023-03-02)

#### :bug: Bug Fix
* [#1793](https://github.com/ember-cli/eslint-plugin-ember/pull/1793) [gjs] Fix bug with regex issues when parsing GLIMMER_TEMPLATE ([@hmajoros](https://github.com/hmajoros))
* [#1792](https://github.com/ember-cli/eslint-plugin-ember/pull/1792) [gjs] Return original diagnostic if transformed line matches original line in glimmer preprocessor ([@hmajoros](https://github.com/hmajoros))

#### Committers: 1
- Hank Majoros ([@hmajoros](https://github.com/hmajoros))


## v11.4.6 (2023-02-01)

#### :bug: Bug Fix
* [#1767](https://github.com/ember-cli/eslint-plugin-ember/pull/1767) Bump ember-template-imports to `v3.4.1` ([@gossi](https://github.com/gossi))

#### Committers: 1
- Thomas Gossmann ([@gossi](https://github.com/gossi))


## v11.4.5 (2023-01-28)

#### :bug: Bug Fix
* [#1748](https://github.com/ember-cli/eslint-plugin-ember/pull/1748) Ignore Ember Data `store` service calls in `no-array-prototype-extensions` rule ([@bmish](https://github.com/bmish))
* [#1761](https://github.com/ember-cli/eslint-plugin-ember/pull/1761) Fix false positive with `Promise.any()` in `no-array-prototype-extensions` rule ([@bmish](https://github.com/bmish))

#### Committers: 1
- Bryan Mishkin ([@bmish](https://github.com/bmish))


## v11.4.4 (2023-01-23)

#### :bug: Bug Fix
* [#1749](https://github.com/ember-cli/eslint-plugin-ember/pull/1749) Ignore direct instantiation of `EmberArray` in `no-array-prototype-extensions` rule ([@canrozanes](https://github.com/canrozanes))

#### Committers: 1
- Can Rozanes ([@canrozanes](https://github.com/canrozanes))


## v11.4.3 (2023-01-15)
Expand Down
14 changes: 13 additions & 1 deletion docs/rules/no-array-prototype-extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ To reduce false positives, the rule ignores some common known-non-array classes/

- `Set.clear()`
- `Map.clear()`
- `Promise.reject()`
- `localStorage.clear()` / `sessionStorage.clear()`
- `Promise.any()` / `Promise.reject()`
- Lodash / jQuery
- Ember Data `this.store` service
- etc

If you run into additional false positives, please file a bug or submit a PR to add it to the rule's hardcoded ignore list.
Expand Down Expand Up @@ -117,6 +120,15 @@ export default class SampleComponent extends Component {
}
```

```js
/** Direct usage of `@ember/array` **/
/** Use A() is OK **/
import { A } from '@ember/array';

const arr = A(['a', 'a', 'b', 'b']);
arr.uniq();
```

## References

- [EmberArray](https://api.emberjs.com/ember/release/classes/EmberArray)
Expand Down
25 changes: 24 additions & 1 deletion docs/rules/no-empty-glimmer-component-classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This rule will catch and prevent the use of empty backing classes for Glimmer co

## Rule Details

This rule aims to disallow the use of empty backing classes for Glimmer components when possible. Template-only Glimmer components where there is no backing class are much faster and lighter-weight than Glimmer components with backing classes, which are much lighter-weight than Ember components. Therefore, you should only have a backing class for a Glimmer component when absolutely necessary.
This rule aims to disallow the use of empty backing classes for Glimmer components when possible including only using ember template tags in your Glimmer component. Template-only Glimmer components where there is no backing class are much faster and lighter-weight than Glimmer components with backing classes, which are much lighter-weight than Ember components. Therefore, you should only have a backing class for a Glimmer component when absolutely necessary.

To fix violations of this rule:

Expand All @@ -26,6 +26,15 @@ import Component from '@glimmer/component';
class MyComponent extends Component {}
```

<!-- markdownlint-disable-next-line MD040 -->
```
import Component from '@glimmer/component';
export default class MyComponent extends Component {
<template>Hello World!</template>
}
```

Examples of **correct** code for this rule:

```js
Expand Down Expand Up @@ -54,7 +63,21 @@ import MyDecorator from 'my-decorator';
class MyComponent extends Component {}
```

<!-- markdownlint-disable-next-line MD040 -->
```
import Component from '@glimmer/component';
export default class MyComponent extends Component {
foo() {
return this.args.bar + this.args.baz;
}
<template>Hello World!</template>
}
```

## References

- [Glimmer Components - Octane Upgrade Guide](https://guides.emberjs.com/release/upgrading/current-edition/glimmer-components/)
- [Glimmer Components RFC](https://emberjs.github.io/rfcs/0416-glimmer-components.html)
- [First-Class Component Templates RFC](https://rfcs.emberjs.com/id/0779-first-class-component-templates/)
2 changes: 1 addition & 1 deletion docs/rules/no-shadow-route-definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Enforce no route path definition shadowing in Router.

## Rule Details

This rule disallows defining shadowing route definitions.
This rule disallows defining shadowing route definitions. Shadowing will result in the router failing to resolve the path of the shadowed route, leading to undesirable and incomprehensible behavior (e.g. hooks of the shadowed route not firing even though the URL matches its path).

## Examples

Expand Down

0 comments on commit 1357d67

Please sign in to comment.