Skip to content

Commit 3e7e4b8

Browse files
authored
Merge pull request #1525 from github/koesie10/prettier
Add Prettier
2 parents 6219b43 + f515663 commit 3e7e4b8

File tree

395 files changed

+23729
-15891
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

395 files changed

+23729
-15891
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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Run this command to always ignore formatting commits in `git blame`
2+
# git config blame.ignoreRevsFile .git-blame-ignore-revs
3+
4+
# Formatted all code using Prettier instead of tsfmt
5+
ebcdf8ad0bb5bcb3efa679211709671716b892ba
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+
}
Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
1-
import type { StorybookConfig } from '@storybook/core-common';
1+
import type { StorybookConfig } from "@storybook/core-common";
22

33
const config: StorybookConfig = {
4-
stories: [
5-
'../src/**/*.stories.mdx',
6-
'../src/**/*.stories.@(js|jsx|ts|tsx)'
7-
],
4+
stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
85
addons: [
9-
'@storybook/addon-links',
10-
'@storybook/addon-essentials',
11-
'@storybook/addon-interactions',
12-
'./vscode-theme-addon/preset.ts',
6+
"@storybook/addon-links",
7+
"@storybook/addon-essentials",
8+
"@storybook/addon-interactions",
9+
"./vscode-theme-addon/preset.ts",
1310
],
14-
framework: '@storybook/react',
11+
framework: "@storybook/react",
1512
core: {
16-
builder: '@storybook/builder-webpack5'
17-
}
13+
builder: "@storybook/builder-webpack5",
14+
},
1815
};
1916

2017
module.exports = config;

extensions/ql-vscode/.storybook/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { addons } from '@storybook/addons';
2-
import { themes } from '@storybook/theming';
1+
import { addons } from "@storybook/addons";
2+
import { themes } from "@storybook/theming";
33

44
addons.setConfig({
55
theme: themes.dark,
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import { themes } from '@storybook/theming';
2-
import { action } from '@storybook/addon-actions';
1+
import { themes } from "@storybook/theming";
2+
import { action } from "@storybook/addon-actions";
33

44
// Allow all stories/components to use Codicons
5-
import '@vscode/codicons/dist/codicon.css';
5+
import "@vscode/codicons/dist/codicon.css";
66

77
// https://storybook.js.org/docs/react/configure/overview#configure-story-rendering
88
export const parameters = {
99
// All props starting with `on` will automatically receive an action as a prop
10-
actions: { argTypesRegex: '^on[A-Z].*' },
10+
actions: { argTypesRegex: "^on[A-Z].*" },
1111
// All props matching these names will automatically get the correct control
1212
controls: {
1313
matchers: {
@@ -22,10 +22,10 @@ export const parameters = {
2222
backgrounds: {
2323
// The background is injected by our theme CSS files
2424
disable: true,
25-
}
25+
},
2626
};
2727

2828
(window as any).acquireVsCodeApi = () => ({
29-
postMessage: action('post-vscode-message'),
30-
setState: action('set-vscode-state'),
29+
postMessage: action("post-vscode-message"),
30+
setState: action("set-vscode-state"),
3131
});

0 commit comments

Comments
 (0)