Skip to content

Commit 34380da

Browse files
committed
Switches to .prettierrc from .js
VSCode had trouble parsing the `printWidth` and kept defaulting to 100 which in turn caused the formatter in VSCode to produce different results than `npm run format`. An autofix attempt has also been added when `lint-stage`ing
1 parent e642012 commit 34380da

File tree

4 files changed

+18
-16
lines changed

4 files changed

+18
-16
lines changed

.prettierrc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"printWidth": 100,
3+
"tabWidth": 2,
4+
"useTabs": false,
5+
"semi": true,
6+
"singleQuote": true,
7+
"jsxSingleQuote": false,
8+
"quoteProps": "consistent",
9+
"trailingComma": "es5",
10+
"bracketSpacing": true,
11+
"jsxBracketSameLine": false,
12+
"arrowParens": "avoid",
13+
"endOfLine": "lf",
14+
"embeddedLanguageFormatting": "auto"
15+
}

.prettierrc.js

Lines changed: 0 additions & 15 deletions
This file was deleted.

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@
2828
},
2929
"[markdown]": {
3030
"editor.defaultFormatter": "esbenp.prettier-vscode"
31-
}
31+
},
32+
"prettier.configPath": ".prettierrc"
3233
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252
"lint-staged": {
253253
"*.ts": [
254254
"npm run format",
255+
"npm run lint-fix",
255256
"npm run lint -- --max-warnings=0"
256257
]
257258
},

0 commit comments

Comments
 (0)