diff --git a/.eslintrc.json b/.eslintrc.json index 72507a7..86ac468 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,8 @@ { "extends": "eslint", + "env": { + "es2020": true + }, "parserOptions": { "sourceType": "module", "ecmaVersion": "2020" @@ -7,5 +10,13 @@ "env": { "es6": true, "node": true - } + }, + "overrides": [ + { + "files": ["*.cjs"], + "parserOptions": { + "sourceType": "script" + } + } + ] } diff --git a/package.json b/package.json index b0e7eb6..e8a8a60 100644 --- a/package.json +++ b/package.json @@ -5,10 +5,14 @@ "type": "module", "main": "dist/eslint-visitor-keys.cjs", "exports": { - ".": { - "import": "./lib/index.js", - "require": "./dist/eslint-visitor-keys.cjs" - }, + ".": [ + { + "import": "./lib/index.js", + "require": "./dist/eslint-visitor-keys.cjs", + "default": "./dist/eslint-visitor-keys.cjs" + }, + "./dist/eslint-visitor-keys.cjs" + ], "./package.json": "./package.json" }, "files": [ diff --git a/rollup.config.js b/rollup.config.js index 7d9a537..ce75186 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,9 +1,11 @@ export default { input: "./lib/index.js", external: ["fs"], + treeshake: false, output: { exports: "default", format: "cjs", - file: "dist/eslint-visitor-keys.cjs" + file: "dist/eslint-visitor-keys.cjs", + sourcemap: true } };