We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
require-common-first
1 parent b197dfa commit 53b29b0Copy full SHA for 53b29b0
2 files changed
test/parallel/test-eslint-require-common-first.js
@@ -20,6 +20,12 @@ new RuleTester({
20
code: 'require("common")\n' +
21
'require("assert")'
22
},
23
+ {
24
+ code: 'import "../../../../common/index.mjs";',
25
+ languageOptions: {
26
+ sourceType: 'module',
27
+ },
28
29
],
30
invalid: [
31
{
tools/eslint-rules/require-common-first.js
@@ -22,7 +22,7 @@ module.exports = {
* @returns {string} module name
*/
function getModuleName(str) {
- if (str === '../common/index.mjs') {
+ if (str.startsWith('../') && str.endsWith('/common/index.mjs')) {
return 'common';
}
0 commit comments