initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
35
github/codeql-action-v1/node_modules/eslint-plugin-github/lib/rules/no-implicit-buggy-globals.js
generated
vendored
Normal file
35
github/codeql-action-v1/node_modules/eslint-plugin-github/lib/rules/no-implicit-buggy-globals.js
generated
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
module.exports = {
|
||||
meta: {
|
||||
type: 'problem',
|
||||
docs: {
|
||||
description: 'disallow implicit global variables',
|
||||
url: require('../url')(module)
|
||||
},
|
||||
schema: []
|
||||
},
|
||||
|
||||
create(context) {
|
||||
return {
|
||||
Program() {
|
||||
const scope = context.getScope()
|
||||
|
||||
for (const variable of scope.variables) {
|
||||
if (variable.writeable) {
|
||||
return
|
||||
}
|
||||
|
||||
for (const def of variable.defs) {
|
||||
if (
|
||||
def.type === 'FunctionName' ||
|
||||
def.type === 'ClassName' ||
|
||||
(def.type === 'Variable' && def.parent.kind === 'const') ||
|
||||
(def.type === 'Variable' && def.parent.kind === 'let')
|
||||
) {
|
||||
context.report({node: def.node, message: 'Implicit global variable, assign as global property instead.'})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue