Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

eslint-plugin-ember-cleanup

2.0.1 • Public • Published

eslint-plugin-ember-cleanup

Build Status npm version License Downloads

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-ember-cleanup:

$ npm install eslint-plugin-ember-cleanup --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-ember-cleanup globally.

Usage

Add ember-cleanup to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": [
    "ember-cleanup"
  ],
  "extends": [
    "eslint:recommended",
    "plugin:ember-cleanup/recommended"
  ]
}

Supported Rules

Rule Description
max-dep-keys Checks number of dependent keys
no-settimeout Proposes to use run-methods instead of setTimeout
no-throw Proposes to use assert from @ember/debug instead of throwing errors
no-typeof Proposes to use typeOf from @ember/utils instead of built-in typeof for some types check
cp-brace-expansion Checks dependent keys for possibility to do brace expansion
no-is-array Checks for array detection and propose to use isArray from @ember/array
no-this-in-dep-keys Checks dependent keys for this.-prefix
one-level-each Checks @each usage in the dependent keys
square-brackets Checks [] usage in the dependent keys
no-multi-dots Checks dependent keys to not contain ..
no-typo-in-dep-keys Checks possible typos in the dependent keys (it doesn't check short keys)
cp-macro-args-limit Checks dependent keys count
cp-macro-not-key Checks arguments for computed macros to not be dependent keys
no-expr-in-dep-keys Checks dependent keys to not contain expressions
no-empty-declaration Disallow empty extend for Ember Objects
cp-macro-alias Looks for Computed Properties that look like computed.alias but are written as 'general' CP
super-args Checks potential invalid calls _super without ...
route-model-return Checks that model hook returns a value
no-dep-keys-loop Checks for loops in the dependent keys

Deprecated and removed:

Rule Reason
no-declare-obj-components Use ember/avoid-leaking-state-in-ember-objects from eslint-plugin-ember
no-set-in-getter Use ember/no-side-effects from eslint-plugin-ember
no-dup-keys Use ember/no-duplicate-dependent-keys from eslint-plugin-ember
destructuring It's not needed for modules API
no-define-property defineProperty is private, so it must not be used at all
no-console Proposed Ember.Logger is private, so rule may be replaced with no-console from ESLint

install

npm i eslint-plugin-ember-cleanup

Downloadsweekly downloads

41

version

2.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar