Skip to content

Commit f41ca1a

Browse files
committed
Add Prettier
This adds Prettier and makes it replace tsfmt. VSCode is set to use Prettier for formatting TypeScript/TSX files and format on save since Prettier is very fast and does not cause any noticeable delay.
1 parent 6219b43 commit f41ca1a

File tree

10 files changed

+1615
-1482
lines changed

10 files changed

+1615
-1482
lines changed

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ CHANGELOG.md merge=union
2323
# Mark some JSON files containing test data as generated so they are not included
2424
# as part of diffs or language statistics.
2525
extensions/ql-vscode/src/stories/remote-queries/data/*.json linguist-generated
26+
27+
# Always use LF line endings, also on Windows
28+
* text=auto eol=lf

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"recommendations": [
66
"amodio.tsl-problem-matcher",
77
"dbaeumer.vscode-eslint",
8-
"eternalphane.tsfmt-vscode"
8+
"esbenp.prettier-vscode"
99
],
1010
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
1111
"unwantedRecommendations": []

.vscode/settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,13 @@
3636
"typescript.preferences.quoteStyle": "single",
3737
"javascript.preferences.quoteStyle": "single",
3838
"editor.wordWrapColumn": 100,
39-
"jest.rootPath": "./extensions/ql-vscode"
39+
"jest.rootPath": "./extensions/ql-vscode",
40+
"[typescript]": {
41+
"editor.defaultFormatter": "esbenp.prettier-vscode",
42+
"editor.formatOnSave": true,
43+
},
44+
"[typescriptreact]": {
45+
"editor.defaultFormatter": "esbenp.prettier-vscode",
46+
"editor.formatOnSave": true,
47+
},
4048
}

extensions/ql-vscode/.eslintrc.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,12 @@ module.exports = {
1010
node: true,
1111
es6: true,
1212
},
13-
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "plugin:jest-dom/recommended"],
13+
extends: [
14+
"eslint:recommended",
15+
"plugin:@typescript-eslint/recommended",
16+
"plugin:jest-dom/recommended",
17+
"plugin:prettier/recommended"
18+
],
1419
rules: {
1520
"@typescript-eslint/no-use-before-define": 0,
1621
"@typescript-eslint/no-unused-vars": [
@@ -27,11 +32,7 @@ module.exports = {
2732
"@typescript-eslint/no-explicit-any": "off",
2833
"@typescript-eslint/no-floating-promises": [ "error", { ignoreVoid: true } ],
2934
"prefer-const": ["warn", { destructuring: "all" }],
30-
indent: "off",
31-
"@typescript-eslint/indent": "off",
3235
"@typescript-eslint/no-throw-literal": "error",
3336
"no-useless-escape": 0,
34-
semi: 2,
35-
quotes: ["warn", "single"]
3637
},
3738
};
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.vscode-test/
2+
node_modules/
3+
out/
4+
5+
# Include the Storybook config
6+
!.storybook

extensions/ql-vscode/.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"trailingComma": "all"
3+
}

extensions/ql-vscode/.vscodeignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ src/**
1212
.gitignore
1313
gulpfile.js/**
1414
tsconfig.json
15-
tsfmt.json
15+
.prettierrc
1616
vsc-extension-quickstart.md

0 commit comments

Comments
 (0)