Skip to content

Commit

Permalink
Upgrade typescript, typescript-eslint; separate formatting from linti…
Browse files Browse the repository at this point in the history
…ng (GMOD#408)

* Fix pre-commit hook

* Standardize on .yml over .yaml

* Run prettier over all files

* Don't commit unplugged files

* Don't  use prettier in eslint

* Update typescript and typescript-eslint versions

* Remove unused directives

* Improve test selector

* Update test

* Specify config file in test

* Restore line
  • Loading branch information
garrettjstevens authored Jul 10, 2024
1 parent 6f3abd9 commit 2cd8372
Show file tree
Hide file tree
Showing 139 changed files with 668 additions and 8,942 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"mongodb.mongodb-vscode",
"arcanis.vscode-zipfs",
"eamodio.gitlens",
],
},
},


// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [3999, 27017],

Expand Down
4 changes: 1 addition & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
'plugin:import/typescript',
'plugin:@typescript-eslint/strict-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:prettier/recommended',
],
plugins: ['tsdoc', 'sort-destructure-keys'],
parser: '@typescript-eslint/parser',
Expand Down Expand Up @@ -41,6 +40,7 @@ module.exports = {
],
'no-console': ['warn', { allow: ['error', 'warn', 'debug'] }],
'no-else-return': ['error', { allowElseIf: false }],
'no-extra-semi': 'off',
'object-shorthand': 'warn',
'prefer-destructuring': 'warn',
'prefer-template': 'warn',
Expand Down Expand Up @@ -69,8 +69,6 @@ module.exports = {
'@typescript-eslint/return-await': 'error',
// eslint-plugin-import rules (override recommended)
'import/no-extraneous-dependencies': 'error',
// eslint-plugin-prettier rules (override recommended)
'prettier/prettier': 'warn',
// eslint-plugin-sort-destructure-keys rules
'sort-destructure-keys/sort-destructure-keys': 'warn',
// eslint-plugin-tsdoc rules
Expand Down
2 changes: 0 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn node .husky/pre-commit.js
yarn lint-staged
2 changes: 1 addition & 1 deletion .importsortrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
".js, .jsx, .ts, .tsx": {
".js, .jsx, .cjs, .ts, .tsx": {
"style": "module",
"parser": "typescript"
}
Expand Down
2 changes: 1 addition & 1 deletion .lintstagedrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
'!(js,ts,jsx,tsx)': prettier --write --ignore-unknown
'*': prettier --write --ignore-unknown
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.yarnrc.yml
.yarn/
tsconfig.json
packages/apollo-cli/test_data/invalid.yml
packages/jbrowse-plugin-apollo/test_data/*.json
3 changes: 1 addition & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ module.exports = {
semi: false,
singleQuote: true,
proseWrap: 'always',
plugins: [require('prettier-plugin-import-sort')],
overrides: [
{
files: ['**/devcontainer.json', '.vscode/*.json', '**/tsconfig*.json'],
files: ['.devcontainer/**/*.json', '.vscode/*.json', '**/tsconfig*.json'],
options: { parser: 'jsonc' },
},
],
Expand Down
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"recommendations": [
"arcanis.vscode-zipfs",
"dbaeumer.vscode-eslint",
"ms-vscode-remote.remote-containers"
]
"ms-vscode-remote.remote-containers",
"esbenp.prettier-vscode",
],
}
45 changes: 11 additions & 34 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,20 @@
"cwd": "${workspaceFolder}/packages/apollo-collaboration-server",
"name": "Debug Collaboration Server",
"request": "launch",
"runtimeArgs": [
"start:debug"
],
"runtimeArgs": ["start:debug"],
"runtimeExecutable": "yarn",
"skipFiles": [
"<node_internals>/**"
],
"type": "node"
"skipFiles": ["<node_internals>/**"],
"type": "node",
},
{
"name": "All Jest Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "yarn",
"runtimeArgs": [
"run",
"--inspect-brk",
"test",
"--runInBand"
],
"runtimeArgs": ["run", "--inspect-brk", "test", "--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
"<node_internals>/**",
".yarn/cache/**"
]
"skipFiles": ["<node_internals>/**", ".yarn/cache/**"],
},
{
"name": "Current Jest Test",
Expand All @@ -45,14 +33,11 @@
"--inspect-brk",
"test",
"--runInBand",
"${relativeFile}"
"${relativeFile}",
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"skipFiles": [
"<node_internals>/**",
"**/.yarn/cache/**"
]
"skipFiles": ["<node_internals>/**", "**/.yarn/cache/**"],
},
{
"type": "node",
Expand All @@ -65,30 +50,22 @@
"--testNamePattern",
"${jest.testNamePattern}",
"--runTestsByPath",
"${jest.testFile}"
"${jest.testFile}",
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"runtimeExecutable": "yarn",
"skipFiles": [
"<node_internals>/**",
"**/.yarn/cache/**"
]
"skipFiles": ["<node_internals>/**", "**/.yarn/cache/**"],
},
{
"type": "node",
"request": "launch",
"name": "Execute Command",
"skipFiles": [
"<node_internals>/**"
],
"skipFiles": ["<node_internals>/**"],
"program": "${workspaceFolder}/bin/dev.js",
"args": [
"hello",
"world",
],
"args": ["hello", "world"],
},
],
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
"**/.pnp.*": true,
},
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.nodePath": ".yarn/sdks",
"jest.jestCommandLine": "yarn test",
"jest.autoRun": {},
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
}
33 changes: 13 additions & 20 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "shell",
"command": "yarn",
"detail": "yarn",
"problemMatcher": []
"problemMatcher": [],
},
{
"label": "start shared",
Expand All @@ -16,7 +16,7 @@
"problemMatcher": [],
"detail": "tsc --build --watch",
"dependsOn": ["yarn"],
"isBackground": true
"isBackground": true,
},
{
"label": "start server",
Expand All @@ -26,7 +26,7 @@
"problemMatcher": [],
"detail": "yarn build:shared && yarn start:nest --watch",
"dependsOn": ["yarn"],
"isBackground": true
"isBackground": true,
},
{
"label": "start plugin watch",
Expand All @@ -39,8 +39,8 @@
"isBackground": true,
"dependsOn": ["yarn"],
"presentation": {
"group": "plugin-terminal"
}
"group": "plugin-terminal",
},
},
{
"label": "start plugin server",
Expand All @@ -52,25 +52,18 @@
"dependsOn": ["yarn"],
"isBackground": true,
"presentation": {
"group": "plugin-terminal"
}
"group": "plugin-terminal",
},
},
{
"label": "start plugin",
"dependsOn": [
"start plugin watch",
"start plugin server"
],
"problemMatcher": []
"dependsOn": ["start plugin watch", "start plugin server"],
"problemMatcher": [],
},
{
"label": "Start",
"dependsOn": [
"start shared",
"start server",
"start plugin"
],
"problemMatcher": []
}
]
"dependsOn": ["start shared", "start server", "start plugin"],
"problemMatcher": [],
},
],
}
Loading

0 comments on commit 2cd8372

Please sign in to comment.