Skip to content

Commit

Permalink
feat: allow using const foo = require('foo') in plain CommonJS modules
Browse files Browse the repository at this point in the history
  • Loading branch information
haoqunjiang committed Nov 16, 2021
1 parent d9ee76c commit 109b3f8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions recommended.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ module.exports = {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off'
}
},
{
files: ['*.js', '*.cjs'],
rules: {
// in plain CommonJS modules, you can't use `import foo = require('foo')` to pass this rule, so it has to be disabled
'@typescript-eslint/no-var-requires': 'off'
}
}
]
}

0 comments on commit 109b3f8

Please sign in to comment.