eps

eslint-plugin-segment-ember-actions

ESLint rule to check action blocks for analytics tracking events

Showing:

Popularity

Downloads/wk

9

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.5KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

Code ClimateBuild Status

Require all action functions in Ember to have at least one analytics.track function call (segment-ember-actions)

This rule generates warnings for Ember action handler functions that do not have a call to analytics.track()

Usage

To install:

npm install --save-dev eslint eslint-plugin-segment-ember-actions

add these to your .eslintrc file:

"rules": {
  "segment-ember-actions/analytics-track": 2
},
"plugins": [
  "segment-ember-actions"
]

and then run the local eslint:

node_modules/.bin/eslint app/**/*.js

Rule details

The following controllers throw warnings:

import Ember from 'ember';
export default Ember.Controller.extend({
  actions: {
      exampleAction() {}  
  }
});

The following controllers do not throw warnings:

import Ember from 'ember';
export default Ember.Controller.extend({
    actions: {
        exampleAction() {
            analytics.track('something', {with: 'data'});
        }
    }
});
import Ember from 'ember';
export default Ember.Controller.extend({
  actions: {
      //to-track
      exampleAction() {}  
  }
});

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100