Skip to content

Instantly share code, notes, and snippets.

@shisama
Last active October 4, 2019 13:43
Show Gist options
  • Save shisama/ebf15d96fe13ad3a887571baa11996e4 to your computer and use it in GitHub Desktop.
Save shisama/ebf15d96fe13ad3a887571baa11996e4 to your computer and use it in GitHub Desktop.
My first eslint rule 'no-f-word'. This rule prohibits literal including F word.
module.exports = context => {
return {
Literal: (node) => {
if(node.value.match(/fuck/)) {
context.report({
node,
message: 'Don\'t use the F word!'
})
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment