@timobechtel/style 1.7.0 → 1.9.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 +9 -1
- package/eslint/rules/typescript.cjs +2 -0
- package/package.json +1 -1
- package/tsconfig/core.json +21 -14
- package/tsconfig/react.json +12 -0
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Highly opinionated configuration files for typescript projects. Inspired by [@ve
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm i -D @timobechtel/style prettier eslint typescript
|
|
10
|
+
npm i -D @timobechtel/style prettier "eslint@^8.57.0" typescript
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
### Prettier
|
|
@@ -22,6 +22,12 @@ echo '"@timobechtel/style/prettier/index.mjs"' > .prettierrc
|
|
|
22
22
|
echo '{ "extends": "@timobechtel/style/tsconfig/core" }' > tsconfig.json
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
#### Or with React
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
echo '{ "extends": "@timobechtel/style/tsconfig/react" }' > tsconfig.json
|
|
29
|
+
```
|
|
30
|
+
|
|
25
31
|
### Eslint
|
|
26
32
|
|
|
27
33
|
```bash
|
|
@@ -81,6 +87,8 @@ module.exports = {
|
|
|
81
87
|
};
|
|
82
88
|
```
|
|
83
89
|
|
|
90
|
+
#### VSCode
|
|
91
|
+
|
|
84
92
|
Note: You should disable `source.organizeImports` in your VSCode config, as this collides with the `import/order` rule.
|
|
85
93
|
|
|
86
94
|
Add the following to your VSCode config, e.g. `.vscode/settings.json`
|
|
@@ -102,5 +102,7 @@ module.exports = defineConfig({
|
|
|
102
102
|
// There are cases where using the index signature is more descriptive
|
|
103
103
|
// as the index can be named
|
|
104
104
|
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
|
105
|
+
// Enforce using a top-level type qualifier for imports when only types are imported using the inline type qualifier
|
|
106
|
+
'@typescript-eslint/no-import-type-side-effects': 'error',
|
|
105
107
|
},
|
|
106
108
|
});
|
package/package.json
CHANGED
package/tsconfig/core.json
CHANGED
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
-
"display": "
|
|
3
|
+
"display": "Core",
|
|
4
4
|
"compilerOptions": {
|
|
5
|
-
"
|
|
5
|
+
"esModuleInterop": true,
|
|
6
|
+
"skipLibCheck": true,
|
|
7
|
+
"resolveJsonModule": true,
|
|
8
|
+
"isolatedModules": true,
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
"target": "ES2022",
|
|
11
|
+
"moduleDetection": "force",
|
|
12
|
+
|
|
13
|
+
"incremental": true,
|
|
6
14
|
"declaration": true,
|
|
7
15
|
"declarationMap": true,
|
|
8
|
-
"
|
|
16
|
+
"composite": true,
|
|
17
|
+
"sourceMap": true,
|
|
18
|
+
|
|
19
|
+
"strict": true,
|
|
20
|
+
"strictNullChecks": true,
|
|
9
21
|
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"inlineSources": false,
|
|
11
|
-
"isolatedModules": true,
|
|
12
|
-
"moduleResolution": "node",
|
|
13
|
-
"noUnusedLocals": false,
|
|
14
|
-
"noUnusedParameters": false,
|
|
15
22
|
"noImplicitAny": true,
|
|
16
23
|
"noUncheckedIndexedAccess": true,
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
"
|
|
24
|
+
"noUnusedLocals": false,
|
|
25
|
+
"noUnusedParameters": false,
|
|
26
|
+
"noImplicitOverride": true,
|
|
27
|
+
"noFallthroughCasesInSwitch": true,
|
|
28
|
+
|
|
29
|
+
"moduleResolution": "NodeNext"
|
|
23
30
|
},
|
|
24
31
|
"exclude": ["node_modules"]
|
|
25
32
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"extends": "./core.json",
|
|
4
|
+
"display": "TSConfig for React apps",
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"module": "Preserve",
|
|
8
|
+
"noEmit": true,
|
|
9
|
+
"declaration": false,
|
|
10
|
+
"jsx": "react-jsx"
|
|
11
|
+
}
|
|
12
|
+
}
|