Skip to content

Instantly share code, notes, and snippets.

@yannickcr
Created June 12, 2017 11:45
Show Gist options
  • Save yannickcr/2db44e1f489e0fcb88f71a5880877210 to your computer and use it in GitHub Desktop.
Save yannickcr/2db44e1f489e0fcb88f71a5880877210 to your computer and use it in GitHub Desktop.
Disallow typeof v === 'undefined'
"rules": {
"no-restricted-syntax": [
"error", {
"selector": "BinaryExpression[left.operator='typeof'][right.value='undefined']",
"message": "There's no reason to do that in our codebase ;)"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment