Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epidemian
GitHub Repository: epidemian/eslint-plugin-import
Path: blob/main/src/core/staticRequire.js
829 views
1
// todo: merge with module visitor
2
export default function isStaticRequire(node) {
3
return node &&
4
node.callee &&
5
node.callee.type === 'Identifier' &&
6
node.callee.name === 'require' &&
7
node.arguments.length === 1 &&
8
node.arguments[0].type === 'Literal' &&
9
typeof node.arguments[0].value === 'string';
10
}
11
12