@checkdigit/typescript-config 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
package/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: node_js
2
+ node_js:
3
+ - "16"
4
+ arch: arm64
5
+ notifications:
6
+ slack: checkdigit:KPANFpO8mCjIwBUXdElcj7Mr
7
+ after_success: npm run coveralls
package/LICENSE.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2021 Check Digit, LLC
3
+ Copyright (c) 2021-2022 Check Digit, LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -3,13 +3,16 @@
3
3
  [![MIT License](https://img.shields.io/github/license/checkdigit/typescript-config)](https://github.com/checkdigit/typescript-config/blob/master/LICENSE.txt)
4
4
  [![David](https://status.david-dm.org/gh/checkdigit/typescript-config.svg)](https://status.david-dm.org/gh/checkdigit/typescript-config.svg)
5
5
 
6
- Copyright (c) 2021 [Check Digit, LLC](https://checkdigit.com)
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 14 or above
12
- - emits ES2020
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
 
15
18
  #### A note about versioning
@@ -27,10 +30,11 @@ Bear in mind, any update of Typescript can potentially break your build. But ho
27
30
  ### Installation
28
31
 
29
32
  ```
30
- npm add -D typescript
31
33
  npm add -D @checkdigit/typescript-config
32
34
  ```
33
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
+
34
38
  Make sure your project's `tsconfig.json` extends `@checkdigit/typescript-config`.
35
39
 
36
40
  ### Example `tsconfig.json`
package/package.json CHANGED
@@ -1,17 +1,13 @@
1
1
  {
2
2
  "name": "@checkdigit/typescript-config",
3
- "version": "2.2.0",
3
+ "version": "3.0.0",
4
4
  "description": "Check Digit standard Typescript configuration",
5
- "scripts": {
6
- "preversion": "npm test",
7
- "postversion": "git push && git push --tags",
8
- "test": "tsc --noEmit"
9
- },
5
+ "prettier": "@checkdigit/prettier-config",
10
6
  "engines": {
11
- "node": ">=14"
7
+ "node": ">=16"
12
8
  },
13
9
  "peerDependencies": {
14
- "typescript": ">=4.4.2"
10
+ "typescript": ">=4.7.2"
15
11
  },
16
12
  "repository": {
17
13
  "type": "git",
@@ -23,7 +19,16 @@
23
19
  "url": "https://github.com/checkdigit/typescript-config/issues"
24
20
  },
25
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
+ },
26
29
  "devDependencies": {
27
- "typescript": "4.4.2"
30
+ "@checkdigit/prettier-config": "2.0.1",
31
+ "@types/node": "^17.0.35",
32
+ "rimraf": "^3.0.2"
28
33
  }
29
34
  }
package/tsconfig.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "module": "commonjs",
4
- "target": "es2020",
3
+ "module": "node16",
4
+ "target": "es2022",
5
5
  "lib": ["esnext", "dom", "webworker"],
6
6
  "sourceMap": true,
7
7
  "outDir": "build",
package/dist/index.d.ts DELETED
@@ -1,11 +0,0 @@
1
- /**
2
- * Check for Typescript 4.4 features
3
- */
4
- interface SymbolIndexSignature {
5
- [name: symbol]: number;
6
- }
7
- interface Person {
8
- name: string;
9
- age?: number;
10
- }
11
- declare const person: Person;
package/dist/index.js DELETED
@@ -1 +0,0 @@
1
- "use strict";try{console.log("hello")}catch(e){console.error(e.message)}