Created
January 14, 2020 11:09
-
-
Save Quramy/45e676128d99e30e22ce0235b6e53c96 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { Rule } from "eslint"; | |
const rule: Rule.RuleModule = { | |
create: (context) => { | |
return { | |
['NewExpression:not(:has(*.arguments)) > Identifier[name="Date"], CallExpression > MemberExpression:has(Identifier.object[name="Date"]) > Identifier.property[name="now"]']: (node: any) => { | |
context.report({ | |
message: "Don't use side-effective Date function.", | |
node, | |
}); | |
}, | |
}; | |
} | |
}; | |
export = rule; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment