Skip to content

Commit 5e6d9fb

Browse files
committed
convert to type "module"
1 parent 495a16a commit 5e6d9fb

File tree

4 files changed

+17
-21
lines changed

4 files changed

+17
-21
lines changed

.eslintrc.js renamed to .eslintrc.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
overrides: [
1717
{ files: '*.d.ts', rules: { strict: [ 'error', 'never' ] } },
1818
{
19-
files: [ '.eslintrc.js', 'jest.config.js' ],
19+
files: [ '.eslintrc.cjs', '.eslintrc.js', 'jest.config.js' ],
2020
rules: {
2121
'sort-keys': 'off',
2222
'array-element-newline': 'off', //['warn', { multiline: true, minItems: 6 }],
@@ -40,6 +40,7 @@ module.exports = {
4040
'node/no-missing-import': 'off',
4141
'node/no-missing-require': 'off',
4242
'node/no-process-exit': 'off',
43+
'node/no-unpublished-import': 'off',
4344
'node/no-unpublished-require': 'off',
4445
'node/no-unsupported-features/es-syntax': 'off',
4546
'array-bracket-newline': [ 'warn', { multiline: true, minItems: 6 }],

package.json

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"description": "{{package.description}}",
55
"author": "{{package.author.name}} <{{package.author.email}}>",
6+
"type": "module",
67
"license": "MIT",
78
"keywords": [
89
"nodejs",
@@ -20,9 +21,9 @@
2021
"typings": "dist/index.d.ts",
2122
"lint-staged": {
2223
"*.{js,ts}": [
23-
"biome format --write",
24+
"biome format --no-errors-on-unmatched --write",
2425
"prettier --config prettier.config.js --write",
25-
"eslint --fix"
26+
"eslint --config .eslintrc.cjs --fix"
2627
],
2728
"*.{css,gql,graphql,html,json,less,md,mdx,sass,scss}": [
2829
"prettier --config prettier.config.js --write"
@@ -37,15 +38,15 @@
3738
"analyze:deps:graph": "madge --extensions js,ts --image graph.svg --layout dot --ts-config tsconfig.json src/**",
3839
"test": "jest tests --verbose",
3940
"test:coverage": "jest tests --coverage",
40-
"fmt": "biome format --write . && prettier --config prettier.config.js --write .",
41-
"lint": "eslint --ext ts,js src/",
42-
"lint:fix": "biome lint --apply-unsafe src/ && eslint --ext ts,js --fix src/",
41+
"fmt": "biome format --no-errors-on-unmatched --write . && prettier --config prettier.config.js --write .",
42+
"lint": "eslint --config .eslintrc.cjs --ext ts,js src/",
43+
"lint:fix": "biome lint --apply-unsafe src/ && eslint --config .eslintrc.cjs --ext ts,js --fix src/",
4344
"lint:staged": "lint-staged",
4445
"fix": "npm run fmt && npm run lint:fix",
4546
"build:api-docs": "typedoc --plugin typedoc-plugin-markdown --out docs/api src/index.ts",
46-
"build:dev": "node scripts/build.js",
47-
"build:prod": "node scripts/build.js --production",
48-
"build:binaries": "node scripts/build.js --binaries",
47+
"build:dev": "node scripts/build.cjs",
48+
"build:prod": "node scripts/build.cjs --production",
49+
"build:binaries": "node scripts/build.cjs --binaries",
4950
"build:dts": "dts-bundle-generator -o dist/index.d.ts src/index.ts",
5051
"build": "npm run build:dev && npm run build:dts",
5152
"dev": "npm run build:dev && node dist/index.js",

prettier.config.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,22 @@
22
const overrides = {
33
overrides: [
44
{
5-
files: ['*.yml', '*.yaml'],
6-
options: {
7-
tabWidth: 2,
8-
},
5+
files: [ '*.yml', '*.yaml' ],
6+
options: {tabWidth: 2,},
97
},
108
{
119
files: '.madgerc',
12-
options: {
13-
parser: 'json',
14-
},
10+
options: {parser: 'json',},
1511
},
1612
{
1713
files: '.eslintrc.js',
18-
options: {
19-
quoteProps: 'consistent',
20-
},
14+
options: {quoteProps: 'consistent',},
2115
},
2216
],
2317
};
2418

2519
/** @type {import('prettier').Options} */
26-
module.exports = {
20+
export default {
2721
arrowParens: 'avoid',
2822
bracketSameLine: true,
2923
bracketSpacing: true,

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,5 @@
7272
"forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
7373
"resolveJsonModule": true
7474
},
75-
"exclude": ["configure-package.js", "src/scripts/*"]
75+
"exclude": ["configure-package.js", "src/scripts/*", "features/*", "*.config.js", ".eslintrc.cjs", "scripts/*"]
7676
}

0 commit comments

Comments
 (0)