
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
eslint-plugin-ember
Advanced tools
eslint-plugin-ember is an ESLint plugin that provides linting rules specific to Ember.js applications. It helps developers follow best practices and maintain consistency in their Ember.js codebase.
Best Practices
This rule enforces the best practice of avoiding the use of observers in Ember.js applications. Observers can lead to unpredictable behavior and are generally discouraged.
module.exports = {
rules: {
'ember/no-observers': 'error'
}
};
Stylistic Issues
This rule ensures that developers use Ember's `get` and `set` methods for property access and assignment, which is a stylistic convention in Ember.js.
module.exports = {
rules: {
'ember/use-ember-get-and-set': 'error'
}
};
Ember-Specific Rules
This rule disallows the use of jQuery in Ember.js applications, encouraging developers to use native DOM APIs or Ember's own abstractions.
module.exports = {
rules: {
'ember/no-jquery': 'error'
}
};
eslint-plugin-react provides linting rules for React applications. It helps enforce best practices and coding standards specific to React, similar to how eslint-plugin-ember does for Ember.js.
eslint-plugin-vue offers linting rules for Vue.js applications. It ensures that Vue.js code adheres to best practices and stylistic conventions, much like eslint-plugin-ember does for Ember.js.
eslint-plugin-angular provides linting rules for Angular applications. It helps maintain code quality and consistency in Angular projects, similar to the role of eslint-plugin-ember in Ember.js projects.
An ESlint plugin that provides set of rules for Ember Applications based on commonly known good practices.
You need to have ember-cli-eslint
installed in your app. More info here.
npm install --save-dev eslint-plugin-ember
.eslintrc.js
:// .eslintrc.js
module.exports = {
extends: [
'eslint:recommended',
'plugin:ember/recommended'
],
rules: {
// override rules' settings here
}
}
Possible configurations:
If you don't want to use predefined settings, you can use it as a plain plugin and choose which rules you'd like to use by yourself like this:
module.exports = {
extends: [
'eslint:recommended'
],
plugins: [
'ember'
],
rules: {
// add rules' settings here, eg.:
'ember/local-modules': 2
}
}
All rules from this plugin have to be prefixed with ember/
General
Organizing
Controllers
Ember Data
Components
closure-actions - Always use closure actions (more)
no-on-calls-in-components - Don't use .on() in components (more)
* avoid-leaking-state-in-components - Don't use objects and arrays as default properties (more)
Example config:
ember/avoid-leaking-state-in-components: [1, ['array', 'of', 'ignored', 'properties']]
Routing
* Rule with optional settings
"ember/alias-model-in-controller": 0,
"ember/avoid-leaking-state-in-components": 0,
"ember/closure-actions": 0,
"ember/jquery-ember-run": 0,
"ember/local-modules": 0,
"ember/named-functions-in-promises": 0,
"ember/no-empty-attrs": 0,
"ember/no-function-prototype-extensions": 0,
"ember/no-observers": 0,
"ember/no-on-calls-in-components": 0,
"ember/no-side-effects": 0,
"ember/order-in-components": 0,
"ember/order-in-controllers": 0,
"ember/order-in-models": 0,
"ember/order-in-routes": 0,
"ember/query-params-on-top": 0,
"ember/routes-segments-snake-case": 0,
"ember/use-brace-expansion": 0,
"ember/use-ember-get-and-set": 0,
In order to add a new rule, you should:
rules/rule-name.js
filetest/rule-name.js
fileRecommended way of creating new rules:
gulp watch
If you have any suggestions, ideas or problems feel free to add new [issue](https://github.com/netguru/eslint-plugin-ember/issues, but first please make sure your question does not repeat previous ones.
eslint-plugin-ember
package nameSee the LICENSE file for license rights and limitations (MIT).
v2.0.0 (2016-12-30)
order-in
rules. (@Turbo87)no-empty-attrs
. (@bdmac)FAQs
ESLint plugin for Ember.js apps
The npm package eslint-plugin-ember receives a total of 119,231 weekly downloads. As such, eslint-plugin-ember popularity was classified as popular.
We found that eslint-plugin-ember demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.