1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 | 'use strict';
|
12 |
|
13 | module.exports = {
|
14 | meta: {
|
15 | docs: {
|
16 | url: 'https://github.com/Gillespie59/eslint-plugin-angular/blob/master/docs/rules/document-service.md'
|
17 | },
|
18 | schema: []
|
19 | },
|
20 | create: function(context) {
|
21 | return {
|
22 | MemberExpression: function(node) {
|
23 | if (node.object.name === 'document' || (node.object.name === 'window' && node.property.name === 'document')) {
|
24 | context.report(node, 'You should use the $document service instead of the default document object', {});
|
25 | }
|
26 | }
|
27 | };
|
28 | }
|
29 | };
|