Skip to content

Commit 109b3f8

Browse files
committed
feat: allow using const foo = require('foo') in plain CommonJS modules
1 parent d9ee76c commit 109b3f8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

recommended.js

+7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ module.exports = {
2020
'@typescript-eslint/no-explicit-any': 'off',
2121
'@typescript-eslint/no-unused-vars': 'off'
2222
}
23+
},
24+
{
25+
files: ['*.js', '*.cjs'],
26+
rules: {
27+
// in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled
28+
'@typescript-eslint/no-var-requires': 'off'
29+
}
2330
}
2431
]
2532
}

0 commit comments

Comments
 (0)