Skip to content

Commit 116a487

Browse files
committed
Update tools.
1 parent 3bf7c30 commit 116a487

8 files changed

Lines changed: 2136 additions & 2630 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Copyright (c) 2016, Joyent, Inc. All rights reserved.
2-
Copyright (c) 2019-2020, Третяк Костя.
2+
Copyright (c) 2019-2024, Третяк Костя.
33

44
Permission is hereby granted, free of charge, to any person obtaining a copy
55
of this software and associated documentation files (the "Software"), to deal

eslint.config.mjs

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// @ts-check
2+
3+
import eslint from '@eslint/js';
4+
import tseslint from 'typescript-eslint';
5+
6+
export default tseslint.config(
7+
eslint.configs.recommended,
8+
...tseslint.configs.recommended,
9+
{
10+
languageOptions: {
11+
parserOptions: {
12+
project: [
13+
'./tsconfig.json',
14+
]
15+
},
16+
},
17+
},
18+
{
19+
rules: {
20+
semi: ['error', 'always'],
21+
quotes: ['error', 'single', { avoidEscape: true }],
22+
'@typescript-eslint/no-floating-promises': 'error',
23+
'@typescript-eslint/no-unused-expressions': 'warn',
24+
'@typescript-eslint/no-misused-promises': 0,
25+
'@typescript-eslint/no-empty-object-type': 0,
26+
'@typescript-eslint/no-non-null-assertion': 0,
27+
'@typescript-eslint/no-empty-function': 0,
28+
'@typescript-eslint/no-empty-interface': 0,
29+
'@typescript-eslint/explicit-function-return-type': 0,
30+
'@typescript-eslint/explicit-module-boundary-types': 0,
31+
'@typescript-eslint/no-explicit-any': 0,
32+
'@typescript-eslint/no-inferrable-types': 0,
33+
'@typescript-eslint/no-non-null-asserted-optional-chain': 0,
34+
'@typescript-eslint/no-unused-vars': 0,
35+
'@typescript-eslint/triple-slash-reference': 0,
36+
'@typescript-eslint/ban-types': 0,
37+
'no-async-promise-executor': 0,
38+
'no-prototype-builtins': 0,
39+
},
40+
},
41+
{
42+
ignores: [
43+
'**/dist*',
44+
'**/*.d.ts',
45+
'website/*',
46+
'node_modules/*',
47+
'eslint.config.mjs',
48+
'**/jest.config.ts',
49+
],
50+
},
51+
);

jest.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import type { Config } from 'jest';
2+
3+
const config: Config = {
4+
testEnvironment: 'node',
5+
modulePathIgnorePatterns: ['<rootDir>/src/', '<rootDir>/test/'],
6+
};
7+
8+
export default config;

package.json

Lines changed: 36 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,50 @@
11
{
22
"name": "@ts-stack/chain-error",
3+
"type": "module",
34
"version": "1.2.0",
5+
"exports": {
6+
"./package.json": {
7+
"default": "./package.json"
8+
},
9+
".": {
10+
"types": "./dist/index.d.ts",
11+
"default": "./dist/index.js"
12+
}
13+
},
14+
"imports": {
15+
"#lib/*": "./dist/*"
16+
},
417
"description": "Richer JavaScript errors",
5-
"main": "dist/index",
6-
"typings": "dist/index",
718
"repository": "https://github.com/ts-stack/chain-error.git",
819
"homepage": "https://github.com/ts-stack/chain-error",
920
"license": "MIT",
1021
"scripts": {
11-
"test": "jest --no-cache",
12-
"rm-dists": "rimraf dist/* && rimraf dist-test/*",
13-
"build": "rimraf dist/* && tsc",
14-
"tslint": "tslint --project ./tsconfig.json '{src}/**/*.ts' --fix"
15-
},
16-
"resolutions": {
17-
"node-notifier": "^8.0.1"
22+
"test": "yarn build-test && yarn esm-jest",
23+
"esm-jest": "yarn node --experimental-vm-modules --no-warnings=ExperimentalWarning --enable-source-maps $(yarn bin jest)",
24+
"build": "tsc -b packages",
25+
"build-test": "tsc -b tsconfig.test.json"
1826
},
1927
"dependencies": {
2028
"assert-plus": "^1.0.0"
2129
},
2230
"devDependencies": {
23-
"@types/assert-plus": "^1.0.4",
24-
"@types/jasmine": "^3.5.10",
25-
"@types/jest": "^25.2.1",
26-
"jasmine": "^3.3.0",
27-
"jest": "^25.3.0",
28-
"prettier": "^2.0.4",
29-
"rimraf": "^3.0.2",
30-
"ts-jest": "^25.3.1",
31-
"tslint": "^6.1.1",
32-
"tslint-config-prettier": "^1.15.0",
33-
"tslint-plugin-prettier": "^2.0.1",
34-
"typescript": "^3.8.3"
35-
}
31+
"@types/assert-plus": "^1.0.8",
32+
"rimraf": "^6.0.1",
33+
"@eslint/js": "^9.11.1",
34+
"@types/eslint__js": "^8.42.3",
35+
"@types/jest": "^29.5.13",
36+
"@types/node": "^20.16.7",
37+
"eslint": "^8.57.1",
38+
"jest": "^29.7.0",
39+
"nodemon": "^3.1.7",
40+
"prettier": "^3.3.3",
41+
"ts-node": "^10.9.2",
42+
"typescript": "~5.5.4",
43+
"typescript-eslint": "^8.7.0"
44+
},
45+
"keywords": [
46+
"ts-stack",
47+
"error",
48+
"errors"
49+
]
3650
}

tsconfig.build.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"rootDir": "src",
5+
"tsBuildInfoFile": "dist/build.tsbuildinfo",
6+
},
7+
"include": [
8+
"src"
9+
]
10+
}

tsconfig.json

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,29 @@
11
{
22
"compilerOptions": {
3-
"target": "es2019",
4-
"module": "commonjs",
5-
"moduleResolution": "node",
3+
"strict": true,
4+
"module": "nodenext",
5+
"moduleResolution": "nodenext",
6+
"declaration": true,
7+
"declarationMap": true,
8+
"composite": true,
69
"outDir": "dist",
710
"sourceMap": true,
8-
// "rootDir": ".",
9-
// "sourceRoot": ".",
10-
// "skipLibCheck": true,
11+
"noImplicitOverride": true,
12+
"forceConsistentCasingInFileNames": true,
13+
"noImplicitReturns": true,
14+
"skipLibCheck": true,
15+
"target": "es2022",
16+
"strictPropertyInitialization": false,
17+
"noImplicitAny": true,
1118
"emitDecoratorMetadata": true,
1219
"experimentalDecorators": true,
1320
"removeComments": false,
14-
"noImplicitAny": true, // https://blogs.msdn.microsoft.com/typescript/2016/12/07/announcing-typescript-2-1/
15-
"declaration": true,
16-
"allowJs": false,
17-
"skipLibCheck": true
21+
"paths": {
22+
"#lib/*": ["./src/*"],
23+
},
1824
},
1925
"include": [
20-
"src"
26+
"src",
27+
"test"
2128
]
2229
}

tsconfig.test.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "dist-test",
5+
"rootDir": "test",
6+
"baseUrl": ".",
7+
"tsBuildInfoFile": "dist-test/test.tsbuildinfo"
8+
},
9+
"include": ["test"],
10+
"references": [
11+
{ "path": "./tsconfig.build.json" },
12+
]
13+
}

0 commit comments

Comments
 (0)