1 | /**
|
2 | * use `$document` instead of `document`
|
3 | *
|
4 | * Instead of the default document object, you should prefer the AngularJS wrapper service $document.
|
5 | *
|
6 | * @styleguideReference {johnpapa} `y180` Angular $ Wrapper Services - $document and $window
|
7 | * @version 0.1.0
|
8 | * @category angularWrapper
|
9 | * @sinceAngularVersion 1.x
|
10 | */
|
11 | ;
|
12 |
|
13 | module.exports = {
|
14 | meta: {
|
15 | schema: []
|
16 | },
|
17 | create: function(context) {
|
18 | return {
|
19 | MemberExpression: function(node) {
|
20 | if (node.object.name === 'document' || (node.object.name === 'window' && node.property.name === 'document')) {
|
21 | context.report(node, 'You should use the $document service instead of the default document object', {});
|
22 | }
|
23 | }
|
24 | };
|
25 | }
|
26 | };
|