Skip to content

Commit

Permalink
We need to be an esm module these days
Browse files Browse the repository at this point in the history
  • Loading branch information
gausie committed Sep 11, 2023
1 parent 2154c49 commit 4c8b62f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/rules/verify-constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,4 +279,4 @@ const rule: Rule.RuleModule = {
},
};

export = rule;
export default rule;
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
],
"author": "Patrick Hulin",
"main": "dist/index.js",
"type": "module",
"scripts": {
"build": "yarn run tsc",
"clean": "rm -f {lib,dist,tests}/*.js {lib,dist,tests}/*.d.ts {lib,dist,tests}/**/*.js {lib,dist,tests}/**/*.d.ts",
Expand All @@ -18,7 +19,7 @@
"lint": "yarn run eslint lib tests/lib --ext .ts",
"prepack": "yarn run build && yarn run updateData",
"test": "mocha tests --recursive --extension ts --require ts-node/register",
"updateData": "ts-node update-data.ts",
"updateData": "node --loader ts-node/esm update-data.ts",
"watch": "yarn run tsc --watch"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "commonjs",
"moduleResolution": "node",
"module": "nodenext",
"moduleResolution": "nodenext",
"strict": true,
"outDir": "dist",
"types": ["node"],
Expand Down
2 changes: 2 additions & 0 deletions update-data.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import fs from "fs";
import fetch from "node-fetch";

export {};

async function getContents(url: string) {
const response = await fetch(url);
return response.text();
Expand Down

0 comments on commit 4c8b62f

Please sign in to comment.