@peerigon/configs 1.0.0-beta.8 → 1.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/CHANGELOG.md +130 -0
- package/README.md +42 -419
- package/docs/prettier.md +13 -0
- package/docs/typescript.md +15 -0
- package/eslint/README.md +119 -0
- package/eslint/presets/typescript-react.test/App.tsx +2 -0
- package/eslint/presets/typescript.test/main.ts +5 -1
- package/eslint/rules/javascript.js +6 -0
- package/eslint/rules/typescript.js +9 -1
- package/eslint/styles/no-default-export.js +2 -1
- package/package.json +120 -51
- package/prettier/README.md +35 -0
- package/prettier/base.js +6 -1
- package/prettier/css.test/styles.css +9 -0
- package/semantic-release/README.md +81 -0
- package/semantic-release/base.js +10 -13
- package/semantic-release/cross-publish.js +22 -0
- package/types/eslint/lib/glob-patterns.d.ts +9 -0
- package/types/eslint/lib/glob-patterns.d.ts.map +1 -0
- package/types/eslint/lib/rule-options.d.ts +95 -0
- package/types/eslint/lib/rule-options.d.ts.map +1 -0
- package/types/eslint/presets/javascript-browser.d.ts +4 -0
- package/types/eslint/presets/javascript-browser.d.ts.map +1 -0
- package/types/eslint/presets/javascript-node.d.ts +4 -0
- package/types/eslint/presets/javascript-node.d.ts.map +1 -0
- package/types/eslint/presets/javascript.d.ts +4 -0
- package/types/eslint/presets/javascript.d.ts.map +1 -0
- package/types/eslint/presets/javascript.test/eslint.config.d.ts +2 -0
- package/types/eslint/presets/javascript.test/eslint.config.d.ts.map +1 -0
- package/types/eslint/presets/javascript.test/main.d.ts +2 -0
- package/types/eslint/presets/javascript.test/main.d.ts.map +1 -0
- package/types/eslint/presets/javascript.test/other.d.ts +3 -0
- package/types/eslint/presets/javascript.test/other.d.ts.map +1 -0
- package/types/eslint/presets/typescript-node.d.ts +4 -0
- package/types/eslint/presets/typescript-node.d.ts.map +1 -0
- package/types/eslint/presets/typescript-react.d.ts +4 -0
- package/types/eslint/presets/typescript-react.d.ts.map +1 -0
- package/types/eslint/presets/typescript.d.ts +4 -0
- package/types/eslint/presets/typescript.d.ts.map +1 -0
- package/types/eslint/rules/base.d.ts +4 -0
- package/types/eslint/rules/base.d.ts.map +1 -0
- package/types/eslint/rules/browser.d.ts +4 -0
- package/types/eslint/rules/browser.d.ts.map +1 -0
- package/types/eslint/rules/javascript.d.ts +4 -0
- package/types/eslint/rules/javascript.d.ts.map +1 -0
- package/types/eslint/rules/node.d.ts +4 -0
- package/types/eslint/rules/node.d.ts.map +1 -0
- package/types/eslint/rules/react.d.ts +4 -0
- package/types/eslint/rules/react.d.ts.map +1 -0
- package/types/eslint/rules/typescript.d.ts +3 -0
- package/types/eslint/rules/typescript.d.ts.map +1 -0
- package/types/eslint/styles/jsx-no-literals.d.ts +4 -0
- package/types/eslint/styles/jsx-no-literals.d.ts.map +1 -0
- package/types/eslint/styles/no-default-export.d.ts +4 -0
- package/types/eslint/styles/no-default-export.d.ts.map +1 -0
- package/types/eslint/styles/no-default-export.test/eslint.config.d.ts +3 -0
- package/types/eslint/styles/no-default-export.test/eslint.config.d.ts.map +1 -0
- package/types/eslint/styles/no-default-export.test/main.d.ts +3 -0
- package/types/eslint/styles/no-default-export.test/main.d.ts.map +1 -0
- package/types/eslint/styles/no-null.d.ts +4 -0
- package/types/eslint/styles/no-null.d.ts.map +1 -0
- package/types/eslint/styles/no-null.test/eslint.config.d.ts +3 -0
- package/types/eslint/styles/no-null.test/eslint.config.d.ts.map +1 -0
- package/types/eslint/styles/no-null.test/main.d.ts +2 -0
- package/types/eslint/styles/no-null.test/main.d.ts.map +1 -0
- package/types/eslint/styles/prefer-array-shorthand.d.ts +4 -0
- package/types/eslint/styles/prefer-array-shorthand.d.ts.map +1 -0
- package/types/eslint/styles/prefer-array-shorthand.test/eslint.config.d.ts +3 -0
- package/types/eslint/styles/prefer-array-shorthand.test/eslint.config.d.ts.map +1 -0
- package/types/eslint/styles/prefer-array-shorthand.test/main.d.ts +3 -0
- package/types/eslint/styles/prefer-array-shorthand.test/main.d.ts.map +1 -0
- package/types/eslint/styles/prefer-interface.d.ts +4 -0
- package/types/eslint/styles/prefer-interface.d.ts.map +1 -0
- package/types/eslint/styles/prefer-interface.test/eslint.config.d.ts +3 -0
- package/types/eslint/styles/prefer-interface.test/eslint.config.d.ts.map +1 -0
- package/types/eslint/styles/prefer-interface.test/main.d.ts +7 -0
- package/types/eslint/styles/prefer-interface.test/main.d.ts.map +1 -0
- package/types/prettier/base.d.ts +4 -0
- package/types/prettier/base.d.ts.map +1 -0
- package/types/semantic-release/base.d.ts +4 -0
- package/types/semantic-release/base.d.ts.map +1 -0
- package/types/semantic-release/cross-publish.d.ts +4 -0
- package/types/semantic-release/cross-publish.d.ts.map +1 -0
- package/typescript/README.md +58 -0
- package/typescript/base.json +11 -3
- package/typescript/js-lib.json +9 -0
- package/typescript/lib.json +8 -4
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
export const ruleOptions: {
|
|
2
|
+
camelcase: {
|
|
3
|
+
allow: string[];
|
|
4
|
+
ignoreDestructuring: boolean;
|
|
5
|
+
properties: string;
|
|
6
|
+
};
|
|
7
|
+
"max-lines": {
|
|
8
|
+
max: number;
|
|
9
|
+
skipBlankLines: boolean;
|
|
10
|
+
skipComments: boolean;
|
|
11
|
+
};
|
|
12
|
+
"no-unused-expressions": {
|
|
13
|
+
allowShortCircuit: boolean;
|
|
14
|
+
allowTernary: boolean;
|
|
15
|
+
};
|
|
16
|
+
"no-unused-vars": {
|
|
17
|
+
vars: string;
|
|
18
|
+
varsIgnorePattern: string;
|
|
19
|
+
args: string;
|
|
20
|
+
argsIgnorePattern: string;
|
|
21
|
+
caughtErrors: string;
|
|
22
|
+
reportUsedIgnorePattern: boolean;
|
|
23
|
+
ignoreRestSiblings: boolean;
|
|
24
|
+
};
|
|
25
|
+
"@typescript-eslint/naming-convention": {
|
|
26
|
+
defaultRules: ({
|
|
27
|
+
selector: string;
|
|
28
|
+
format: string[];
|
|
29
|
+
leadingUnderscore: string;
|
|
30
|
+
trailingUnderscore: string;
|
|
31
|
+
} | {
|
|
32
|
+
selector: string[];
|
|
33
|
+
modifiers: string[];
|
|
34
|
+
format: null;
|
|
35
|
+
} | {
|
|
36
|
+
selector: string;
|
|
37
|
+
format: null;
|
|
38
|
+
})[];
|
|
39
|
+
ignoreProperties: {
|
|
40
|
+
selector: string;
|
|
41
|
+
format: null;
|
|
42
|
+
};
|
|
43
|
+
default: {
|
|
44
|
+
selector: string;
|
|
45
|
+
format: string[];
|
|
46
|
+
leadingUnderscore: string;
|
|
47
|
+
trailingUnderscore: string;
|
|
48
|
+
};
|
|
49
|
+
function: {
|
|
50
|
+
selector: string;
|
|
51
|
+
format: string[];
|
|
52
|
+
leadingUnderscore: string;
|
|
53
|
+
trailingUnderscore: string;
|
|
54
|
+
};
|
|
55
|
+
parameter: {
|
|
56
|
+
selector: string;
|
|
57
|
+
format: string[];
|
|
58
|
+
leadingUnderscore: string;
|
|
59
|
+
trailingUnderscore: string;
|
|
60
|
+
};
|
|
61
|
+
method: {
|
|
62
|
+
selector: string;
|
|
63
|
+
format: string[];
|
|
64
|
+
leadingUnderscore: string;
|
|
65
|
+
trailingUnderscore: string;
|
|
66
|
+
};
|
|
67
|
+
typeLike: {
|
|
68
|
+
selector: string;
|
|
69
|
+
format: string[];
|
|
70
|
+
leadingUnderscore: string;
|
|
71
|
+
trailingUnderscore: string;
|
|
72
|
+
};
|
|
73
|
+
enumMember: {
|
|
74
|
+
selector: string;
|
|
75
|
+
format: string[];
|
|
76
|
+
leadingUnderscore: string;
|
|
77
|
+
trailingUnderscore: string;
|
|
78
|
+
};
|
|
79
|
+
destructuring: {
|
|
80
|
+
selector: string;
|
|
81
|
+
modifiers: string[];
|
|
82
|
+
format: null;
|
|
83
|
+
};
|
|
84
|
+
requiresQuites: {
|
|
85
|
+
selector: string[];
|
|
86
|
+
modifiers: string[];
|
|
87
|
+
format: null;
|
|
88
|
+
};
|
|
89
|
+
objectLiteralProperty: {
|
|
90
|
+
selector: string;
|
|
91
|
+
format: null;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=rule-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rule-options.d.ts","sourceRoot":"","sources":["../../../eslint/lib/rule-options.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"javascript-browser.d.ts","sourceRoot":"","sources":["../../../eslint/presets/javascript-browser.js"],"names":[],"mappings":";;iCAAiC,wBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"javascript-node.d.ts","sourceRoot":"","sources":["../../../eslint/presets/javascript-node.js"],"names":[],"mappings":";;iCAAiC,wBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"javascript.d.ts","sourceRoot":"","sources":["../../../eslint/presets/javascript.js"],"names":[],"mappings":";;iCAAiC,wBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../../../../eslint/presets/javascript.test/eslint.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../eslint/presets/javascript.test/main.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"other.d.ts","sourceRoot":"","sources":["../../../../eslint/presets/javascript.test/other.js"],"names":[],"mappings":"AAAA,gBAAiB,CAAC,CAAC;AACnB,gBAAiB,CAAC,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | typeof eslintConfigPrettier | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config)[];
|
|
2
|
+
export default _default;
|
|
3
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
4
|
+
//# sourceMappingURL=typescript-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-node.d.ts","sourceRoot":"","sources":["../../../eslint/presets/typescript-node.js"],"names":[],"mappings":";;iCAAiC,wBAAwB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | typeof eslintConfigPrettier | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config)[];
|
|
2
|
+
export default _default;
|
|
3
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
4
|
+
//# sourceMappingURL=typescript-react.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript-react.d.ts","sourceRoot":"","sources":["../../../eslint/presets/typescript-react.js"],"names":[],"mappings":";;iCAAiC,wBAAwB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | typeof eslintConfigPrettier | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config)[];
|
|
2
|
+
export default _default;
|
|
3
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
4
|
+
//# sourceMappingURL=typescript.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../eslint/presets/typescript.js"],"names":[],"mappings":";;iCAAiC,wBAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../eslint/rules/base.js"],"names":[],"mappings":"AAOA,+CAA+C;AAC/C,mBADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAQzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../eslint/rules/browser.js"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,sBADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAOzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"javascript.d.ts","sourceRoot":"","sources":["../../../eslint/rules/javascript.js"],"names":[],"mappings":"AAKA,+CAA+C;AAC/C,yBADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAiJzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../eslint/rules/node.js"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,mBADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAOzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../eslint/rules/react.js"],"names":[],"mappings":"AAUA,+CAA+C;AAC/C,oBADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CA4JzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../eslint/rules/typescript.js"],"names":[],"mappings":"AAUA,6FAiME"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-no-literals.d.ts","sourceRoot":"","sources":["../../../eslint/styles/jsx-no-literals.js"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,4BADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CA0BzC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-default-export.d.ts","sourceRoot":"","sources":["../../../eslint/styles/no-default-export.js"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,8BADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAgBzC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | typeof import("eslint-config-prettier") | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config)[];
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=eslint.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/no-default-export.test/eslint.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/no-default-export.test/main.ts"],"names":[],"mappings":"wBACe,iBAAiB;AAAhC,wBAAiC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"no-null.d.ts","sourceRoot":"","sources":["../../../eslint/styles/no-null.js"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,qBADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAOzC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | typeof import("eslint-config-prettier") | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config)[];
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=eslint.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/no-null.test/eslint.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/no-null.test/main.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,MAAO,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefer-array-shorthand.d.ts","sourceRoot":"","sources":["../../../eslint/styles/prefer-array-shorthand.js"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,mCADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAYzC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | typeof import("eslint-config-prettier") | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config)[];
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=eslint.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/prefer-array-shorthand.test/eslint.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/prefer-array-shorthand.test/main.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAEzC,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prefer-interface.d.ts","sourceRoot":"","sources":["../../../eslint/styles/prefer-interface.js"],"names":[],"mappings":"AAAA,+CAA+C;AAC/C,8BADW,OAAO,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,CAOzC"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const _default: (import("eslint").Linter.Config<import("eslint").Linter.RulesRecord> | typeof import("eslint-config-prettier") | import("@typescript-eslint/utils/ts-eslint").FlatConfig.Config)[];
|
|
2
|
+
export default _default;
|
|
3
|
+
//# sourceMappingURL=eslint.config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eslint.config.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/prefer-interface.test/eslint.config.js"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/prefer-interface.test/main.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../prettier/base.js"],"names":[],"mappings":"AAoBA,wCAAwC;AACxC,qBADW,OAAO,UAAU,EAAE,MAAM,CAYlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../semantic-release/base.js"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,qBADW,OAAO,kBAAkB,EAAE,OAAO,CAgC3C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cross-publish.d.ts","sourceRoot":"","sources":["../../semantic-release/cross-publish.js"],"names":[],"mappings":"AAEA,iDAAiD;AACjD,qBADW,OAAO,kBAAkB,EAAE,OAAO,CAiB3C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# [TypeScript](https://www.typescriptlang.org/) config
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install typescript @peerigon/configs --save-dev
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Then create a `tsconfig.json` just for type-checking next to your `package.json`:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"extends": "@peerigon/configs/typescript"
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Recommended configuration in your `package.json` (using [`npm-run-all`](https://www.npmjs.com/package/npm-run-all)):
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"type": "module",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"test": "run-p test:*",
|
|
24
|
+
"test:types": "tsc"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
In case you're developing a library with a dedicated build process, we recommend to create a separate `tsconfig.build.json`:
|
|
30
|
+
|
|
31
|
+
```json
|
|
32
|
+
{
|
|
33
|
+
"extends": ["./tsconfig.json", "@peerigon/configs/typescript/lib"],
|
|
34
|
+
"include": ["src"],
|
|
35
|
+
"exclude": ["src/**/*.test.ts", "src/tests/**/*.ts"]
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
with the following `package.json` `scripts`:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"type": "module",
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsc -p tsconfig.build.json",
|
|
46
|
+
"test": "run-p test:*",
|
|
47
|
+
"test:types": "tsc"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Presets
|
|
53
|
+
|
|
54
|
+
We export the following `tsconfig.json` presets. They can be used by extending `@peerigon/configs/<preset-name>`:
|
|
55
|
+
|
|
56
|
+
- `typescript`: Recommended base config for all modern TypeScript projects
|
|
57
|
+
- `typescript/lib`: Config for building TS libraries
|
|
58
|
+
- `typescript/js-lib`: Config for building JS libraries with [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html).
|
package/typescript/base.json
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
+
"allowImportingTsExtensions": true,
|
|
3
4
|
"checkJs": true,
|
|
5
|
+
// TODO: Enable erasableSyntaxOnly when TS 5.8 is released
|
|
6
|
+
// https://www.totaltypescript.com/erasable-syntax-only
|
|
7
|
+
// "erasableSyntaxOnly": true,
|
|
4
8
|
"esModuleInterop": true,
|
|
5
|
-
|
|
9
|
+
// by complaining about too much unproblematic code. We may revisit this decision later.
|
|
10
|
+
// We decided to turn off `exactOptionalPropertyTypes` because it's too strict
|
|
11
|
+
"exactOptionalPropertyTypes": false,
|
|
6
12
|
"forceConsistentCasingInFileNames": true,
|
|
7
13
|
"isolatedModules": true,
|
|
8
14
|
"lib": ["DOM", "ESNext"],
|
|
9
15
|
"module": "NodeNext",
|
|
10
|
-
"noEmit": true,
|
|
16
|
+
"noEmit": true,
|
|
11
17
|
"noImplicitOverride": true,
|
|
12
18
|
"noImplicitReturns": true,
|
|
13
19
|
"noPropertyAccessFromIndexSignature": true,
|
|
14
20
|
"noUncheckedIndexedAccess": true,
|
|
15
21
|
"resolveJsonModule": true,
|
|
22
|
+
"rewriteRelativeImportExtensions": true,
|
|
16
23
|
"skipLibCheck": true,
|
|
17
24
|
"strict": true,
|
|
18
|
-
"target": "ESNext"
|
|
25
|
+
"target": "ESNext",
|
|
26
|
+
"verbatimModuleSyntax": true
|
|
19
27
|
},
|
|
20
28
|
"$schema": "https://json.schemastore.org/tsconfig"
|
|
21
29
|
}
|
package/typescript/lib.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"extends": "./
|
|
2
|
+
"extends": "./base.json",
|
|
3
3
|
"compilerOptions": {
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
4
|
+
"declaration": true,
|
|
5
|
+
"declarationMap": true,
|
|
6
|
+
"noEmit": false,
|
|
7
|
+
"outDir": "${configDir}/dist",
|
|
8
|
+
"sourceMap": true
|
|
9
|
+
},
|
|
10
|
+
"$schema": "https://json.schemastore.org/tsconfig"
|
|
7
11
|
}
|