Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions src/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {
writeFile,
} from "node:fs/promises";
import { join as pathJoin } from "node:path";
import { fileURLToPath } from "node:url";
import { EOL } from "node:os";
import {
debug,
Expand All @@ -18,10 +17,9 @@ import {
} from "./util.mjs";
import { styleText } from "node:util";

const __dirname = fileURLToPath(new URL(".", import.meta.url));
const templatePath = pathJoin(__dirname, "..", "template");
const templatePath = pathJoin(import.meta.dirname, "..", "template");

debug("__dirname", __dirname);
debug("dirname", import.meta.dirname);
debug("templatePath", templatePath);

const lineEndRegex = /\r\n|\r|\n/g;
Expand Down
6 changes: 1 addition & 5 deletions template/eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ import tsEslint from "typescript-eslint";
import prettier from "eslint-config-prettier/flat";
import nodePlugin from "eslint-plugin-n";
import globals from "globals";
import { dirname } from "node:path";
import { fileURLToPath } from "node:url";

const __dirname = dirname(fileURLToPath(import.meta.url));

export default tsEslint.config(
// https://eslint.org/docs/latest/use/configure/ignore
Expand All @@ -28,7 +24,7 @@ export default tsEslint.config(
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: __dirname,
tsconfigRootDir: import.meta.dirname,
},
globals: {
...globals.nodeBuiltin,
Expand Down