@checkdigit/typescript-config 2.0.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.travis.yml +7 -0
- package/LICENSE.txt +1 -1
- package/README.md +20 -4
- package/package.json +14 -13
- package/tsconfig.json +5 -2
package/.travis.yml
ADDED
package/LICENSE.txt
CHANGED
package/README.md
CHANGED
@@ -3,22 +3,38 @@
|
|
3
3
|
[](https://github.com/checkdigit/typescript-config/blob/master/LICENSE.txt)
|
4
4
|
[](https://status.david-dm.org/gh/checkdigit/typescript-config.svg)
|
5
5
|
|
6
|
-
Copyright (c)
|
6
|
+
Copyright (c) 2022 [Check Digit, LLC](https://checkdigit.com)
|
7
7
|
|
8
8
|
### Introduction
|
9
9
|
|
10
10
|
This module contains the standard Check Digit Typescript configuration.
|
11
|
-
- requires Node
|
12
|
-
- emits
|
11
|
+
- requires Node 16 or above
|
12
|
+
- emits ES2022
|
13
|
+
- uses the new tsconfig `module` type of `node16`. This specifies that whether commonjs or ESM is emitted is dependent
|
14
|
+
on the value of the `type` field in `package.json`. If not supplied, the default value is `commonjs`.
|
15
|
+
Set `"type": "module"` to emit ESM.
|
13
16
|
- all compiler options set for maximum strictness
|
14
17
|
|
18
|
+
#### A note about versioning
|
19
|
+
|
20
|
+
Strict semver is a little complicated, as Typescript itself does not adhere to semver. So our "best effort" policy is:
|
21
|
+
|
22
|
+
- Each new target (e.g. `ES2019` to `ES2020`) will result in a new major version of this module. We coordinate this
|
23
|
+
with whatever the latest LTS version of Node is currently supported by Amazon Lambda, Google Cloud Functions
|
24
|
+
and Azure Functions.
|
25
|
+
- Each new major version of Typescript (e.g. `4.2.x` to `4.3.x`) will result in a new minor version of this module.
|
26
|
+
- Each new minor update of Typescript (e.g. `4.3.1` to `4.3.2`) will result in a new patch version of this module.
|
27
|
+
|
28
|
+
Bear in mind, any update of Typescript can potentially break your build. But hopefully in a way that's useful.
|
29
|
+
|
15
30
|
### Installation
|
16
31
|
|
17
32
|
```
|
18
|
-
npm add -D typescript
|
19
33
|
npm add -D @checkdigit/typescript-config
|
20
34
|
```
|
21
35
|
|
36
|
+
Note: you do not need to explicitly install Typescript itself, as it comes in as a peer dependency of `@checkdigit/typescript-config`.
|
37
|
+
|
22
38
|
Make sure your project's `tsconfig.json` extends `@checkdigit/typescript-config`.
|
23
39
|
|
24
40
|
### Example `tsconfig.json`
|
package/package.json
CHANGED
@@ -1,19 +1,13 @@
|
|
1
1
|
{
|
2
2
|
"name": "@checkdigit/typescript-config",
|
3
|
-
"version": "
|
3
|
+
"version": "3.0.0",
|
4
4
|
"description": "Check Digit standard Typescript configuration",
|
5
|
-
"
|
6
|
-
"prepublishOnly": "publish",
|
7
|
-
"postpublish": "rimraf dist .npmignore",
|
8
|
-
"preversion": "npm test",
|
9
|
-
"postversion": "git push && git push --tags",
|
10
|
-
"test": "rimraf build && tsc && test -f build/index.js && test -f build/index.d.ts && test -f build/index.js.map"
|
11
|
-
},
|
5
|
+
"prettier": "@checkdigit/prettier-config",
|
12
6
|
"engines": {
|
13
|
-
"node": ">=
|
7
|
+
"node": ">=16"
|
14
8
|
},
|
15
9
|
"peerDependencies": {
|
16
|
-
"typescript": ">=4.2
|
10
|
+
"typescript": ">=4.7.2"
|
17
11
|
},
|
18
12
|
"repository": {
|
19
13
|
"type": "git",
|
@@ -25,9 +19,16 @@
|
|
25
19
|
"url": "https://github.com/checkdigit/typescript-config/issues"
|
26
20
|
},
|
27
21
|
"homepage": "https://github.com/checkdigit/typescript-config#readme",
|
22
|
+
"scripts": {
|
23
|
+
"preversion": "npm test",
|
24
|
+
"postversion": "git push && git push --tags",
|
25
|
+
"prettier": "prettier --list-different 'src/**/*.ts'",
|
26
|
+
"prettier:fix": "prettier --write 'src/**/*.ts'",
|
27
|
+
"test": "tsc && node build/index.js | grep -q 'complete' && rimraf build && npm run prettier"
|
28
|
+
},
|
28
29
|
"devDependencies": {
|
29
|
-
"@checkdigit/
|
30
|
-
"
|
31
|
-
"
|
30
|
+
"@checkdigit/prettier-config": "2.0.1",
|
31
|
+
"@types/node": "^17.0.35",
|
32
|
+
"rimraf": "^3.0.2"
|
32
33
|
}
|
33
34
|
}
|
package/tsconfig.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"compilerOptions": {
|
3
|
-
"module": "
|
4
|
-
"target": "
|
3
|
+
"module": "node16",
|
4
|
+
"target": "es2022",
|
5
5
|
"lib": ["esnext", "dom", "webworker"],
|
6
6
|
"sourceMap": true,
|
7
7
|
"outDir": "build",
|
@@ -27,6 +27,9 @@
|
|
27
27
|
"noUncheckedIndexedAccess": true,
|
28
28
|
"noPropertyAccessFromIndexSignature": true,
|
29
29
|
"allowUnusedLabels": false,
|
30
|
+
"noImplicitOverride": true,
|
31
|
+
"useUnknownInCatchVariables": true,
|
32
|
+
"exactOptionalPropertyTypes": true
|
30
33
|
},
|
31
34
|
"exclude": [
|
32
35
|
"node_modules",
|