Skip to content

Commit 5c72c08

Browse files
committed
build(prettier): improve prettier setup
1 parent d5aac9e commit 5c72c08

File tree

6 files changed

+84
-179
lines changed

6 files changed

+84
-179
lines changed

.prettierrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
"printWidth": 100,
33
"tabWidth": 2,
44
"semi": true,
5-
"singleQuote": true
5+
"singleQuote": true,
6+
"plugins": ["@trivago/prettier-plugin-sort-imports"],
7+
"importOrder": ["^node:.*$", "<THIRD_PARTY_MODULES>", "^[./]"],
8+
"importOrderSeparation": true,
9+
"importOrderSortSpecifiers": true
610
}

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@
33
"editor.codeActionsOnSave": {
44
"source.fixAll.eslint": "explicit"
55
},
6+
"editor.defaultFormatter": "esbenp.prettier-vscode",
7+
"editor.formatOnSave": true,
68
"markdown.extension.toc.levels": "2..3"
79
}

cspell.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
22
"language": "en",
3-
"spellCheckDelayMs": 500,
43
"dictionaries": ["node", "npm", "typescript", "contributors"],
54
"ignorePaths": [
65
"node_modules/**",
@@ -46,6 +45,7 @@
4645
"restream",
4746
"snyk",
4847
"streamify",
48+
"trivago",
4949
"tseslint",
5050
"typicode",
5151
"vhosted",

eslint.config.mjs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
// @ts-check
2-
32
import eslint from '@eslint/js';
4-
import tseslint from 'typescript-eslint';
5-
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
63
import globals from 'globals';
4+
import tseslint from 'typescript-eslint';
75

86
export default tseslint.config(
97
// replacement of legacy `.eslintignore`
@@ -13,7 +11,6 @@ export default tseslint.config(
1311
// extends...
1412
eslint.configs.recommended,
1513
...tseslint.configs.recommended,
16-
eslintPluginPrettierRecommended,
1714
// base config
1815
{
1916
languageOptions: {
@@ -37,7 +34,6 @@ export default tseslint.config(
3734
'error',
3835
{ vars: 'all', args: 'none', ignoreRestSiblings: false },
3936
],
40-
'prettier/prettier': 'warn',
4137
},
4238
},
4339
{

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
"@commitlint/cli": "19.8.0",
6060
"@commitlint/config-conventional": "19.8.0",
6161
"@eslint/js": "9.23.0",
62+
"@trivago/prettier-plugin-sort-imports": "5.2.2",
6263
"@types/debug": "4.1.12",
6364
"@types/eslint": "9.6.1",
6465
"@types/express": "4.17.21",
@@ -70,8 +71,6 @@
7071
"@types/ws": "8.18.0",
7172
"body-parser": "1.20.3",
7273
"eslint": "9.23.0",
73-
"eslint-config-prettier": "10.1.1",
74-
"eslint-plugin-prettier": "5.2.3",
7574
"express": "4.21.2",
7675
"get-port": "5.1.1",
7776
"globals": "16.0.0",

0 commit comments

Comments
 (0)