@timobechtel/style 1.2.0 → 1.4.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 +13 -0
- package/eslint/rules/typescript.cjs +17 -1
- package/package.json +1 -1
- package/prettier/index.mjs +3 -0
package/README.md
CHANGED
|
@@ -51,6 +51,19 @@ module.exports = {
|
|
|
51
51
|
};
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
Note: You should disable `source.organizeImports` in your VSCode config, as this collides with the `import/order` rule.
|
|
55
|
+
|
|
56
|
+
Add the following to your VSCode config, e.g. `.vscode/settings.json`
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"editor.codeActionsOnSave": {
|
|
61
|
+
// use eslint import/order instead
|
|
62
|
+
"source.organizeImports": false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
54
67
|
### semantic-release
|
|
55
68
|
|
|
56
69
|
This repo also contains a [semantic-release](https://github.com/semantic-release/semantic-release) configuration.
|
|
@@ -76,8 +76,24 @@ module.exports = defineConfig({
|
|
|
76
76
|
'import/namespace': 'off',
|
|
77
77
|
'import/no-unresolved': 'off',
|
|
78
78
|
|
|
79
|
-
// This is disabled as
|
|
79
|
+
// This is disabled as I feel that checking empty strings is a valid use
|
|
80
80
|
// of `||` over `??`.
|
|
81
81
|
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
82
|
+
|
|
83
|
+
// Disallow Promises in places not designed to handle them.
|
|
84
|
+
'@typescript-eslint/no-misused-promises': [
|
|
85
|
+
'error',
|
|
86
|
+
{
|
|
87
|
+
// Disabled as I feel that passing a async callback to a function expecting
|
|
88
|
+
// a void callback is a valid use case.
|
|
89
|
+
// e.g. fn.on('event', async () => {})
|
|
90
|
+
// Strictly requiring to return 'undefined' does not have a functional benefit,
|
|
91
|
+
// but makes the code more verbose.
|
|
92
|
+
checksVoidReturn: false,
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
// While I'd prefer using types over interfaces, there are a lot of cases
|
|
96
|
+
// where interfaces are needed, e.g. merging declarations and this rule is too strict.
|
|
97
|
+
'@typescript-eslint/consistent-type-definitions': 'off',
|
|
82
98
|
},
|
|
83
99
|
});
|
package/package.json
CHANGED
package/prettier/index.mjs
CHANGED
|
@@ -8,6 +8,9 @@ const overridableDefaults = {
|
|
|
8
8
|
endOfLine: 'lf',
|
|
9
9
|
tabWidth: 2,
|
|
10
10
|
printWidth: 80,
|
|
11
|
+
// Why I'd generally prefer tabs, as they are a lot more customizable,
|
|
12
|
+
// I've found that in a lot of places, tabs are displayed as 8 spaces by default,
|
|
13
|
+
// which makes it hard to read on mobile devices. (e.g. the GitHub app)
|
|
11
14
|
useTabs: false,
|
|
12
15
|
};
|
|
13
16
|
|