@w0s/tsconfig 1.0.1 → 1.1.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/README.md +2 -2
- package/__tests__/@types/types.d.ts +22 -0
- package/__tests__/invalid/compilerOptions/typeChecking/01 allowUnreachableCode.ts +8 -0
- package/__tests__/invalid/compilerOptions/typeChecking/02 allowUnusedLabels.ts +6 -0
- package/__tests__/invalid/compilerOptions/typeChecking/04 exactOptionalPropertyTypes.ts +4 -0
- package/__tests__/invalid/compilerOptions/typeChecking/05 noFallthroughCasesInSwitch.ts +10 -0
- package/__tests__/invalid/compilerOptions/typeChecking/06 noImplicitAny.ts +7 -0
- package/__tests__/invalid/compilerOptions/typeChecking/07 noImplicitOverride.ts +11 -0
- package/__tests__/invalid/compilerOptions/typeChecking/08 noImplicitReturns.ts +7 -0
- package/__tests__/invalid/compilerOptions/typeChecking/09 noImplicitThis.ts +15 -0
- package/__tests__/invalid/compilerOptions/typeChecking/10 noPropertyAccessFromIndexSignature.ts +9 -0
- package/__tests__/invalid/compilerOptions/typeChecking/11 noUncheckedIndexedAccess.ts +11 -0
- package/__tests__/invalid/compilerOptions/typeChecking/12 noUnusedLocals.ts +5 -0
- package/__tests__/invalid/compilerOptions/typeChecking/13 noUnusedParameters.ts +5 -0
- package/__tests__/tsconfig-invalid.json +11 -0
- package/__tests__/tsconfig-valid.json +11 -0
- package/__tests__/valid/compilerOptions/typeChecking/01 allowUnreachableCode.ts +7 -0
- package/__tests__/valid/compilerOptions/typeChecking/02 allowUnusedLabels.ts +7 -0
- package/__tests__/valid/compilerOptions/typeChecking/04 exactOptionalPropertyTypes.ts +4 -0
- package/__tests__/valid/compilerOptions/typeChecking/05 noFallthroughCasesInSwitch.ts +11 -0
- package/__tests__/valid/compilerOptions/typeChecking/06 noImplicitAny.ts +7 -0
- package/__tests__/valid/compilerOptions/typeChecking/07 noImplicitOverride.ts +11 -0
- package/__tests__/valid/compilerOptions/typeChecking/08 noImplicitReturns.ts +8 -0
- package/__tests__/valid/compilerOptions/typeChecking/09 noImplicitThis.ts +15 -0
- package/__tests__/valid/compilerOptions/typeChecking/10 noPropertyAccessFromIndexSignature.ts +7 -0
- package/__tests__/valid/compilerOptions/typeChecking/11 noUncheckedIndexedAccess.ts +8 -0
- package/__tests__/valid/compilerOptions/typeChecking/12 noUnusedLocals.ts +3 -0
- package/__tests__/valid/compilerOptions/typeChecking/13 noUnusedParameters.ts +5 -0
- package/package.json +3 -7
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# tsconfig
|
|
2
2
|
|
|
3
|
-
[](https://
|
|
4
|
-
[](https://www.npmjs.com/package/@w0s/tsconfig)
|
|
4
|
+
[](https://github.com/SaekiTominaga/w0s/actions/workflows/ts-test.yml)
|
|
5
5
|
|
|
6
6
|
[TSConfig](https://www.typescriptlang.org/tsconfig) file used on [w0s.jp](https://w0s.jp/)
|
|
7
7
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface UserDefaults {
|
|
2
|
+
// The absence of a value represents 'system'
|
|
3
|
+
colorThemeOverride?: 'dark' | 'light';
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
interface GameSettings {
|
|
7
|
+
// Known up-front properties
|
|
8
|
+
speed: 'fast' | 'medium' | 'slow';
|
|
9
|
+
quality: 'high' | 'low';
|
|
10
|
+
// Assume anything unknown to the interface
|
|
11
|
+
// is a string.
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface EnvironmentVars {
|
|
16
|
+
NAME: string;
|
|
17
|
+
OS: string;
|
|
18
|
+
// Unknown properties are covered by this index signature.
|
|
19
|
+
[propName: string]: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare const env: EnvironmentVars;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class Rectangle {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
|
|
5
|
+
constructor(width: number, height: number) {
|
|
6
|
+
this.width = width;
|
|
7
|
+
this.height = height;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
getAreaFunction() {
|
|
11
|
+
return function () {
|
|
12
|
+
return this.width * this.height;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Declared as existing
|
|
3
|
+
const sysName = env.NAME;
|
|
4
|
+
const os = env.OS;
|
|
5
|
+
|
|
6
|
+
// Not declared, but because of the index
|
|
7
|
+
// signature, then it is considered a string
|
|
8
|
+
const nodeEnv = env['NODE_ENV'];
|
|
9
|
+
|
|
10
|
+
console.debug(sysName.trim(), os.trim(), nodeEnv.trim());
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w0s/tsconfig",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "TSConfig file used on w0s.jp",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tsconfig"
|
|
7
7
|
],
|
|
8
|
-
"homepage": "https://github.com/SaekiTominaga/tsconfig#readme",
|
|
9
|
-
"bugs": {
|
|
10
|
-
"url": "https://github.com/SaekiTominaga/tsconfig/issues"
|
|
11
|
-
},
|
|
12
8
|
"license": "MIT",
|
|
13
9
|
"author": "Saeki Tominaga",
|
|
14
10
|
"files": [
|
|
@@ -17,14 +13,14 @@
|
|
|
17
13
|
"main": "tsconfig.json",
|
|
18
14
|
"repository": {
|
|
19
15
|
"type": "git",
|
|
20
|
-
"url": "git+https://github.com/SaekiTominaga/
|
|
16
|
+
"url": "git+https://github.com/SaekiTominaga/w0s.git"
|
|
21
17
|
},
|
|
22
18
|
"scripts": {
|
|
23
19
|
"test": "tsc --project __tests__/tsconfig-valid.json",
|
|
24
20
|
"test-invalid": "tsc --project __tests__/tsconfig-invalid.json"
|
|
25
21
|
},
|
|
26
22
|
"devDependencies": {
|
|
27
|
-
"typescript": "^
|
|
23
|
+
"typescript": "^5.1.3"
|
|
28
24
|
},
|
|
29
25
|
"publishConfig": {
|
|
30
26
|
"access": "public"
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2022 "><S>aekiTominaga
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|