UNPKG

629 BJavaScriptView Raw
1/**
2 * @fileoverview Rule to check for the usage of var.
3 * @author Jamund Ferguson
4 * @copyright 2014 Jamund Ferguson. All rights reserved.
5 */
6
7"use strict";
8
9//------------------------------------------------------------------------------
10// Rule Definition
11//------------------------------------------------------------------------------
12
13module.exports = function(context) {
14
15 return {
16 "VariableDeclaration": function(node) {
17 if (node.kind === "var") {
18 context.report(node, "Unexpected var, use let or const instead.");
19 }
20 }
21
22 };
23
24};
25
26module.exports.schema = [];