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

Order-in-* rules do not work in native class syntax

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

Description

It would seem that, as in issue, if code is written using modern native classess + decorators, the order-in-* rules do not pick it up. Example would be, from my codebase:

```
import Component from "@ember/component";
import UploadManager from "web/services/upload-manager";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";

export default class extends Component {
@service uploadManager!: UploadManager;

tagName = "";

sideMenuOpen = false;

@action openSideMenu() {
this.set("sideMenuOpen", true);
}

@action closeSideMenu() {
this.set("sideMenuOpen", false);
}
}
```

If I were to put `@service` lower in the file, no error is raised. I am also using typescript, but that doesn't seem to matter for other rules.

What is the situation here, is this a known issue? And first of all, do I understand correctly that the expected situation would be for this rule to be applied to native class based ember entities?

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.