Skip to content

Latest commit

 

History

History
128 lines (73 loc) · 8.88 KB

README.md

File metadata and controls

128 lines (73 loc) · 8.88 KB

jscs-ember-deprecations

Build Status Dependency Status devDependency Status Coverage Status

This is a JSCS plugin to include errors for features that are deprecated in Ember.js

Installation

npm install jscs-ember-deprecations --save-dev

You'll also need to tell JSCS to load the plugin. Modify your .jscsrc file to include

"plugins": [
  "jscs-ember-deprecations"
],
"disallowObjectController": true,
"disallowInstanceInInitializer": true,
"disallowPrototypeExtension": true,
"disallowAtEachLeafNode": true,
// ...

If you invoke JSCS with --fix (see http://jscs.info/overview#cli) some deprecation errors can be fixed automatically.

See Supported deprecations for valid keys

Why

Migrating to a newer Ember version can be tricky if you haven't already gone back and removed all uses of deprecated features. Instead, this plugin intends to enable a migration path in a codebase, where developers can be warned when they use deprecated features.

A sample use case is to:

  • Use a tool like Lint Review to automagically annotate pull requests. Developers will be warned if they're using a feature that is deprecated. Put these "aspirational" rules in .toolbot_jscsrc
  • Use broccoli-jscs so that JSCS gets run at the same time you're running unit tests. Put rules that are "mandatory" in your codebase's .jscsrc. Any violations of those rules will result in the test suite failing.

This way a codebase can be gradually brought into compliance over time.

Supported deprecations

Deprecations added in Ember 1.11

Deprecations added in Ember 1.12

Deprecations added in Ember 1.13

Deprecations added in Ember 2.0

None. Ember 2.0 removed support for the above deprecations.

Deprecations added in Ember 2.1

Other Ember best practices

Deprecations added in Ember 2.3

License

This library is lovingly brought to you by @minichate. It is released under the MIT license.