Last active
October 4, 2019 13:43
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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