Skip to content

Commit

Permalink
Add new recommended rules: no-at-ember-render-modifiers, `no-depr…
Browse files Browse the repository at this point in the history
…ecated-router-transition-methods`, `no-implicit-injections`, `no-runloop`, `no-tracked-properties-from-args`, (#1963)
  • Loading branch information
patricklx authored Oct 31, 2023
1 parent 199ae8e commit 04a050a
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ module.exports = {
| [closure-actions](docs/rules/closure-actions.md) | enforce usage of closure actions || | |
| [new-module-imports](docs/rules/new-module-imports.md) | enforce using "New Module Imports" from Ember RFC #176 || | |
| [no-array-prototype-extensions](docs/rules/no-array-prototype-extensions.md) | disallow usage of Ember's `Array` prototype extensions | | 🔧 | |
| [no-at-ember-render-modifiers](docs/rules/no-at-ember-render-modifiers.md) | disallow importing from @ember/render-modifiers | | | |
| [no-deprecated-router-transition-methods](docs/rules/no-deprecated-router-transition-methods.md) | enforce usage of router service transition methods | | 🔧 | |
| [no-at-ember-render-modifiers](docs/rules/no-at-ember-render-modifiers.md) | disallow importing from @ember/render-modifiers | | | |
| [no-deprecated-router-transition-methods](docs/rules/no-deprecated-router-transition-methods.md) | enforce usage of router service transition methods | | 🔧 | |
| [no-function-prototype-extensions](docs/rules/no-function-prototype-extensions.md) | disallow usage of Ember's `function` prototype extensions || | |
| [no-implicit-injections](docs/rules/no-implicit-injections.md) | enforce usage of implicit service injections | | 🔧 | |
| [no-implicit-injections](docs/rules/no-implicit-injections.md) | enforce usage of implicit service injections | | 🔧 | |
| [no-mixins](docs/rules/no-mixins.md) | disallow the usage of mixins || | |
| [no-new-mixins](docs/rules/no-new-mixins.md) | disallow the creation of new mixins || | |
| [no-observers](docs/rules/no-observers.md) | disallow usage of observers || | |
Expand Down Expand Up @@ -140,7 +140,7 @@ module.exports = {
| [no-classic-classes](docs/rules/no-classic-classes.md) | disallow "classic" classes in favor of native JS classes || | |
| [no-ember-super-in-es-classes](docs/rules/no-ember-super-in-es-classes.md) | disallow use of `this._super` in ES class methods || 🔧 | |
| [no-empty-glimmer-component-classes](docs/rules/no-empty-glimmer-component-classes.md) | disallow empty backing classes for Glimmer components || | |
| [no-tracked-properties-from-args](docs/rules/no-tracked-properties-from-args.md) | disallow creating @tracked properties from this.args | | | |
| [no-tracked-properties-from-args](docs/rules/no-tracked-properties-from-args.md) | disallow creating @tracked properties from this.args | | | |

### jQuery

Expand All @@ -159,7 +159,7 @@ module.exports = {
| [no-incorrect-calls-with-inline-anonymous-functions](docs/rules/no-incorrect-calls-with-inline-anonymous-functions.md) | disallow inline anonymous functions as arguments to `debounce`, `once`, and `scheduleOnce` || | |
| [no-invalid-debug-function-arguments](docs/rules/no-invalid-debug-function-arguments.md) | disallow usages of Ember's `assert()` / `warn()` / `deprecate()` functions that have the arguments passed in the wrong order. || | |
| [no-restricted-property-modifications](docs/rules/no-restricted-property-modifications.md) | disallow modifying the specified properties | | 🔧 | |
| [no-runloop](docs/rules/no-runloop.md) | disallow usage of `@ember/runloop` functions | | | |
| [no-runloop](docs/rules/no-runloop.md) | disallow usage of `@ember/runloop` functions | | | |
| [require-fetch-import](docs/rules/require-fetch-import.md) | enforce explicit import for `fetch()` | | | |

### Routes
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-at-ember-render-modifiers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ember/no-at-ember-render-modifiers

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/ember-cli/eslint-plugin-ember#-configurations).

<!-- end auto-generated rule header -->

What's wrong with `{{did-insert}}`, `{{did-update}}`, and `{{will-destroy}}`?
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-deprecated-router-transition-methods.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ember/no-deprecated-router-transition-methods

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/ember-cli/eslint-plugin-ember#-configurations).

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end auto-generated rule header -->
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-implicit-injections.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ember/no-implicit-injections

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/ember-cli/eslint-plugin-ember#-configurations).

🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).

<!-- end auto-generated rule header -->
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-runloop.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ember/no-runloop

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/ember-cli/eslint-plugin-ember#-configurations).

<!-- end auto-generated rule header -->

Ember's runloop functions are not lifecycle-aware and don't ensure that an object's async is cleaned up. It is recommended to use [`ember-lifeline`](https://ember-lifeline.github.io/ember-lifeline/), [`ember-concurrency`](http://ember-concurrency.com/docs/introduction/), or [`@ember/destroyable`](https://rfcs.emberjs.com/id/0580-destroyables/) instead.
Expand Down
2 changes: 2 additions & 0 deletions docs/rules/no-tracked-properties-from-args.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# ember/no-tracked-properties-from-args

💼 This rule is enabled in the ✅ `recommended` [config](https://github.com/ember-cli/eslint-plugin-ember#-configurations).

<!-- end auto-generated rule header -->

Disallow creation of @tracked properties from args.
Expand Down
5 changes: 5 additions & 0 deletions lib/recommended-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module.exports = {
"ember/no-actions-hash": "error",
"ember/no-arrow-function-computed-properties": "error",
"ember/no-assignment-of-untracked-properties-used-in-tracking-contexts": "error",
"ember/no-at-ember-render-modifiers": "error",
"ember/no-attrs-in-components": "error",
"ember/no-attrs-snapshot": "error",
"ember/no-capital-letters-in-routes": "error",
Expand All @@ -24,6 +25,7 @@ module.exports = {
"ember/no-computed-properties-in-native-classes": "error",
"ember/no-controller-access-in-routes": "error",
"ember/no-deeply-nested-dependent-keys-with-each": "error",
"ember/no-deprecated-router-transition-methods": "error",
"ember/no-duplicate-dependent-keys": "error",
"ember/no-ember-super-in-es-classes": "error",
"ember/no-ember-testing-in-module-scope": "error",
Expand All @@ -32,6 +34,7 @@ module.exports = {
"ember/no-get-with-default": "error",
"ember/no-get": "error",
"ember/no-global-jquery": "error",
"ember/no-implicit-injections": "error",
"ember/no-incorrect-calls-with-inline-anonymous-functions": "error",
"ember/no-incorrect-computed-macros": "error",
"ember/no-invalid-debug-function-arguments": "error",
Expand All @@ -48,6 +51,7 @@ module.exports = {
"ember/no-pause-test": "error",
"ember/no-private-routing-service": "error",
"ember/no-restricted-resolver-tests": "error",
"ember/no-runloop": "error",
"ember/no-settled-after-test-helper": "error",
"ember/no-shadow-route-definition": "error",
"ember/no-side-effects": "error",
Expand All @@ -57,6 +61,7 @@ module.exports = {
"ember/no-test-module-for": "error",
"ember/no-test-support-import": "error",
"ember/no-test-this-render": "error",
"ember/no-tracked-properties-from-args": "error",
"ember/no-try-invoke": "error",
"ember/no-unnecessary-route-path-option": "error",
"ember/no-volatile-computed-properties": "error",
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-at-ember-render-modifiers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
docs: {
description: 'disallow importing from @ember/render-modifiers',
category: 'Deprecations',
recommended: false,
recommended: true,
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-at-ember-render-modifiers.md',
},
fixable: null,
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-deprecated-router-transition-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
docs: {
description: 'enforce usage of router service transition methods',
category: 'Deprecations',
recommended: false,
recommended: true,
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-deprecated-router-transition-methods.md',
},
fixable: 'code',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-implicit-injections.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ module.exports = {
docs: {
description: 'enforce usage of implicit service injections',
category: 'Deprecations',
recommended: false,
recommended: true,
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-implicit-injections.md',
},
fixable: 'code',
Expand Down
1 change: 1 addition & 0 deletions lib/rules/no-runloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ module.exports = {
docs: {
description: 'disallow usage of `@ember/runloop` functions',
category: 'Miscellaneous',
recommended: true,
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-runloop.md',
},
fixable: null,
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-tracked-properties-from-args.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {
docs: {
description: 'disallow creating @tracked properties from this.args',
category: 'Ember Octane',
recommended: false,
recommended: true,
url: 'https://github.com/ember-cli/eslint-plugin-ember/tree/master/docs/rules/no-tracked-properties-from-args.md',
},
fixable: null,
Expand Down
5 changes: 5 additions & 0 deletions tests/__snapshots__/recommended.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports[`recommended rules has the right list 1`] = `
"no-actions-hash",
"no-arrow-function-computed-properties",
"no-assignment-of-untracked-properties-used-in-tracking-contexts",
"no-at-ember-render-modifiers",
"no-attrs-in-components",
"no-attrs-snapshot",
"no-capital-letters-in-routes",
Expand All @@ -21,6 +22,7 @@ exports[`recommended rules has the right list 1`] = `
"no-computed-properties-in-native-classes",
"no-controller-access-in-routes",
"no-deeply-nested-dependent-keys-with-each",
"no-deprecated-router-transition-methods",
"no-duplicate-dependent-keys",
"no-ember-super-in-es-classes",
"no-ember-testing-in-module-scope",
Expand All @@ -29,6 +31,7 @@ exports[`recommended rules has the right list 1`] = `
"no-get-with-default",
"no-get",
"no-global-jquery",
"no-implicit-injections",
"no-incorrect-calls-with-inline-anonymous-functions",
"no-incorrect-computed-macros",
"no-invalid-debug-function-arguments",
Expand All @@ -45,6 +48,7 @@ exports[`recommended rules has the right list 1`] = `
"no-pause-test",
"no-private-routing-service",
"no-restricted-resolver-tests",
"no-runloop",
"no-settled-after-test-helper",
"no-shadow-route-definition",
"no-side-effects",
Expand All @@ -54,6 +58,7 @@ exports[`recommended rules has the right list 1`] = `
"no-test-module-for",
"no-test-support-import",
"no-test-this-render",
"no-tracked-properties-from-args",
"no-try-invoke",
"no-unnecessary-route-path-option",
"no-volatile-computed-properties",
Expand Down

0 comments on commit 04a050a

Please sign in to comment.