jfmengels / eslint-ast-utils

Utility library to manipulate ASTs for ESLint projects
MIT License
23 stars 0 forks source link

Add `isStaticTemplateLiteral` method #13

Open sindresorhus opened 7 years ago

sindresorhus commented 7 years ago

https://github.com/avajs/eslint-plugin-ava/blob/ede93cc4f00a756109cf6bd484f61683d3e639fe/rules/no-identical-title.js#L11

jfmengels commented 7 years ago

Hmm... I just implemented this, but I'm having a hard time figuring out a use case for it now that computeStaticExpression is available. In the use-case of no-identical-title, you could use computeStaticExpression and check whether or not it returns undefined, and store the result if not.