diff --git a/.eslintrc.js b/.eslintrc.cjs similarity index 100% rename from .eslintrc.js rename to .eslintrc.cjs diff --git a/.huskyrc.js b/.huskyrc.cjs similarity index 100% rename from .huskyrc.js rename to .huskyrc.cjs diff --git a/lint-staged.config.js b/lint-staged.config.cjs similarity index 100% rename from lint-staged.config.js rename to lint-staged.config.cjs diff --git a/package.json b/package.json index 68ec11de..a2a836ac 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "./CONTRIBUTING.md" ], "bin": "dist/cli/index.js", + "type": "module", "exports": { "./eslint": "./dist/eslint.js", "./husky": "./dist/husky.js", diff --git a/src/cli/index.ts b/src/cli/index.ts index 14818007..a99a0073 100644 --- a/src/cli/index.ts +++ b/src/cli/index.ts @@ -16,6 +16,7 @@ */ import yargs from 'yargs'; +import { hideBin } from 'yargs/helpers'; import { run, type RunParams } from './run.js'; import { init, type InitParams } from './init.js'; @@ -23,7 +24,7 @@ import { debug } from './debug.js'; import { DEFAULT_OPTIONS } from './defaults.js'; // eslint-disable-next-line no-void -void yargs +void yargs(hideBin(process.argv)) .command( 'init', "Initialize Foundry's tools in your project", diff --git a/tsconfig.json b/tsconfig.json index b789b793..66159bf0 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,13 +2,13 @@ "compilerOptions": { "lib": ["ES2020"], "target": "ES2020", - "module": "commonjs", + "module": "NodeNext", "declaration": true, "strict": true, "skipLibCheck": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, - "moduleResolution": "node", + "moduleResolution": "nodenext", "resolveJsonModule": true, "isolatedModules": true, "outDir": "./dist"