Using the Atom editor, with the linter-eslint package installed, I have a node.mjs script that uses ES6 module\'s import statement to import various node modules.
Th
I am sure the is not the best solution but I did this...
First create another file (I used Util.mjs) and move the logic into that...
import path from 'path';
const __dirname = path.dirname(new URL(import.meta.url).pathname);
export { __dirname }
Then create .eslintignore
and add {path}/Util.mjs
. Finally use the new import in your original class...
import {__dirname} from './Util.mjs';