]>
git.proxmox.com Git - pve-eslint.git/blob - eslint/tests/fixtures/testers/rule-tester/no-test-global.js
b5fa4c3bf929f6744e242de400a80ca0fa1b8fe1
2 * @fileoverview Test rule to flag if the global var `test` is missing;
3 * @author Mathias Schreck
6 //------------------------------------------------------------------------------
8 //------------------------------------------------------------------------------
10 module
.exports = function(context
) {
14 "Program": function(node
) {
15 var globals
= context
.getScope().variables
.map(function (variable
) {
19 if (globals
.indexOf("test") === -1) {
20 context
.report(node
, "Global variable test was not defined.");
22 if (globals
.indexOf("foo") !== -1) {
23 context
.report(node
, "Global variable foo should not be used.");