1a9d27d637c507154984445e1de4d19ca1df06f1
[platform/framework/web/crosswalk-tizen.git] /
1 /**
2  * @fileoverview Rule to check for properties whose identifier ends with the string Sync
3  * @author Matt DuVall<http://mattduvall.com/>
4  */
5
6 /*jshint node:true*/
7
8 "use strict";
9
10 //------------------------------------------------------------------------------
11 // Rule Definition
12 //------------------------------------------------------------------------------
13
14 module.exports = function(context) {
15
16     return {
17
18         "MemberExpression": function(node) {
19             var propertyName = node.property.name,
20                 syncRegex = /.*Sync$/;
21
22             if (syncRegex.exec(propertyName) !== null) {
23                 context.report(node, "Unexpected sync method: '" + propertyName + "'.");
24             }
25         }
26     };
27
28 };