@peerigon/configs 1.0.0-beta.9 → 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 +124 -0
- package/README.md +42 -419
- 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 +53 -36
- package/prettier/README.md +35 -0
- package/prettier/base.js +2 -0
- package/prettier/css.test/styles.css +9 -0
- package/semantic-release/README.md +81 -0
- package/semantic-release/base.js +6 -12
- package/semantic-release/cross-publish.js +22 -0
- package/types/eslint/presets/javascript.test/other.d.ts.map +1 -1
- package/types/eslint/rules/javascript.d.ts.map +1 -1
- package/types/eslint/rules/typescript.d.ts.map +1 -1
- package/types/eslint/styles/no-default-export.d.ts.map +1 -1
- package/types/eslint/styles/no-default-export.test/main.d.ts.map +1 -1
- package/types/prettier/base.d.ts.map +1 -1
- package/types/semantic-release/base.d.ts.map +1 -1
- 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 -6
- package/typescript/lib.json +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,127 @@
|
|
|
1
|
+
# 1.0.0 (2025-02-04)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- Add rootDir to lib tsconfig ([764e0c1](https://github.com/peerigon/configs/commit/764e0c191f07dfd1d996937a4df488d56be5a159))
|
|
6
|
+
- Adjust release script ([df43151](https://github.com/peerigon/configs/commit/df431514d28fd32d2bd69a50eeb8edf3e6cc1d44))
|
|
7
|
+
- Adjust release script ([3668267](https://github.com/peerigon/configs/commit/366826718205e6f542f69d890a44c3595fa84340))
|
|
8
|
+
- Changelog not formatted correctly ([cc12fa7](https://github.com/peerigon/configs/commit/cc12fa7abe725c4ab8597296094e2e485b1346e0))
|
|
9
|
+
- CHANGELOG.md not being properly formatted ([22720ea](https://github.com/peerigon/configs/commit/22720ea8bc3aab0477a89094b24f567571860c15))
|
|
10
|
+
- Downgrade ESLint ([d09f208](https://github.com/peerigon/configs/commit/d09f2084646c68fd9998685143563ba88ddaab0a))
|
|
11
|
+
- Improve error message for no-default-export ([198c911](https://github.com/peerigon/configs/commit/198c91151a3dfd33339715c21ec95aa7c5bfbe05))
|
|
12
|
+
- Missing files in package.json files array ([97111b6](https://github.com/peerigon/configs/commit/97111b66b1a741e25820bcf43b17355b59a95fca))
|
|
13
|
+
- Missing packages write permission in Github action ([ce0d482](https://github.com/peerigon/configs/commit/ce0d4820e2e75f164f5385e48bd8978c250216f1))
|
|
14
|
+
- Move package types to regular dependencies ([6d6c169](https://github.com/peerigon/configs/commit/6d6c1695989f04898a1e730b6320b2cbea158a8f))
|
|
15
|
+
- noEmit setting in TypeScript configs ([281334c](https://github.com/peerigon/configs/commit/281334c3565ca0cd1afcc8d39a94857a0d42e9ae))
|
|
16
|
+
- Prettify CHANGELOG.md ([f904e8d](https://github.com/peerigon/configs/commit/f904e8d535a8d04d615281bb942ccd8b2f12a9d9))
|
|
17
|
+
- Relax switch-exhaustiveness-check rule ([2f158a4](https://github.com/peerigon/configs/commit/2f158a4a25770897c6140d3356161349b79c1cc2))
|
|
18
|
+
- Remove rootDir config from lib tsconfig again ([84fe9dc](https://github.com/peerigon/configs/commit/84fe9dca95cdeba4e188d57a489ec6e12608fed4))
|
|
19
|
+
- Turn of TS's exactOptionalPropertyTypes ([4069985](https://github.com/peerigon/configs/commit/4069985cad9b2da629e441cc1f02fd0e4be7f4a0))
|
|
20
|
+
- Turn off unicorn/import-style ([f3be043](https://github.com/peerigon/configs/commit/f3be04315de51747319899f1ede9be15c1df5d6b))
|
|
21
|
+
- Turn off unicorn/no-single-promise-in-promise-methods ([0557a83](https://github.com/peerigon/configs/commit/0557a83c45b2fe3198f84d47412c90fbb87ddd69))
|
|
22
|
+
- TypeScript configs ([0c584e7](https://github.com/peerigon/configs/commit/0c584e70fd840e6ca857f4b177a21a389d958633))
|
|
23
|
+
- Use cross-publish semantic release config ([c079ce0](https://github.com/peerigon/configs/commit/c079ce0df36b436ffc46da9e86a562855b8f2082))
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
- Add docs ([83e7f61](https://github.com/peerigon/configs/commit/83e7f617d6fc44abcd7e0d05c700299d8e2910c2))
|
|
28
|
+
- Add shareable semantic-release config ([e0b585a](https://github.com/peerigon/configs/commit/e0b585a4eaaa4dbcfb206315870d3a22fa1d7186))
|
|
29
|
+
- Also release on Github ([0e3e84f](https://github.com/peerigon/configs/commit/0e3e84f54a4689c8c0c3a340435346c351662cc9))
|
|
30
|
+
- Enable .ts imports ([781a4a9](https://github.com/peerigon/configs/commit/781a4a97e15df6b218959c76c62a2e0893b3c026))
|
|
31
|
+
- Improve CSS property sorting ([f9b9790](https://github.com/peerigon/configs/commit/f9b97901a318146bdaa81b9c2019e9038104b389))
|
|
32
|
+
- Improve TS configs and add library types ([760a898](https://github.com/peerigon/configs/commit/760a8983b9d780601e7c6e2cb2c867f45f55f25f))
|
|
33
|
+
- Initial release ([8f12887](https://github.com/peerigon/configs/commit/8f128873b8481832dea06c88115a785c3c7a3627))
|
|
34
|
+
- Update dependencies ([07d0f37](https://github.com/peerigon/configs/commit/07d0f3781186cc86603444e0c2cf3b5185e3844a))
|
|
35
|
+
- Update dependencies ([839e69c](https://github.com/peerigon/configs/commit/839e69cdfef60349772479b7f5a7105c81be9d93))
|
|
36
|
+
- Update dependencies ([836a04f](https://github.com/peerigon/configs/commit/836a04f798741639837bb56fcf3ecbc028794c14))
|
|
37
|
+
- Update dependencies ([6bb1f24](https://github.com/peerigon/configs/commit/6bb1f242e7de360d96868b8e2b6aea58ce493c31))
|
|
38
|
+
|
|
39
|
+
# [1.0.0-beta.22](https://github.com/peerigon/configs/compare/v1.0.0-beta.21...v1.0.0-beta.22) (2025-02-04)
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
- Update dependencies ([07d0f37](https://github.com/peerigon/configs/commit/07d0f3781186cc86603444e0c2cf3b5185e3844a))
|
|
44
|
+
|
|
45
|
+
# [1.0.0-beta.21](https://github.com/peerigon/configs/compare/v1.0.0-beta.20...v1.0.0-beta.21) (2025-01-27)
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
- Missing packages write permission in Github action ([ce0d482](https://github.com/peerigon/configs/commit/ce0d4820e2e75f164f5385e48bd8978c250216f1))
|
|
50
|
+
|
|
51
|
+
# [1.0.0-beta.20](https://github.com/peerigon/configs/compare/v1.0.0-beta.19...v1.0.0-beta.20) (2025-01-27)
|
|
52
|
+
|
|
53
|
+
### Bug Fixes
|
|
54
|
+
|
|
55
|
+
- Use cross-publish semantic release config ([c079ce0](https://github.com/peerigon/configs/commit/c079ce0df36b436ffc46da9e86a562855b8f2082))
|
|
56
|
+
|
|
57
|
+
# [1.0.0-beta.19](https://github.com/peerigon/configs/compare/v1.0.0-beta.18...v1.0.0-beta.19) (2025-01-27)
|
|
58
|
+
|
|
59
|
+
### Features
|
|
60
|
+
|
|
61
|
+
- Enable .ts imports ([781a4a9](https://github.com/peerigon/configs/commit/781a4a97e15df6b218959c76c62a2e0893b3c026))
|
|
62
|
+
- Update dependencies ([839e69c](https://github.com/peerigon/configs/commit/839e69cdfef60349772479b7f5a7105c81be9d93))
|
|
63
|
+
|
|
64
|
+
# [1.0.0-beta.18](https://github.com/peerigon/configs/compare/v1.0.0-beta.17...v1.0.0-beta.18) (2025-01-26)
|
|
65
|
+
|
|
66
|
+
### Features
|
|
67
|
+
|
|
68
|
+
- Add docs ([83e7f61](https://github.com/peerigon/configs/commit/83e7f617d6fc44abcd7e0d05c700299d8e2910c2))
|
|
69
|
+
|
|
70
|
+
# [1.0.0-beta.17](https://github.com/peerigon/configs/compare/v1.0.0-beta.16...v1.0.0-beta.17) (2025-01-20)
|
|
71
|
+
|
|
72
|
+
### Bug Fixes
|
|
73
|
+
|
|
74
|
+
- Changelog not formatted correctly ([cc12fa7](https://github.com/peerigon/configs/commit/cc12fa7abe725c4ab8597296094e2e485b1346e0))
|
|
75
|
+
|
|
76
|
+
# [1.0.0-beta.16](https://github.com/peerigon/configs/compare/v1.0.0-beta.15...v1.0.0-beta.16) (2025-01-20)
|
|
77
|
+
|
|
78
|
+
### Bug Fixes
|
|
79
|
+
|
|
80
|
+
- CHANGELOG.md not being properly formatted ([22720ea](https://github.com/peerigon/configs/commit/22720ea8bc3aab0477a89094b24f567571860c15))
|
|
81
|
+
|
|
82
|
+
### Features
|
|
83
|
+
|
|
84
|
+
- Improve CSS property sorting ([f9b9790](https://github.com/peerigon/configs/commit/f9b97901a318146bdaa81b9c2019e9038104b389))
|
|
85
|
+
|
|
86
|
+
# [1.0.0-beta.15](https://github.com/peerigon/configs/compare/v1.0.0-beta.14...v1.0.0-beta.15) (2024-12-30)
|
|
87
|
+
|
|
88
|
+
### Bug Fixes
|
|
89
|
+
|
|
90
|
+
- Remove rootDir config from lib tsconfig again ([84fe9dc](https://github.com/peerigon/configs/commit/84fe9dca95cdeba4e188d57a489ec6e12608fed4))
|
|
91
|
+
|
|
92
|
+
# [1.0.0-beta.14](https://github.com/peerigon/configs/compare/v1.0.0-beta.13...v1.0.0-beta.14) (2024-12-30)
|
|
93
|
+
|
|
94
|
+
### Bug Fixes
|
|
95
|
+
|
|
96
|
+
- Add rootDir to lib tsconfig ([764e0c1](https://github.com/peerigon/configs/commit/764e0c191f07dfd1d996937a4df488d56be5a159))
|
|
97
|
+
|
|
98
|
+
# [1.0.0-beta.13](https://github.com/peerigon/configs/compare/v1.0.0-beta.12...v1.0.0-beta.13) (2024-12-30)
|
|
99
|
+
|
|
100
|
+
### Bug Fixes
|
|
101
|
+
|
|
102
|
+
- Improve error message for no-default-export ([198c911](https://github.com/peerigon/configs/commit/198c91151a3dfd33339715c21ec95aa7c5bfbe05))
|
|
103
|
+
|
|
104
|
+
# [1.0.0-beta.12](https://github.com/peerigon/configs/compare/v1.0.0-beta.11...v1.0.0-beta.12) (2024-12-30)
|
|
105
|
+
|
|
106
|
+
### Bug Fixes
|
|
107
|
+
|
|
108
|
+
- Turn off unicorn/import-style ([f3be043](https://github.com/peerigon/configs/commit/f3be04315de51747319899f1ede9be15c1df5d6b))
|
|
109
|
+
|
|
110
|
+
# [1.0.0-beta.11](https://github.com/peerigon/configs/compare/v1.0.0-beta.10...v1.0.0-beta.11) (2024-12-15)
|
|
111
|
+
|
|
112
|
+
### Bug Fixes
|
|
113
|
+
|
|
114
|
+
- Move package types to regular dependencies ([6d6c169](https://github.com/peerigon/configs/commit/6d6c1695989f04898a1e730b6320b2cbea158a8f))
|
|
115
|
+
- noEmit setting in TypeScript configs ([281334c](https://github.com/peerigon/configs/commit/281334c3565ca0cd1afcc8d39a94857a0d42e9ae))
|
|
116
|
+
- Relax switch-exhaustiveness-check rule ([2f158a4](https://github.com/peerigon/configs/commit/2f158a4a25770897c6140d3356161349b79c1cc2))
|
|
117
|
+
|
|
118
|
+
# [1.0.0-beta.10](https://github.com/peerigon/configs/compare/v1.0.0-beta.9...v1.0.0-beta.10) (2024-12-11)
|
|
119
|
+
|
|
120
|
+
### Bug Fixes
|
|
121
|
+
|
|
122
|
+
- Turn of TS's exactOptionalPropertyTypes ([4069985](https://github.com/peerigon/configs/commit/4069985cad9b2da629e441cc1f02fd0e4be7f4a0))
|
|
123
|
+
- Turn off unicorn/no-single-promise-in-promise-methods ([0557a83](https://github.com/peerigon/configs/commit/0557a83c45b2fe3198f84d47412c90fbb87ddd69))
|
|
124
|
+
|
|
1
125
|
# [1.0.0-beta.9](https://github.com/peerigon/configs/compare/v1.0.0-beta.8...v1.0.0-beta.9) (2024-12-09)
|
|
2
126
|
|
|
3
127
|
### Features
|
package/README.md
CHANGED
|
@@ -1,451 +1,74 @@
|
|
|
1
|
-
#
|
|
1
|
+
# configs
|
|
2
2
|
|
|
3
|
-
**[
|
|
3
|
+
**Best practice configs for [ESLint](https://eslint.org/), [Prettier](https://prettier.io/), [TypeScript](https://www.typescriptlang.org/) & friends. By [Peerigon](https://www.peerigon.com/).**
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@peerigon/configs)
|
|
6
6
|
[](https://github.com/semantic-release/semantic-release)
|
|
7
|
-
[](https://www.npmjs.com/package/@peerigon/configs)<br>
|
|
8
|
+
[](./LICENSE)
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
## Installation
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
- ease of writing.
|
|
15
|
-
|
|
16
|
-
We think that
|
|
17
|
-
|
|
18
|
-
- code is read more often than refactored
|
|
19
|
-
- and refactored more often than written from scratch.
|
|
20
|
-
|
|
21
|
-
Our linting rules have been designed with these assumptions in mind.
|
|
22
|
-
|
|
23
|
-
## Table of contents
|
|
24
|
-
|
|
25
|
-
- [Quick start](#quick-start)
|
|
26
|
-
- [Practical guide](#practical-guide)
|
|
27
|
-
- [Provided configs](#provided-configs)
|
|
28
|
-
- [Styles](#styles)
|
|
29
|
-
|
|
30
|
-
## Quick start
|
|
31
|
-
|
|
32
|
-
Recommended configuration in your `package.json`:
|
|
33
|
-
|
|
34
|
-
```js
|
|
35
|
-
{
|
|
36
|
-
"scripts": {
|
|
37
|
-
"test:lint": "eslint --max-warnings 0 --cache",
|
|
38
|
-
"posttest": "npm run test:lint"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
We also offer a [Prettier](https://prettier.io/) config that matches our ESLint config. Create a `.prettierrc.json` in your project with the following content:
|
|
44
|
-
|
|
45
|
-
```json
|
|
46
|
-
"eslint-config-peerigon/prettier.config.js"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
There are presets for the most common setups:
|
|
50
|
-
|
|
51
|
-
### TypeScript
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
npm i eslint eslint-config-peerigon --save-dev
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
```js
|
|
58
|
-
{
|
|
59
|
-
"extends": [
|
|
60
|
-
"peerigon/presets/typescript.js"
|
|
61
|
-
],
|
|
62
|
-
"env": {
|
|
63
|
-
"node": true
|
|
64
|
-
},
|
|
65
|
-
"root": true
|
|
66
|
-
}
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### TypeScript + React
|
|
70
|
-
|
|
71
|
-
```
|
|
72
|
-
npm i eslint eslint-config-peerigon eslint-plugin-react eslint-plugin-jsx-a11y eslint-plugin-react-hooks --save-dev
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
```js
|
|
76
|
-
{
|
|
77
|
-
"extends": [
|
|
78
|
-
"peerigon/presets/typescript-react.js"
|
|
79
|
-
],
|
|
80
|
-
"env": {
|
|
81
|
-
"node": true,
|
|
82
|
-
"browser": true
|
|
83
|
-
},
|
|
84
|
-
"root": true
|
|
85
|
-
}
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
### TypeScript + Node
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
npm i eslint eslint-config-peerigon eslint-plugin-n --save-dev
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
```js
|
|
95
|
-
{
|
|
96
|
-
"extends": [
|
|
97
|
-
"peerigon/presets/typescript-node.js"
|
|
98
|
-
],
|
|
99
|
-
"root": true
|
|
100
|
-
}
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
## Practical guide
|
|
104
|
-
|
|
105
|
-
### Disabling rules
|
|
106
|
-
|
|
107
|
-
Try to disable as less rules as possible. In most cases it's best to just write
|
|
108
|
-
|
|
109
|
-
```js
|
|
110
|
-
// eslint-disable-next-line [rule-code]
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
where `[rule-code]` is the code that is displayed along the error message. Disabling the next line is usually better because it resists [Prettier](https://prettier.io/) reformatting.
|
|
114
|
-
|
|
115
|
-
Sometimes it makes sense to disable a rule within a specifc file. In that case you can put the following snippet at the beginning of the file:
|
|
116
|
-
|
|
117
|
-
```js
|
|
118
|
-
/* eslint-disable [rule-code] */
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
If you don't agree with a rule, please do not just disable the rule. Often there are good reasons and the current setting is the result of years of experience. It's better to create an issue here to start a discussion about the pros and cons of a rule.
|
|
122
|
-
|
|
123
|
-
### Different styles
|
|
124
|
-
|
|
125
|
-
We acknowledge that there are certain rules where there are no actual pros and cons or where there is no clear winner. You just have to decide for one style and stick with it. We also know that some rules make sense in one project, but don't make sense in another project. That's why we also provide a list of [accepted custom styles](#styles) (see also [this discussion](https://github.com/peerigon/eslint-config-peerigon/issues/11)) which you can pick.
|
|
126
|
-
|
|
127
|
-
### VSCode
|
|
128
|
-
|
|
129
|
-
This is our recommended VSCode configuration using the [Prettier extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode). Adjust it to the needs of your particular project:
|
|
130
|
-
|
|
131
|
-
```json
|
|
132
|
-
{
|
|
133
|
-
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
134
|
-
"editor.formatOnSave": true,
|
|
135
|
-
"editor.codeActionsOnSave": {
|
|
136
|
-
"source.fixAll.eslint": true
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
```
|
|
140
|
-
|
|
141
|
-
### Experimental syntax using Babel
|
|
142
|
-
|
|
143
|
-
If you're using Babel you should set [`requireConfigFile: true`](https://github.com/babel/babel/tree/main/eslint/babel-eslint-parser#additional-parser-configuration) in your ESLint config. ESLint will then use your `babel.config.json`.
|
|
144
|
-
|
|
145
|
-
```js
|
|
146
|
-
{
|
|
147
|
-
"parserOptions": { "requireConfigFile": true },
|
|
148
|
-
}
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Naming conventions for properties
|
|
152
|
-
|
|
153
|
-
Sometimes we're not in full control over the naming conventions in our codebase, for instance if data is coming from a foreign API. While it often is preferable to transform property names into camelCase, it might not be practical. In these situations you can disable the check for properties like this:
|
|
154
|
-
|
|
155
|
-
```js
|
|
156
|
-
const options = require("eslint-config-peerigon/options.js");
|
|
157
|
-
|
|
158
|
-
module.exports = {
|
|
159
|
-
/* ... */
|
|
160
|
-
rules: {
|
|
161
|
-
// The API uses snake_case as properties
|
|
162
|
-
camelcase: [
|
|
163
|
-
"warn",
|
|
164
|
-
{
|
|
165
|
-
...options["camelcase"],
|
|
166
|
-
properties: "never",
|
|
167
|
-
},
|
|
168
|
-
],
|
|
169
|
-
},
|
|
170
|
-
};
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
**In TypeScript projects:**
|
|
174
|
-
|
|
175
|
-
```js
|
|
176
|
-
const options = require("eslint-config-peerigon/options.js");
|
|
177
|
-
|
|
178
|
-
module.exports = {
|
|
179
|
-
/* ... */
|
|
180
|
-
rules: {
|
|
181
|
-
// The API uses snake_case as properties
|
|
182
|
-
"@typescript-eslint/naming-convention": [
|
|
183
|
-
"warn",
|
|
184
|
-
options["@typescript-eslint/naming-convention"].ignoreProperties,
|
|
185
|
-
...options["@typescript-eslint/naming-convention"].defaultRules,
|
|
186
|
-
],
|
|
187
|
-
},
|
|
188
|
-
};
|
|
189
|
-
```
|
|
190
|
-
|
|
191
|
-
## Provided configs
|
|
192
|
-
|
|
193
|
-
### [`peerigon`](base.js)
|
|
194
|
-
|
|
195
|
-
**Base rules for every project. You should always add these rules.**
|
|
196
|
-
|
|
197
|
-
```
|
|
198
|
-
npm i eslint eslint-config-peerigon --save-dev
|
|
199
|
-
```
|
|
200
|
-
|
|
201
|
-
These rules assume a modern project with full ES2015 support, including ES modules. For specific environments like Node.js or old JS engines, see below. The base rules do not define an `env`, so you might want to do that for yourself to enable specific globals.
|
|
202
|
-
|
|
203
|
-
Add an `.eslintrc.json` to the project's root folder:
|
|
204
|
-
|
|
205
|
-
```js
|
|
206
|
-
{
|
|
207
|
-
"extends": [
|
|
208
|
-
// Base rules for every project
|
|
209
|
-
"peerigon"
|
|
210
|
-
],
|
|
211
|
-
// Do not search for further eslint configs in upper directories
|
|
212
|
-
"root": true,
|
|
213
|
-
// If you're using Babel, you should set requireConfigFile: true
|
|
214
|
-
// ESLint will then use your babel.config.json.
|
|
215
|
-
// "parserOptions": { "requireConfigFile": true },
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
The base rules use the `eslint-plugin-import` to resolve imports. Although it's possible to define [custom resolvers](https://github.com/benmosher/eslint-plugin-import#resolvers), it's highly discouraged to deviate from the common Node.js resolving algorithm. Other tools like linters and intellisense don't work reliably when you change the resolver.
|
|
220
|
-
|
|
221
|
-
### [`peerigon/typescript`](typescript.js)
|
|
222
|
-
|
|
223
|
-
Rules for [TypeScript](https://www.typescriptlang.org/).
|
|
224
|
-
|
|
225
|
-
```js
|
|
226
|
-
{
|
|
227
|
-
"extends": [
|
|
228
|
-
"peerigon",
|
|
229
|
-
"peerigon/typescript",
|
|
230
|
-
// Arrow functions are preferred with TypeScript
|
|
231
|
-
// See https://github.com/peerigon/eslint-config-peerigon/issues/23#issuecomment-472614432
|
|
232
|
-
"peerigon/styles/prefer-arrow"
|
|
233
|
-
],
|
|
234
|
-
"root": true,
|
|
235
|
-
}
|
|
12
|
+
```sh
|
|
13
|
+
npm install @peerigon/configs
|
|
236
14
|
```
|
|
237
15
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
```js
|
|
241
|
-
{
|
|
242
|
-
"scripts": {
|
|
243
|
-
"test:lint": "eslint --max-warnings 0 --cache --ext js,jsx,cjs,mjs,ts,tsx --ignore-path .gitignore ."
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
_We recommend using [`peerigon/styles/prefer-arrow`](#peerigonstylesprefer-arrow) because arrow functions (or function expressions in general) can leverage [TypeScript's contextual typing](https://www.typescriptlang.org/docs/handbook/type-inference.html#contextual-typing)._
|
|
249
|
-
|
|
250
|
-
### [`peerigon/node`](node.js)
|
|
16
|
+
Also checkout the instructions for each respective config:
|
|
251
17
|
|
|
252
|
-
|
|
18
|
+
- [ESLint](/eslint/README.md)
|
|
19
|
+
- [Prettier](/prettier/README.md)
|
|
20
|
+
- [TypeScript](/typescript/README.md)
|
|
21
|
+
- [Semantic release](/semantic-release/README.md)
|
|
253
22
|
|
|
254
|
-
|
|
255
|
-
npm i eslint-plugin-n --save-dev
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
```js
|
|
259
|
-
{
|
|
260
|
-
"extends": [
|
|
261
|
-
"peerigon",
|
|
262
|
-
"peerigon/node"
|
|
263
|
-
],
|
|
264
|
-
// Setting env.node = true is not necessary, this is already done by peerigon/node
|
|
265
|
-
"root": true
|
|
266
|
-
}
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
### [`peerigon/react`](react.js)
|
|
270
|
-
|
|
271
|
-
**Important: Requires [`eslint-plugin-react`](https://github.com/yannickcr/eslint-plugin-react), [`eslint-plugin-jsx-a11y`](https://github.com/evcohen/eslint-plugin-jsx-a11y) and [`eslint-plugin-react-hooks`](https://www.npmjs.com/package/eslint-plugin-react-hooks) as project dependency.**
|
|
272
|
-
|
|
273
|
-
```
|
|
274
|
-
npm i eslint-plugin-react eslint-plugin-jsx-a11y eslint-plugin-react-hooks --save-dev
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
Rules for [React](https://facebook.github.io/react/) development, including accessibility rules.
|
|
278
|
-
These rules are also applicable in other JSX environments, like [Preact](https://github.com/developit/preact):
|
|
279
|
-
|
|
280
|
-
```js
|
|
281
|
-
{
|
|
282
|
-
"extends": [
|
|
283
|
-
"peerigon",
|
|
284
|
-
"peerigon/react"
|
|
285
|
-
],
|
|
286
|
-
"root": true
|
|
287
|
-
}
|
|
288
|
-
```
|
|
289
|
-
|
|
290
|
-
_We recommend using [`peerigon/styles/react-jsx-no-literals`](#peerigonstylesreact-jsx-no-literals) if you're using i18n in your project._
|
|
291
|
-
_You can use [`peerigon/styles/react-jsx-no-bind`](#peerigonstylesreact-jsx-no-bind) if you're using `memo` and `shouldComponentUpdate` a lot._
|
|
292
|
-
|
|
293
|
-
### [`peerigon/jsdoc`](jsdoc.js)
|
|
294
|
-
|
|
295
|
-
**Important: Requires [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc) as project dependency.**
|
|
296
|
-
|
|
297
|
-
```
|
|
298
|
-
npm i eslint-plugin-jsdoc --save-dev
|
|
299
|
-
```
|
|
300
|
-
|
|
301
|
-
Makes sure that JSDoc annotations are written in a standard-compliant and uniform way.
|
|
302
|
-
|
|
303
|
-
```js
|
|
304
|
-
{
|
|
305
|
-
"extends": [
|
|
306
|
-
"peerigon",
|
|
307
|
-
"peerigon/jsdoc"
|
|
308
|
-
],
|
|
309
|
-
"root": true
|
|
310
|
-
}
|
|
311
|
-
```
|
|
312
|
-
|
|
313
|
-
## Styles
|
|
314
|
-
|
|
315
|
-
The following rules enable specific writing styles. Use them as you prefer.
|
|
316
|
-
|
|
317
|
-
### [`peerigon/styles/prefer-arrow`](styles/prefer-arrow.js)
|
|
318
|
-
|
|
319
|
-
Enforces arrow function expressions instead of function declarations (see [#23](https://github.com/peerigon/eslint-config-peerigon/issues/23)).
|
|
320
|
-
Regular functions are still allowed as methods in objects or classes.
|
|
321
|
-
|
|
322
|
-
```js
|
|
323
|
-
"extends": [
|
|
324
|
-
"peerigon",
|
|
325
|
-
"peerigon/styles/prefer-arrow"
|
|
326
|
-
],
|
|
327
|
-
```
|
|
23
|
+
## Philosophy
|
|
328
24
|
|
|
329
|
-
|
|
25
|
+
Linting, formatting and type-checking rules are always a balance between:
|
|
330
26
|
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
"extends": [
|
|
335
|
-
"peerigon",
|
|
336
|
-
"peerigon/styles/no-default-export"
|
|
337
|
-
],
|
|
338
|
-
```
|
|
339
|
-
|
|
340
|
-
**Please note:** This rule is disabled in `.jsx` and `.tsx` files because React components are usually exported via `export default`. [`React.lazy`](https://reactjs.org/docs/code-splitting.html#reactlazy) even expects the lazy loaded component to be exported as `default`.
|
|
341
|
-
|
|
342
|
-
### [`peerigon/styles/no-null`](styles/no-null.js)
|
|
343
|
-
|
|
344
|
-
**Important: Requires [`eslint-plugin-no-null`](https://github.com/nene/eslint-plugin-no-null) as project dependency.**
|
|
345
|
-
|
|
346
|
-
```
|
|
347
|
-
npm i eslint-plugin-no-null --save-dev
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
Forbids the usage of `null`. In a codebase it's often better to use a single non-value to represent _the absence of a value_. With the rise of default parameters and destructuring defaults, JavaScript developed a clear tendency towards `undefined`. [This issue](https://github.com/peerigon/eslint-config-peerigon/issues/71) summarizes the arguments (and trade-offs) of **null vs. undefined**.
|
|
351
|
-
|
|
352
|
-
```js
|
|
353
|
-
"extends": [
|
|
354
|
-
"peerigon",
|
|
355
|
-
"peerigon/styles/no-null"
|
|
356
|
-
],
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
**Please note:** If you use this rule, you will probably still need a single `null` value which you can refer to whenever you need to use `null` because of third-party code:
|
|
360
|
-
|
|
361
|
-
```js
|
|
362
|
-
// eslint-disable-next-line no-null/no-null
|
|
363
|
-
export const NULL = null;
|
|
364
|
-
```
|
|
365
|
-
|
|
366
|
-
### [`peerigon/styles/prefer-interface`](styles/prefer-interface.js)
|
|
367
|
-
|
|
368
|
-
**Important: Use it in combination with [`peerigon/typescript`](typescript.js).**
|
|
369
|
-
|
|
370
|
-
[Prefer `interface` over `type`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/prefer-interface.md).
|
|
371
|
-
|
|
372
|
-
```js
|
|
373
|
-
"extends": [
|
|
374
|
-
"peerigon",
|
|
375
|
-
"peerigon/typescript",
|
|
376
|
-
"peerigon/styles/prefer-interface"
|
|
377
|
-
],
|
|
378
|
-
```
|
|
379
|
-
|
|
380
|
-
### [`peerigon/styles/react-jsx-no-bind`](styles/react-jsx-no-bind.js)
|
|
381
|
-
|
|
382
|
-
**Important: Use it in combination with [`peerigon/react`](react.js).**
|
|
383
|
-
|
|
384
|
-
Depending on the way you write your components, it might be not ok to create functions during `render()`. Use it if you're using things like `React.memo()` or `shouldComponentUpdate` a lot.
|
|
385
|
-
|
|
386
|
-
```js
|
|
387
|
-
"extends": [
|
|
388
|
-
"peerigon",
|
|
389
|
-
"peerigon/react",
|
|
390
|
-
"peerigon/styles/react-jsx-no-bind"
|
|
391
|
-
],
|
|
392
|
-
```
|
|
393
|
-
|
|
394
|
-
### [`peerigon/styles/react-jsx-no-literals`](styles/react-jsx-no-literals.js)
|
|
27
|
+
- ease of reading
|
|
28
|
+
- ease of refactoring
|
|
29
|
+
- ease of writing.
|
|
395
30
|
|
|
396
|
-
|
|
31
|
+
We think that:
|
|
397
32
|
|
|
398
|
-
|
|
33
|
+
- code is read more often than refactored
|
|
34
|
+
- and refactored more often than written from scratch.
|
|
399
35
|
|
|
400
|
-
|
|
401
|
-
"extends": [
|
|
402
|
-
"peerigon",
|
|
403
|
-
"peerigon/react",
|
|
404
|
-
"peerigon/styles/react-jsx-no-literals"
|
|
405
|
-
],
|
|
406
|
-
```
|
|
36
|
+
Our configs have been designed with these assumptions in mind.
|
|
407
37
|
|
|
408
|
-
|
|
38
|
+
### Formatting
|
|
409
39
|
|
|
410
|
-
|
|
411
|
-
const Hello = <div>test</div>;
|
|
412
|
-
```
|
|
40
|
+
Formatting should follow the community standard. Our config is therefore based on Prettier's default config. Besides that it also:
|
|
413
41
|
|
|
414
|
-
|
|
42
|
+
- auto-sorts `import` statements
|
|
43
|
+
- formats JSDoc comments
|
|
44
|
+
- formats `package.json`
|
|
45
|
+
- formats and sorts CSS properties
|
|
46
|
+
- sorts Tailwind CSS class names
|
|
415
47
|
|
|
416
|
-
|
|
417
|
-
const Hello = <div>{"test"}</div>;
|
|
418
|
-
```
|
|
48
|
+
This makes git diffs smaller and reviewing them more focussed.
|
|
419
49
|
|
|
420
|
-
###
|
|
50
|
+
### Linting
|
|
421
51
|
|
|
422
|
-
|
|
52
|
+
Linting should mostly catch bugs in the control flow and prevent security issues. Furthermore, it should enforce a modern, idiomatic and consistent code style that is easy to read and to refactor.
|
|
423
53
|
|
|
424
|
-
|
|
54
|
+
However, it should **not** nit-pick on formatting or favor certain language features where other options are equally ok. Every rule must be legitimized by objective criteria. A simple “I find it easier to read” is not enough.
|
|
425
55
|
|
|
426
|
-
|
|
427
|
-
"extends": [
|
|
428
|
-
"peerigon",
|
|
429
|
-
"peerigon/typescript",
|
|
430
|
-
"peerigon/styles/prefer-array-shorthand"
|
|
431
|
-
],
|
|
432
|
-
```
|
|
56
|
+
Our linting rules:
|
|
433
57
|
|
|
434
|
-
|
|
58
|
+
- are mostly based on recommended sets
|
|
59
|
+
- use type information to catch logic bugs
|
|
60
|
+
- highlight a11y problems
|
|
61
|
+
- are less strict in tests
|
|
435
62
|
|
|
436
|
-
|
|
437
|
-
const foo: string[] = [];
|
|
438
|
-
```
|
|
63
|
+
### Type-checking
|
|
439
64
|
|
|
440
|
-
|
|
65
|
+
Type-checking should be rather strict because it is the foundation for safe and sound refactorings. If type-checking is too loose, it may lull the developer into a false sense of security. It should also prevent out-of-bounds errors when accessing arrays or objects.
|
|
441
66
|
|
|
442
|
-
|
|
443
|
-
const foo: Array<string> = [];
|
|
444
|
-
```
|
|
67
|
+
For highly dynamic code or incompatible types, local exceptions to type safety and escape hatches need to be possible.
|
|
445
68
|
|
|
446
69
|
## License
|
|
447
70
|
|
|
448
|
-
|
|
71
|
+
MIT
|
|
449
72
|
|
|
450
73
|
## Sponsors
|
|
451
74
|
|
package/eslint/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# [ESLint](https://eslint.org/) config
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install eslint @peerigon/configs --save-dev
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Then create a `eslint.config.js` next to your `package.json`:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
// We have a couple of presets for popular setups, such as typescript-react or typescript-node
|
|
13
|
+
// See "Presets"
|
|
14
|
+
import typescriptNodePreset from "@peerigon/configs/eslint/presets/typescript-node";
|
|
15
|
+
// You can also choose from a bunch of optional coding styles
|
|
16
|
+
// See "Styles"
|
|
17
|
+
import stylesNoDefaultExport from "@peerigon/configs/eslint/styles/no-default-export";
|
|
18
|
+
|
|
19
|
+
export default [
|
|
20
|
+
...typescriptNodePreset,
|
|
21
|
+
// The idiomatic way to disable rules in certain directories in ESLint>=9.x is
|
|
22
|
+
// to map() over them and add `ignores` to the rule objects
|
|
23
|
+
...stylesNoDefaultExport.map((config) => ({
|
|
24
|
+
...config,
|
|
25
|
+
ignores: [...(config.ignores ?? []), "src/some/folder/*.ts"],
|
|
26
|
+
})),
|
|
27
|
+
];
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Recommended configuration in your `package.json` (using [`npm-run-all`](https://www.npmjs.com/package/npm-run-all)):
|
|
31
|
+
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"type": "module",
|
|
35
|
+
"scripts": {
|
|
36
|
+
"test": "run-p test:*",
|
|
37
|
+
"test:lint": "eslint --max-warnings 0 --cache ."
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Presets
|
|
43
|
+
|
|
44
|
+
Presets bundle all relevant rules into one `import`. They can be imported as `@peerigon/configs/eslint/presets/<preset-name>`. They **should not** be combined with each other.
|
|
45
|
+
|
|
46
|
+
- `typescript-react`: Rules for React projects written in TypeScript
|
|
47
|
+
- `typescript-node`: Rules for TypeScript apps that are supposed to run in Node.js
|
|
48
|
+
- `typescript`: Rules for all other TypeScript projects
|
|
49
|
+
- `javascript-browser`: Rules for JavaScript apps running in a browser (e.g. in combination with [JSDoc type annotations](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html))
|
|
50
|
+
- `javascript-node`: Rules for JavaScript apps running in Node.js
|
|
51
|
+
- `javascript`: Rules for all other JavaScript projects
|
|
52
|
+
|
|
53
|
+
## Styles
|
|
54
|
+
|
|
55
|
+
We acknowledge that there are certain rules where there are no actual pros and cons or where there is no clear winner. You just have to decide for one style and stick with it. We also know that some rules make sense in one project, but don't make sense in another project. Pick these rules if they make sense for you in your project. They can be imported as `@peerigon/configs/eslint/styles/<style-name>`.
|
|
56
|
+
|
|
57
|
+
### `no-default-export`
|
|
58
|
+
|
|
59
|
+
Forbids usage of `export default`. When using default exports, it becomes harder to name classes or functions consistently throughout the codebase since every module can pick its own name for the imported thing. Nicholas C. Zakas, the creator of ESLint, wrote [an article with more compelling arguments why he stopped using `export default`](https://humanwhocodes.com/blog/2019/01/stop-using-default-exports-javascript-module/).
|
|
60
|
+
|
|
61
|
+
You may want to disable this rule in situations where a default export is required, for instance when using [React's `lazy()`](https://react.dev/reference/react/lazy).
|
|
62
|
+
|
|
63
|
+
### `no-null`
|
|
64
|
+
|
|
65
|
+
Forbids the usage of `null`. In a codebase it's often better to use a single non-value to represent _the absence of a value_. With the rise of default parameters and destructuring defaults, JavaScript developed a clear tendency towards `undefined`. [This issue](https://github.com/peerigon/eslint-config-peerigon/issues/71) summarizes the arguments (and trade-offs) of **null vs. undefined**.
|
|
66
|
+
|
|
67
|
+
**👉 Hint:** If you use this rule, you will probably still need a single `null` value which you can refer to whenever you need to use `null` because of third-party code:
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
// eslint-disable-next-line no-null/no-null
|
|
71
|
+
export const NULL = null;
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### `prefer-interface`
|
|
75
|
+
|
|
76
|
+
Prefer TypeScript's `interface` over `type`:
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
interface SomeObject {
|
|
80
|
+
someProp: boolean;
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
instead of
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
type SomeObject = {
|
|
88
|
+
someProp: boolean;
|
|
89
|
+
};
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### `prefer-array-shorthand`
|
|
93
|
+
|
|
94
|
+
Enforces TypeScript arrays to use the shorthand array-style instead of the generic style:
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
const foo: string[] = [];
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
instead of
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
const foo: Array<string> = [];
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### `jsx-no-literals`
|
|
107
|
+
|
|
108
|
+
Use this style if you're using i18n. It prevents people from putting raw strings in components.
|
|
109
|
+
It disallows this:
|
|
110
|
+
|
|
111
|
+
```jsx
|
|
112
|
+
const Hello = <div>test</div>;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
As an escape hatch, this is still allowed:
|
|
116
|
+
|
|
117
|
+
```jsx
|
|
118
|
+
const Hello = <div>{"test"}</div>;
|
|
119
|
+
```
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useEffect, useRef, useState } from "react";
|
|
2
|
+
import { Other } from "./Other.tsx";
|
|
2
3
|
|
|
3
4
|
export const App = (_props: { name: string; count: number }) => {
|
|
4
5
|
for (let index = 0; index < 10; index++) {
|
|
@@ -28,6 +29,7 @@ export const App = (_props: { name: string; count: number }) => {
|
|
|
28
29
|
{"Hello world"}
|
|
29
30
|
{/* eslint-disable-next-line @eslint-react/no-leaked-conditional-rendering */}
|
|
30
31
|
<>{_props.count && <view />}</>
|
|
32
|
+
<Other />
|
|
31
33
|
</>
|
|
32
34
|
);
|
|
33
35
|
};
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { getMessage } from "./message.
|
|
1
|
+
import { getMessage } from "./message.ts";
|
|
2
2
|
// Check if import attributes are detected and formatted correctly
|
|
3
3
|
import test from "./test.json" with { type: "json" };
|
|
4
4
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
6
6
|
const snake_case = 123;
|
|
7
7
|
|
|
8
|
+
// Should not complain about missing dot-notation here since
|
|
9
|
+
// we're using TS's noPropertyAccessFromIndexSignature
|
|
10
|
+
process.env["SOME_ENV_VAR"] = "test";
|
|
11
|
+
|
|
8
12
|
class SomeClass {
|
|
9
13
|
#someProp = true;
|
|
10
14
|
private someEventHandler = () => {
|
|
@@ -13,6 +13,9 @@ export const javascript = [
|
|
|
13
13
|
// https://github.com/sindresorhus/eslint-plugin-unicorn/issues/896
|
|
14
14
|
"unicorn/prevent-abbreviations": "off",
|
|
15
15
|
"unicorn/filename-case": "off",
|
|
16
|
+
// The default of import-style is highly subjective and not always the best choice.
|
|
17
|
+
// E.g. bundlers are able to tree-shake named imports easier than default imports.
|
|
18
|
+
"unicorn/import-style": "off",
|
|
16
19
|
"unicorn/no-nested-ternary": "off",
|
|
17
20
|
"unicorn/no-null": "off",
|
|
18
21
|
"unicorn/no-useless-undefined": "off",
|
|
@@ -23,6 +26,9 @@ export const javascript = [
|
|
|
23
26
|
"unicorn/no-array-reduce": "off",
|
|
24
27
|
"unicorn/prefer-global-this": "off", // Too many false positives
|
|
25
28
|
"unicorn/prefer-ternary": "off",
|
|
29
|
+
// It makes sense to use Promise.all() with a single promise when we expect more to be added later.
|
|
30
|
+
// In that case we don't want to refactor the code, but just add the new promise.
|
|
31
|
+
"unicorn/no-single-promise-in-promise-methods": "off",
|
|
26
32
|
},
|
|
27
33
|
},
|
|
28
34
|
{
|
|
@@ -129,7 +129,15 @@ export const typescript = tsEslint.config(
|
|
|
129
129
|
],
|
|
130
130
|
"no-return-await": "off",
|
|
131
131
|
"@typescript-eslint/return-await": ["warn", "in-try-catch"], // https://typescript-eslint.io/rules/return-await
|
|
132
|
-
"@typescript-eslint/switch-exhaustiveness-check":
|
|
132
|
+
"@typescript-eslint/switch-exhaustiveness-check": [
|
|
133
|
+
"warn",
|
|
134
|
+
{
|
|
135
|
+
// It should not be necessary to list all possible values for a union type
|
|
136
|
+
// explicitly in a switch statement. E.g. if the types are generated, we don't
|
|
137
|
+
// want to adjust all switch statements every time the types are changed.
|
|
138
|
+
considerDefaultExhaustiveForUnions: true,
|
|
139
|
+
},
|
|
140
|
+
], // https://typescript-eslint.io/rules/switch-exhaustiveness-check
|
|
133
141
|
camelcase: "off",
|
|
134
142
|
"max-lines": [
|
|
135
143
|
"warn",
|
|
@@ -8,7 +8,8 @@ export const noDefaultExport = [
|
|
|
8
8
|
"error",
|
|
9
9
|
{
|
|
10
10
|
selector: "ExportDefaultDeclaration",
|
|
11
|
-
message:
|
|
11
|
+
message:
|
|
12
|
+
"Please use named exports instead. Named exports ensure consistent naming and make it easier to auto-import symbols.",
|
|
12
13
|
},
|
|
13
14
|
],
|
|
14
15
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peerigon/configs",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Configs for ESLint, Prettier, TypeScript & friends",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
"types": "./types/semantic-release/base.d.ts",
|
|
74
74
|
"default": "./semantic-release/base.js"
|
|
75
75
|
},
|
|
76
|
+
"./semantic-release/cross-publish": {
|
|
77
|
+
"types": "./types/semantic-release/cross-publish.d.ts",
|
|
78
|
+
"default": "./semantic-release/cross-publish.js"
|
|
79
|
+
},
|
|
76
80
|
"./typescript": {
|
|
77
81
|
"default": "./typescript/base.json"
|
|
78
82
|
},
|
|
@@ -118,50 +122,63 @@
|
|
|
118
122
|
"*.{js,jsx,ts,tsx,css,md,yml,yaml}": "prettier --write"
|
|
119
123
|
},
|
|
120
124
|
"dependencies": {
|
|
121
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
122
|
-
"@eslint/compat": "^1.2.
|
|
123
|
-
"@eslint/js": "9.
|
|
124
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.4.
|
|
125
|
-
"
|
|
125
|
+
"@eslint-react/eslint-plugin": "^1.26.1",
|
|
126
|
+
"@eslint/compat": "^1.2.6",
|
|
127
|
+
"@eslint/js": "^9.19.0",
|
|
128
|
+
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
129
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
130
|
+
"@semantic-release/exec": "^7.0.3",
|
|
131
|
+
"@semantic-release/git": "^10.0.1",
|
|
132
|
+
"@types/eslint-config-prettier": "^6.11.3",
|
|
133
|
+
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
|
|
134
|
+
"@types/eslint__js": "^8.42.3",
|
|
135
|
+
"eslint-config-prettier": "^10.0.1",
|
|
126
136
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
127
137
|
"eslint-plugin-prefer-arrow": "^1.2.3",
|
|
128
|
-
"eslint-plugin-react": "^7.37.
|
|
129
|
-
"eslint-plugin-react-compiler": "^19.0.0-beta-
|
|
130
|
-
"eslint-plugin-react-hooks": "^5.
|
|
131
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
132
|
-
"eslint-plugin-unicorn": "^56.0.
|
|
133
|
-
"globals": "^15.
|
|
138
|
+
"eslint-plugin-react": "^7.37.4",
|
|
139
|
+
"eslint-plugin-react-compiler": "^19.0.0-beta-714736e-20250131",
|
|
140
|
+
"eslint-plugin-react-hooks": "^5.1.0",
|
|
141
|
+
"eslint-plugin-react-refresh": "^0.4.18",
|
|
142
|
+
"eslint-plugin-unicorn": "^56.0.1",
|
|
143
|
+
"globals": "^15.14.0",
|
|
134
144
|
"prettier-plugin-css-order": "^2.1.2",
|
|
135
|
-
"prettier-plugin-jsdoc": "^1.3.
|
|
136
|
-
"prettier-plugin-packagejson": "^2.5.
|
|
137
|
-
"prettier-plugin-tailwindcss": "^0.6.
|
|
138
|
-
"typescript-eslint": "^8.
|
|
145
|
+
"prettier-plugin-jsdoc": "^1.3.2",
|
|
146
|
+
"prettier-plugin-packagejson": "^2.5.8",
|
|
147
|
+
"prettier-plugin-tailwindcss": "^0.6.11",
|
|
148
|
+
"typescript-eslint": "^8.23.0"
|
|
139
149
|
},
|
|
140
150
|
"devDependencies": {
|
|
141
|
-
"@
|
|
142
|
-
"@
|
|
143
|
-
"
|
|
144
|
-
"
|
|
145
|
-
"
|
|
146
|
-
"@types/eslint__js": "^8.42.3",
|
|
147
|
-
"@types/node": "^22.9.0",
|
|
148
|
-
"@types/react": "^18.3.12",
|
|
149
|
-
"eslint": "9.14.0",
|
|
150
|
-
"husky": "^9.1.6",
|
|
151
|
-
"lint-staged": "^15.2.10",
|
|
151
|
+
"@types/node": "^22.13.1",
|
|
152
|
+
"@types/react": "^19.0.8",
|
|
153
|
+
"eslint": "^9.19.0",
|
|
154
|
+
"husky": "^9.1.7",
|
|
155
|
+
"lint-staged": "^15.4.3",
|
|
152
156
|
"npm-run-all": "^4.1.5",
|
|
153
|
-
"pin-github-action": "^1.
|
|
154
|
-
"prettier": "^3.
|
|
155
|
-
"react": "^
|
|
156
|
-
"semantic-release": "^24.2.
|
|
157
|
-
"typescript": "^5.
|
|
157
|
+
"pin-github-action": "^2.1.0",
|
|
158
|
+
"prettier": "^3.4.2",
|
|
159
|
+
"react": "^19.0.0",
|
|
160
|
+
"semantic-release": "^24.2.1",
|
|
161
|
+
"typescript": "^5.7.3"
|
|
158
162
|
},
|
|
159
163
|
"peerDependencies": {
|
|
160
|
-
"eslint": "^9.
|
|
161
|
-
"prettier": "^3.
|
|
162
|
-
"
|
|
164
|
+
"eslint": "^9.19.0",
|
|
165
|
+
"prettier": "^3.4.2",
|
|
166
|
+
"semantic-release": "^24.2.1",
|
|
167
|
+
"typescript": "^5.7.3"
|
|
168
|
+
},
|
|
169
|
+
"peerDependenciesMeta": {
|
|
170
|
+
"eslint": {
|
|
171
|
+
"optional": true
|
|
172
|
+
},
|
|
173
|
+
"prettier": {
|
|
174
|
+
"optional": true
|
|
175
|
+
},
|
|
176
|
+
"typescript": {
|
|
177
|
+
"optional": true
|
|
178
|
+
}
|
|
163
179
|
},
|
|
164
180
|
"publishConfig": {
|
|
165
|
-
"access": "public"
|
|
181
|
+
"access": "public",
|
|
182
|
+
"provenance": true
|
|
166
183
|
}
|
|
167
184
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# [Prettier](https://prettier.io/) config
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install prettier @peerigon/configs --save-dev
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Then create a `prettier.config.js` next to your `package.json`:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
export { default } from "@peerigon/configs/prettier";
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Recommended configuration in your `package.json` (using [`npm-run-all`](https://www.npmjs.com/package/npm-run-all)):
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"type": "module",
|
|
20
|
+
"scripts": {
|
|
21
|
+
"test": "run-p test:*",
|
|
22
|
+
"test:format": "prettier --check ."
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Configuration
|
|
28
|
+
|
|
29
|
+
Our config is entirely based on Prettier's default config. Besides that, it also:
|
|
30
|
+
|
|
31
|
+
- auto-sorts `import` statements
|
|
32
|
+
- formats JSDoc comments
|
|
33
|
+
- formats `package.json`
|
|
34
|
+
- formats and sorts CSS properties
|
|
35
|
+
- sorts Tailwind CSS class names
|
package/prettier/base.js
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# [Semantic release](https://semantic-release.gitbook.io/) config
|
|
2
|
+
|
|
3
|
+
## Installation
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install semantic-release @peerigon/configs --save-dev
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Then create a `.releaserc.json` next to your `package.json`:
|
|
10
|
+
|
|
11
|
+
```json
|
|
12
|
+
{
|
|
13
|
+
"extends": "@peerigon/configs/semantic-release"
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Recommended configuration in your `package.json`:
|
|
18
|
+
|
|
19
|
+
```json
|
|
20
|
+
{
|
|
21
|
+
"type": "module",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"release": "semantic-release"
|
|
24
|
+
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"//": "only if the package is supposed to be public"
|
|
27
|
+
"access": "public",
|
|
28
|
+
"provenance": true
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
`"provenance": true` will generate [provenance statements](https://docs.npmjs.com/generating-provenance-statements) in case your Github actions has the correct permissions (see below).
|
|
34
|
+
|
|
35
|
+
Recommended Github action:
|
|
36
|
+
|
|
37
|
+
```yaml
|
|
38
|
+
name: 🧪 Test and 🚀 Release
|
|
39
|
+
|
|
40
|
+
on:
|
|
41
|
+
push:
|
|
42
|
+
branches:
|
|
43
|
+
- main
|
|
44
|
+
- beta
|
|
45
|
+
pull_request: {}
|
|
46
|
+
|
|
47
|
+
jobs:
|
|
48
|
+
test-and-release:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
|
51
|
+
|
|
52
|
+
permissions:
|
|
53
|
+
# Necessary for semantic-release
|
|
54
|
+
contents: write
|
|
55
|
+
issues: write
|
|
56
|
+
pull-requests: write
|
|
57
|
+
# Necessary for npm publish --provenance
|
|
58
|
+
# See https://docs.npmjs.com/generating-provenance-statements#example-github-actions-workflow
|
|
59
|
+
id-token: write
|
|
60
|
+
# packages: write is only necessary if you want to publish to Github
|
|
61
|
+
packages: write
|
|
62
|
+
|
|
63
|
+
steps:
|
|
64
|
+
# ...
|
|
65
|
+
# Install and build steps
|
|
66
|
+
# ...
|
|
67
|
+
- name: 🚀 Release
|
|
68
|
+
env:
|
|
69
|
+
# GITHUB_TOKEN is only necessary if you want to publish to Github
|
|
70
|
+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
71
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
72
|
+
run: |
|
|
73
|
+
npm run release
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Configuration
|
|
77
|
+
|
|
78
|
+
We export the following `.releaserc.json` presets. They can be used by extending `@peerigon/configs/<preset-name>`:
|
|
79
|
+
|
|
80
|
+
- `semantic-release`: Recommended config for publishing a library to a single registry (according to your `.npmrc`).
|
|
81
|
+
- `semantic-release/cross-publish`: Config for publishing a library both to NPM _and_ Github
|
package/semantic-release/base.js
CHANGED
|
@@ -5,6 +5,12 @@ export const config = {
|
|
|
5
5
|
"@semantic-release/commit-analyzer",
|
|
6
6
|
"@semantic-release/release-notes-generator",
|
|
7
7
|
"@semantic-release/changelog",
|
|
8
|
+
[
|
|
9
|
+
"@semantic-release/exec",
|
|
10
|
+
{
|
|
11
|
+
prepareCmd: "npx -y prettier --write CHANGELOG.md",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
8
14
|
[
|
|
9
15
|
"@semantic-release/git",
|
|
10
16
|
{
|
|
@@ -23,18 +29,6 @@ export const config = {
|
|
|
23
29
|
assets: ".semantic-release/*.tgz",
|
|
24
30
|
},
|
|
25
31
|
],
|
|
26
|
-
[
|
|
27
|
-
"@semantic-release/exec",
|
|
28
|
-
{
|
|
29
|
-
verifyConditionsCmd:
|
|
30
|
-
'echo "registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${process.env.GITHUB_TOKEN}" > /tmp/github.npmrc && npm whoami --userconfig /tmp/github.npmrc',
|
|
31
|
-
prepareCmd: "npx -y prettier --write CHANGELOG.md",
|
|
32
|
-
publishCmd:
|
|
33
|
-
"npm publish --userconfig /tmp/github.npmrc --tag ${nextRelease.channel} --no-git-tag-version",
|
|
34
|
-
successCmd: "rm /tmp/github.npmrc",
|
|
35
|
-
failCmd: "rm /tmp/github.npmrc",
|
|
36
|
-
},
|
|
37
|
-
],
|
|
38
32
|
],
|
|
39
33
|
};
|
|
40
34
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { config as baseConfig } from "./base.js";
|
|
2
|
+
|
|
3
|
+
/** @type {import("semantic-release").Options} */
|
|
4
|
+
export const config = {
|
|
5
|
+
...baseConfig,
|
|
6
|
+
plugins: [
|
|
7
|
+
...(baseConfig.plugins ?? []),
|
|
8
|
+
[
|
|
9
|
+
"@semantic-release/exec",
|
|
10
|
+
{
|
|
11
|
+
verifyConditionsCmd:
|
|
12
|
+
'echo "registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${process.env.GITHUB_TOKEN}" > /tmp/github.npmrc && npm whoami --userconfig /tmp/github.npmrc',
|
|
13
|
+
publishCmd:
|
|
14
|
+
"npm publish --userconfig /tmp/github.npmrc --tag ${nextRelease.channel} --no-git-tag-version",
|
|
15
|
+
successCmd: "rm /tmp/github.npmrc",
|
|
16
|
+
failCmd: "rm /tmp/github.npmrc",
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default config;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"other.d.ts","sourceRoot":"","sources":["../../../../eslint/presets/javascript.test/other.js"],"names":[],"mappings":"AAAA,
|
|
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"}
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../eslint/rules/typescript.js"],"names":[],"mappings":"AAUA,
|
|
1
|
+
{"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../../eslint/rules/typescript.js"],"names":[],"mappings":"AAUA,6FAiME"}
|
|
@@ -1 +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,
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/no-default-export.test/main.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../../../eslint/styles/no-default-export.test/main.ts"],"names":[],"mappings":"wBACe,iBAAiB;AAAhC,wBAAiC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../prettier/base.js"],"names":[],"mappings":"AAoBA,wCAAwC;AACxC,qBADW,OAAO,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../prettier/base.js"],"names":[],"mappings":"AAoBA,wCAAwC;AACxC,qBADW,OAAO,UAAU,EAAE,MAAM,CAYlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../semantic-release/base.js"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,qBADW,OAAO,kBAAkB,EAAE,OAAO,
|
|
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,24 +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",
|
|
16
|
+
"noEmit": true,
|
|
10
17
|
"noImplicitOverride": true,
|
|
11
18
|
"noImplicitReturns": true,
|
|
12
19
|
"noPropertyAccessFromIndexSignature": true,
|
|
13
20
|
"noUncheckedIndexedAccess": true,
|
|
14
21
|
"resolveJsonModule": true,
|
|
22
|
+
"rewriteRelativeImportExtensions": true,
|
|
15
23
|
"skipLibCheck": true,
|
|
16
24
|
"strict": true,
|
|
17
|
-
"target": "ESNext"
|
|
18
|
-
|
|
19
|
-
// "allowImportingTsExtensions": true,
|
|
20
|
-
// "rewriteRelativeImportExtensions": true,
|
|
21
|
-
// "verbatimModuleSyntax": true
|
|
25
|
+
"target": "ESNext",
|
|
26
|
+
"verbatimModuleSyntax": true
|
|
22
27
|
},
|
|
23
28
|
"$schema": "https://json.schemastore.org/tsconfig"
|
|
24
29
|
}
|