1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | 'use strict';
|
11 |
|
12 | const bad = ['new', 'watch', 'watchGroup', 'watchCollection',
|
13 | 'digest', 'destroy', 'eval', 'evalAsync', 'apply',
|
14 | 'applyAsync', 'on', 'emit', 'broadcast'];
|
15 |
|
16 | module.exports = {
|
17 | meta: {
|
18 | schema: [ ]
|
19 | },
|
20 | create: function(context) {
|
21 | function check(node, name) {
|
22 | if (bad.indexOf(name) >= 0) {
|
23 | context.report(node, `The ${name} method should be replaced by $${name}, or you should rename it in order to avoid confusions`, {});
|
24 | }
|
25 | }
|
26 | return {
|
27 |
|
28 | Identifier: function(node) {
|
29 | check(node, node.name);
|
30 | }
|
31 | };
|
32 | }
|
33 | };
|