Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

web: upgrade prettier to the latest version to support TS satisfies operator #45400

Merged
merged 3 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dbaeumer.vscode-eslint",
"foxundermoon.shell-format",
"timonwong.shellcheck",
"felixfbecker.css-stacking-contexts",
"felixfbecker.css-stacking-contexts"
],
"unwantedRecommendations": ["ms-vscode.vscode-typescript-tslint-plugin", "eg2.tslint"],
"unwantedRecommendations": ["ms-vscode.vscode-typescript-tslint-plugin", "eg2.tslint"]
}
46 changes: 23 additions & 23 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Attach to Process (from list)",
"type": "go",
"request": "attach",
"mode": "local",
"mode": "local"
},
{
"name": "Launch VS Code Extension",
Expand All @@ -15,11 +15,11 @@
"args": [
"--extensionDevelopmentPath=${workspaceRoot}/client/vscode",
"--disable-extension=kandalatj.sourcegraph-preview",
"--disable-extension=sourcegraph.sourcegraph",
"--disable-extension=sourcegraph.sourcegraph"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/client/vscode/dist/node/*.js"],
"outFiles": ["${workspaceRoot}/client/vscode/dist/node/*.js"]
},
{
"name": "Launch VS Code Web Extension",
Expand All @@ -31,10 +31,10 @@
"--disable-extension=kandalatj.sourcegraph-preview",
"--disable-extension=sourcegraph.sourcegraph",
"--extensionDevelopmentKind=web",
"--disable-web-security",
"--disable-web-security"
],
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/client/vscode/dist/webworker/*.js"],
"outFiles": ["${workspaceRoot}/client/vscode/dist/webworker/*.js"]
},
{
"type": "node",
Expand All @@ -46,8 +46,8 @@
"skipFiles": ["<node_internals>/**"],
"env": {
"TS_NODE_LOG_ERROR": "true",
"E2E_BROWSER": "chrome",
},
"E2E_BROWSER": "chrome"
}
},
{
"type": "node",
Expand All @@ -56,7 +56,7 @@
"program": "${workspaceFolder}/node_modules/jest/bin/jest",
"args": [
"--color",
"--runInBand",
"--runInBand"
// "path/to/test/file",
// "-t",
// "test name",
Expand All @@ -66,10 +66,10 @@
"internalConsoleOptions": "neverOpen",
"skipFiles": [
"**/async_hooks.js",
"**/inspector_async_hook.js",
"**/inspector_async_hook.js"
// "**/node_modules/rxjs",
],
"smartStep": false,
"smartStep": false
},
{
"type": "node",
Expand All @@ -80,9 +80,9 @@
"args": ["webpack"],
"env": {
// prettier-ignore
"TS_NODE_COMPILER_OPTIONS": "{\"module\":\"commonjs\"}",
"TS_NODE_COMPILER_OPTIONS": "{\"module\":\"commonjs\"}"
},
"internalConsoleOptions": "openOnSessionStart",
"internalConsoleOptions": "openOnSessionStart"
},
{
"name": "Webapp Chrome",
Expand All @@ -91,7 +91,7 @@
"port": 9222,
"webRoot": "${workspaceRoot}/web",
"url": "http://localhost:3080/*",
"sourceMaps": true,
"sourceMaps": true
},
{
"name": "Attach to gitserver",
Expand All @@ -103,7 +103,7 @@
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"args": []
},
{
"name": "Attach to indexer",
Expand All @@ -115,7 +115,7 @@
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"args": []
},
{
"name": "Attach to query-runner",
Expand All @@ -127,7 +127,7 @@
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"args": []
},
{
"name": "Attach to repo-updater",
Expand All @@ -139,7 +139,7 @@
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"args": []
},
{
"name": "Attach to searcher",
Expand All @@ -151,7 +151,7 @@
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"args": []
},
{
"name": "Attach to symbols",
Expand All @@ -163,7 +163,7 @@
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"args": []
},
{
"name": "Attach to github-proxy",
Expand All @@ -175,7 +175,7 @@
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
"args": []
},
{
"name": "Attach to frontend",
Expand All @@ -187,7 +187,7 @@
"host": "127.0.0.1",
"program": "${workspaceRoot}",
"env": {},
"args": [],
},
],
"args": []
}
]
}
20 changes: 10 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,31 @@
"**/.cache": true,
"**/.nyc_output": true,
"doc/_resources/assets": true,
"**/.eslintcache": true,
"**/.eslintcache": true
},
"files.exclude": {
"**/*.scss.d.ts": true,
"**/*.scss.d.ts": true
},
"files.associations": {
"**/dev/critical-config.json": "jsonc",
"**/dev/site-config.json": "jsonc",
"**/.mocharc.json": "jsonc",
"**/.mocharc.json": "jsonc"
},
"json.schemas": [
{
"fileMatch": ["dev/critical-config.json"],
"url": "/schema/critical/critical.schema.json",
"url": "/schema/critical/critical.schema.json"
},
{
"fileMatch": ["dev/site-config.json"],
"url": "/schema/site.schema.json",
},
"url": "/schema/site.schema.json"
}
],
"editor.formatOnSave": true,
"go.useLanguageServer": true,
"gopls": {
"build.allowImplicitNetworkAccess": true,
"local": "github.com/sourcegraph/sourcegraph",
"local": "github.com/sourcegraph/sourcegraph"
},
"jest.jestCommandLine": "yarn test",
"jest.showCoverageOnLoad": false,
Expand All @@ -61,9 +61,9 @@
"nix.enableLanguageServer": true,
"[nix]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.tabSize": 2
},
"files.watcherExclude": {
"**/target": true,
},
"**/target": true
}
}
36 changes: 18 additions & 18 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// for the documentation about the tasks.json format
"version": "2.0.0",
"options": {
"cwd": "${workspaceFolder}",
"cwd": "${workspaceFolder}"
},
"tasks": [
{
Expand All @@ -14,15 +14,15 @@
"problemMatcher": "$tsc-watch",
"isBackground": true,
"command": ["node_modules/.bin/tsc"],
"args": ["--build", "tsconfig.all.json", "--watch", "--incremental"],
"args": ["--build", "tsconfig.all.json", "--watch", "--incremental"]
},
{
"label": "Watch web app",
"detail": "Watch files and build the JavaScript bundle (no development server).",
"type": "npm",
"script": "watch-web",
"problemMatcher": [],
"isBackground": true,
"isBackground": true
},
{
"label": "Watch code generation",
Expand All @@ -31,7 +31,7 @@
"script": "watch-generate",
"group": "build",
"problemMatcher": [],
"isBackground": true,
"isBackground": true
},
{
"label": "stylelint",
Expand All @@ -48,16 +48,16 @@
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
},
],
},
"message": 5
}
]
}
},
{
"label": "launch",
"command": "${workspaceRoot}/dev/start.sh",
"isBackground": true,
"problemMatcher": [],
"problemMatcher": []
},
{
"label": "ESLint all",
Expand All @@ -68,45 +68,45 @@
"eslint:browser",
"eslint:precise-code-intel",
"eslint:release",
"eslint:extension-api",
"eslint:extension-api"
],
"dependsOrder": "parallel",
"problemMatcher": [],
"problemMatcher": []
},
{
"label": "eslint:shared",
"type": "npm",
"script": "eslint",
"path": "client/shared/",
"problemMatcher": ["$eslint-stylish"],
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "eslint:browser",
"type": "npm",
"script": "eslint",
"path": "client/browser/",
"problemMatcher": ["$eslint-stylish"],
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "eslint:web",
"type": "npm",
"script": "eslint",
"path": "client/web/",
"problemMatcher": ["$eslint-stylish"],
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "eslint:release",
"type": "npm",
"script": "eslint",
"path": "dev/release/",
"problemMatcher": ["$eslint-stylish"],
"problemMatcher": ["$eslint-stylish"]
},
{
"label": "eslint:extension-api",
"type": "npm",
"script": "eslint",
"path": "client/extension-api/",
"problemMatcher": ["$eslint-stylish"],
},
],
"problemMatcher": ["$eslint-stylish"]
}
]
}
17 changes: 9 additions & 8 deletions client/branded/src/components/panel/TabbedPanelContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,15 @@ export const TabbedPanelContent = React.memo<TabbedPanelContentProps>(props => {
}, [isTabbedReferencesPanelEnabled, extensionsController])
)

const panelViews = useMemo(() => [...(builtinTabbedPanels || []), ...(extensionPanels || [])], [
builtinTabbedPanels,
extensionPanels,
])

const trackTabClick = useCallback((label: string) => props.telemetryService.log(`ReferencePanelClicked${label}`), [
props.telemetryService,
])
const panelViews = useMemo(
() => [...(builtinTabbedPanels || []), ...(extensionPanels || [])],
[builtinTabbedPanels, extensionPanels]
)

const trackTabClick = useCallback(
(label: string) => props.telemetryService.log(`ReferencePanelClicked${label}`),
[props.telemetryService]
)

const items = useMemo(
() =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ Colors.parameters = {
design: {
name: 'Figma',
type: 'figma',
url:
'https://www.figma.com/file/NIsN34NH7lPu04olBzddTw/Design-Refresh-Systemization-source-of-truth?node-id=908%3A7608',
url: 'https://www.figma.com/file/NIsN34NH7lPu04olBzddTw/Design-Refresh-Systemization-source-of-truth?node-id=908%3A7608',
},
}

Expand Down
5 changes: 4 additions & 1 deletion client/branded/src/global-styles/GlobalStylesStory/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ type SemanticColorBase = typeof SEMANTIC_COLORS[number]
type SemanticColorVariant = `${SemanticColorBase}-${number}`
type SemanticColor = SemanticColorBase | SemanticColorVariant

const isSemanticColor = (colorPattern: RegExp) => (value: string): value is SemanticColor => colorPattern.test(value)
const isSemanticColor =
(colorPattern: RegExp) =>
(value: string): value is SemanticColor =>
colorPattern.test(value)

export const getSemanticColorVariables = (): SemanticColor[] => {
const properties = getCSSCustomProperties()
Expand Down