| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,6 @@ | |||
| 4 | 4 | * the ESM loader or the CJS loader. | |
| 5 | 5 | */ | |
| 6 | 6 | ||
| 7 | - // eslint-disable-next-line node-core/require-common-first | ||
| 8 | 7 | import { buildType } from '../../common/index.mjs'; | |
| 9 | 8 | import assert from 'node:assert'; | |
| 10 | 9 | import { createRequire } from 'node:module'; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,6 +20,12 @@ new RuleTester({ | |||
| 20 | 20 | code: 'require("common")\n' + | |
| 21 | 21 | 'require("assert")' | |
| 22 | 22 | }, | |
| 23 | + { | ||
| 24 | + code: 'import "../../../../common/index.mjs";', | ||
| 25 | + languageOptions: { | ||
| 26 | + sourceType: 'module', | ||
| 27 | + }, | ||
| 28 | + }, | ||
| 23 | 29 | ], | |
| 24 | 30 | invalid: [ | |
| 25 | 31 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,7 +22,7 @@ module.exports = { | |||
| 22 | 22 | * @returns {string} module name | |
| 23 | 23 | */ | |
| 24 | 24 | function getModuleName(str) { | |
| 25 | - if (str === '../common/index.mjs') { | ||
| 25 | + if (str.startsWith('../') && str.endsWith('/common/index.mjs')) { | ||
| 26 | 26 | return 'common'; | |
| 27 | 27 | } | |
| 28 | 28 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments