eslint-plugin-github
Advanced tools
Comparing version 0.3.0 to 0.4.0
module.exports = { | ||
"rules": { | ||
"block-spacing": [2, "always"], | ||
"brace-style": [2, "1tbs", { "allowSingleLine": true }], | ||
"camelcase": [2, {"properties": "always"}], | ||
"eol-last": 2, | ||
"func-style": [2, "declaration"], | ||
"github/no-implicit-buggy-globals": 2, | ||
@@ -7,5 +12,16 @@ "github/no-sprockets-directives": 2, | ||
"indent": [2, 2, {"SwitchCase": 1}], | ||
"no-implicit-globals": 2 | ||
"no-extra-parens": 2, | ||
"no-implicit-globals": 2, | ||
"no-multi-spaces": 2, | ||
"no-spaced-func": 2, | ||
"no-throw-literal": 2, | ||
"no-trailing-spaces": 2, | ||
"no-unexpected-multiline": 2, | ||
"semi": [2, "never"], | ||
"space-before-blocks": 2, | ||
"space-before-function-paren": [2, "never"], | ||
"space-in-parens": [2, "never"], | ||
"wrap-iife": [2, "inside"] | ||
}, | ||
"extends": "eslint:recommended" | ||
} |
module.exports = function(context) { | ||
return { | ||
"Program": function() { | ||
var scope = context.getScope(); | ||
var scope = context.getScope() | ||
scope.variables.forEach(function(variable) { | ||
if (variable.writeable) { | ||
return; | ||
return | ||
} | ||
@@ -13,12 +13,12 @@ | ||
if (def.type === "FunctionName" || def.type === "ClassName" || | ||
(def.type === "Variable" && def.parent.kind === "const") || | ||
(def.type === "Variable" && def.parent.kind === "let")) { | ||
context.report(def.node, "Implicit global variable, assign as global property instead."); | ||
def.type === "Variable" && def.parent.kind === "const" || | ||
def.type === "Variable" && def.parent.kind === "let") { | ||
context.report(def.node, "Implicit global variable, assign as global property instead.") | ||
} | ||
}); | ||
}); | ||
}) | ||
}) | ||
} | ||
}; | ||
}; | ||
} | ||
} | ||
module.exports.schema = []; | ||
module.exports.schema = [] |
module.exports = function(context) { | ||
function checkSprocketsDirectives(node) { | ||
if (node.value.match(/\s*=\s*(require|require_tree|require_directory|require_self|stub)/)) { | ||
context.report(node, "Sprockets directive found, use ES import instead."); | ||
context.report(node, "Sprockets directive found, use ES import instead.") | ||
} | ||
@@ -11,5 +11,5 @@ } | ||
"BlockComment": checkSprocketsDirectives | ||
}; | ||
}; | ||
} | ||
} | ||
module.exports.schema = []; | ||
module.exports.schema = [] |
{ | ||
"name": "eslint-plugin-github", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
var rule = require('../lib/rules/no-implicit-buggy-globals') | ||
var RuleTester = require('eslint').RuleTester | ||
var ruleTester = new RuleTester(); | ||
var ruleTester = new RuleTester() | ||
@@ -84,2 +84,2 @@ ruleTester.run("no-implicit-buggy-globals", rule, { | ||
] | ||
}); | ||
}) |
var rule = require('../lib/rules/no-sprockets-directives') | ||
var RuleTester = require('eslint').RuleTester | ||
var ruleTester = new RuleTester(); | ||
var ruleTester = new RuleTester() | ||
@@ -98,2 +98,2 @@ ruleTester.run("sprockets-directives", rule, { | ||
] | ||
}); | ||
}) |
@@ -10,3 +10,3 @@ var rule = require('../lib/rules/no-unused-disabled-rules') | ||
} | ||
}); | ||
}) | ||
@@ -112,2 +112,2 @@ ruleTester.run("no-unused-disabled-rules", rule, { | ||
] | ||
}); | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14971
463