Skip to content

Commit d12ed2e

Browse files
committed
Make sure typescript is 5.5 and include ts-node
1 parent 1179c5f commit d12ed2e

File tree

7 files changed

+203
-32
lines changed

7 files changed

+203
-32
lines changed

.eslintignore

Lines changed: 0 additions & 12 deletions
This file was deleted.

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,8 @@ coverage/
1313
report/
1414
!*.js
1515
!*.ts
16+
!*.mjs
17+
!*.cjs
18+
!*.mts
19+
!*.cts
1620
!.vscode/*.json

eslint.config.mjs

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,31 @@ const any_rules = (level) => {
3434
};
3535
/** @type {import('@typescript-eslint/utils').TSESLint.FlatConfig.ConfigArray} */
3636
export default [
37+
{
38+
ignores: [
39+
'lib/',
40+
'build/',
41+
'build-*/',
42+
'dist/',
43+
'.vscode/',
44+
'node_modules/',
45+
'coverage/',
46+
'report/',
47+
'!*.js',
48+
'!*.mjs',
49+
'!*.cjs',
50+
'!*.ts',
51+
'!.vscode/*.json',
52+
'package-lock.json',
53+
'**/node_modules',
54+
'**/dist',
55+
'**/build',
56+
'**/__snapshots__',
57+
'**/mocks',
58+
'**/coverage',
59+
'**/report',
60+
],
61+
},
3762
js.configs.recommended,
3863
tseslint.configs.eslintRecommended,
3964
...tseslint.configs.recommended,
@@ -45,26 +70,15 @@ export default [
4570
parserOptions: {
4671
ecmaVersion: 2022,
4772
sourceType: 'module',
48-
tsconfigRootDir: __dirname,
73+
tsconfigRootDir: import.meta.dirname,
4974
project: [
5075
'./tsconfig.eslint.json',
5176
'./tsconfig.json',
52-
'/tsconfig.prod.json',
77+
'./tsconfig.prod.json',
5378
],
5479
},
5580
},
5681
},
57-
{
58-
ignores: [
59-
'**/node_modules',
60-
'**/dist',
61-
'**/build',
62-
'**/__snapshots__',
63-
'**/mocks',
64-
'**/coverage',
65-
'**/report',
66-
],
67-
},
6882
// Disables all styling from eslint
6983
eslintConfigPrettier,
7084
{
@@ -119,14 +133,24 @@ export default [
119133
},
120134
},
121135
{
122-
files: ['.*.js', '.*.cjs', '*.config.cjs', '*.config.js', '*.config.ts'],
136+
name: 'linting for configuration files',
137+
files: [
138+
'.*.js',
139+
'.*.mjs',
140+
'.*.cjs',
141+
'*.config.mjs',
142+
'*.config.cjs',
143+
'*.config.js',
144+
'*.config.ts',
145+
],
123146
rules: {
124147
'no-restricted-imports': off,
125148
// Consider if this is too leanient for tests
126149
...any_rules('off'),
127150
},
128151
},
129152
{
153+
name: 'Rules for tests with jest',
130154
files: [
131155
'**/*.test.js',
132156
'**/*.spec.js',

package-lock.json

Lines changed: 155 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@
4545
"prettier": "^3.3.3",
4646
"prettier-plugin-jsdoc": "^1.3.0",
4747
"ts-jest": "^29.2.5",
48+
"ts-node": "^10.9.2",
4849
"tsc-watch": "^6.2.0",
49-
"typescript": "^5.5",
50+
"typescript": "5.5.3",
5051
"typescript-eslint": "^8.6.0"
5152
},
5253
"//": "typescrio 5.6 not supported by typescript-estree"
File renamed without changes.

tsconfig.eslint.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,12 @@
77
"src/**/*",
88
"bin/**/*",
99
"__tests__/**/*",
10-
".*.js",
1110
"*.js",
11+
"*.mjs",
12+
"*.cjs",
1213
".*.ts",
1314
"*.ts",
15+
"*.mts",
16+
"*.cts",
1417
],
1518
}

0 commit comments

Comments
 (0)