mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
32 lines
748 B
JavaScript
32 lines
748 B
JavaScript
module.exports = {
|
|
meta: {
|
|
docs: {},
|
|
schema: []
|
|
},
|
|
|
|
create(context) {
|
|
return {
|
|
Program() {
|
|
var scope = context.getScope()
|
|
|
|
scope.variables.forEach(function(variable) {
|
|
if (variable.writeable) {
|
|
return
|
|
}
|
|
|
|
variable.defs.forEach(function(def) {
|
|
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.')
|
|
}
|
|
})
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|