Skip to content

Commit

Permalink
ci: add linting (#242)
Browse files Browse the repository at this point in the history
* ci: add linting

* fix: don't auto-fix import order

* fix: lockfile

* chore: update eslint

* fix: disable import order
  • Loading branch information
ffMathy authored Feb 18, 2024
1 parent 15f430a commit 3161f9b
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 81 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"rules": {
"import/no-named-as-default": "off",
"no-console": "off",
"@typescript-eslint/ban-ts-comment": "off"
"@typescript-eslint/ban-ts-comment": "off",
"import/order": "off"
}
}
26 changes: 14 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Build

on:
push:
branches: [ "main" ]
branches: [main]
pull_request:
branches: [ "main" ]
branches: [main]

jobs:
build:
Expand All @@ -13,18 +13,20 @@ jobs:
strategy:
matrix:
node-version: [20.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: yarn install --frozen-lockfile

- run: yarn install --frozen-lockfile
- run: yarn run compile

- run: yarn run compile
- run: yarn run lint

- run: yarn test
- run: yarn test
13 changes: 3 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,10 @@
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off",
"cSpell.words": ["execa"],
"vitest.exclude": [
"**/out/**",
"**/src/**",
"**/samples/**",
"**/node_modules/**",
"**/dist/**",
"**/cypress/**",
"**/.{idea,git,cache,output,temp}/**"
],
"[typescript]": {
"editor.defaultFormatter": "dbaeumer.vscode-eslint"
},
"editor.codeActionsOnSave": {
"source.organizeImports": "never"
}
}
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@
"@types/semver": "^7.3.9",
"@types/vscode": "^1.77.0",
"@types/ws": "^8.5.10",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@typescript-eslint/eslint-plugin": "^7.0.1",
"@typescript-eslint/parser": "^7.0.1",
"@vitest/ws-client": "^1.2.0",
"@vscode/test-electron": "^2.1.2",
"@vue/reactivity": "^3.2.33",
"@vueuse/core": "^8.4.2",
"eslint": "^8.9.0",
"eslint": "^8.56.0",
"fs-extra": "^10.0.1",
"fuse.js": "^6.6.2",
"get-port": "^6.1.2",
Expand Down
2 changes: 1 addition & 1 deletion src/discover.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import minimatch from 'minimatch'
import path, { sep } from 'path'
import minimatch from 'minimatch'
import type { ResolvedConfig } from 'vitest'
import * as vscode from 'vscode'
import type { TestData } from './TestData'
Expand Down
6 changes: 3 additions & 3 deletions src/watch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,8 @@ export function syncTestStatusToVsCode(
if (finished) {
for (const log of task.logs ?? []) {
// LF to CRLF https://code.visualstudio.com/api/extension-guides/testing#test-output
const output = log.content.replace(/(?<!\r)\n/g, "\r\n");
run.appendOutput(output, undefined, data.item);
const output = log.content.replace(/(?<!\r)\n/g, '\r\n')
run.appendOutput(output, undefined, data.item)
}
}
if (task.result == null) {
Expand Down Expand Up @@ -421,7 +421,7 @@ export function syncTestStatusToVsCode(
if (task.type === 'suite' && !(candidate instanceof TestDescribe))
continue

if ((task.type === 'test' || task.type==='custom') && !(candidate instanceof TestCase))
if ((task.type === 'test' || task.type === 'custom') && !(candidate instanceof TestCase))
continue

if (candidate.pattern === task.name) {
Expand Down
102 changes: 51 additions & 51 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -726,16 +726,16 @@
semver "^7.3.7"
tsutils "^3.21.0"

"@typescript-eslint/eslint-plugin@^6.19.0":
version "6.19.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.19.0.tgz#db03f3313b57a30fbbdad2e6929e88fc7feaf9ba"
integrity sha512-DUCUkQNklCQYnrBSSikjVChdc84/vMPDQSgJTHBZ64G9bA9w0Crc0rd2diujKbTdp6w2J47qkeHQLoi0rpLCdg==
"@typescript-eslint/eslint-plugin@^7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.0.1.tgz#407daffe09d964d57aceaf3ac51846359fbe61b0"
integrity sha512-OLvgeBv3vXlnnJGIAgCLYKjgMEU+wBGj07MQ/nxAaON+3mLzX7mJbhRYrVGiVvFiXtwFlkcBa/TtmglHy0UbzQ==
dependencies:
"@eslint-community/regexpp" "^4.5.1"
"@typescript-eslint/scope-manager" "6.19.0"
"@typescript-eslint/type-utils" "6.19.0"
"@typescript-eslint/utils" "6.19.0"
"@typescript-eslint/visitor-keys" "6.19.0"
"@typescript-eslint/scope-manager" "7.0.1"
"@typescript-eslint/type-utils" "7.0.1"
"@typescript-eslint/utils" "7.0.1"
"@typescript-eslint/visitor-keys" "7.0.1"
debug "^4.3.4"
graphemer "^1.4.0"
ignore "^5.2.4"
Expand All @@ -753,15 +753,15 @@
"@typescript-eslint/typescript-estree" "5.62.0"
debug "^4.3.4"

"@typescript-eslint/parser@^6.19.0":
version "6.19.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-6.19.0.tgz#80344086f362181890ade7e94fc35fe0480bfdf5"
integrity sha512-1DyBLG5SH7PYCd00QlroiW60YJ4rWMuUGa/JBV0iZuqi4l4IK3twKPq5ZkEebmGqRjXWVgsUzfd3+nZveewgow==
"@typescript-eslint/parser@^7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-7.0.1.tgz#e9c61d9a5e32242477d92756d36086dc40322eed"
integrity sha512-8GcRRZNzaHxKzBPU3tKtFNing571/GwPBeCvmAUw0yBtfE2XVd0zFKJIMSWkHJcPQi0ekxjIts6L/rrZq5cxGQ==
dependencies:
"@typescript-eslint/scope-manager" "6.19.0"
"@typescript-eslint/types" "6.19.0"
"@typescript-eslint/typescript-estree" "6.19.0"
"@typescript-eslint/visitor-keys" "6.19.0"
"@typescript-eslint/scope-manager" "7.0.1"
"@typescript-eslint/types" "7.0.1"
"@typescript-eslint/typescript-estree" "7.0.1"
"@typescript-eslint/visitor-keys" "7.0.1"
debug "^4.3.4"

"@typescript-eslint/scope-manager@5.62.0":
Expand All @@ -772,13 +772,13 @@
"@typescript-eslint/types" "5.62.0"
"@typescript-eslint/visitor-keys" "5.62.0"

"@typescript-eslint/scope-manager@6.19.0":
version "6.19.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-6.19.0.tgz#b6d2abb825b29ab70cb542d220e40c61c1678116"
integrity sha512-dO1XMhV2ehBI6QN8Ufi7I10wmUovmLU0Oru3n5LVlM2JuzB4M+dVphCPLkVpKvGij2j/pHBWuJ9piuXx+BhzxQ==
"@typescript-eslint/scope-manager@7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-7.0.1.tgz#611ec8e78c70439b152a805e1b10aaac36de7c00"
integrity sha512-v7/T7As10g3bcWOOPAcbnMDuvctHzCFYCG/8R4bK4iYzdFqsZTbXGln0cZNVcwQcwewsYU2BJLay8j0/4zOk4w==
dependencies:
"@typescript-eslint/types" "6.19.0"
"@typescript-eslint/visitor-keys" "6.19.0"
"@typescript-eslint/types" "7.0.1"
"@typescript-eslint/visitor-keys" "7.0.1"

"@typescript-eslint/type-utils@5.62.0":
version "5.62.0"
Expand All @@ -790,13 +790,13 @@
debug "^4.3.4"
tsutils "^3.21.0"

"@typescript-eslint/type-utils@6.19.0":
version "6.19.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-6.19.0.tgz#522a494ef0d3e9fdc5e23a7c22c9331bbade0101"
integrity sha512-mcvS6WSWbjiSxKCwBcXtOM5pRkPQ6kcDds/juxcy/727IQr3xMEcwr/YLHW2A2+Fp5ql6khjbKBzOyjuPqGi/w==
"@typescript-eslint/type-utils@7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-7.0.1.tgz#0fba92c1f81cad561d7b3adc812aa1cc0e35cdae"
integrity sha512-YtT9UcstTG5Yqy4xtLiClm1ZpM/pWVGFnkAa90UfdkkZsR1eP2mR/1jbHeYp8Ay1l1JHPyGvoUYR6o3On5Nhmw==
dependencies:
"@typescript-eslint/typescript-estree" "6.19.0"
"@typescript-eslint/utils" "6.19.0"
"@typescript-eslint/typescript-estree" "7.0.1"
"@typescript-eslint/utils" "7.0.1"
debug "^4.3.4"
ts-api-utils "^1.0.1"

Expand All @@ -805,10 +805,10 @@
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.62.0.tgz#258607e60effa309f067608931c3df6fed41fd2f"
integrity sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==

"@typescript-eslint/types@6.19.0":
version "6.19.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-6.19.0.tgz#689b0498c436272a6a2059b09f44bcbd90de294a"
integrity sha512-lFviGV/vYhOy3m8BJ/nAKoAyNhInTdXpftonhWle66XHAtT1ouBlkjL496b5H5hb8dWXHwtypTqgtb/DEa+j5A==
"@typescript-eslint/types@7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-7.0.1.tgz#dcfabce192db5b8bf77ea3c82cfaabe6e6a3c901"
integrity sha512-uJDfmirz4FHib6ENju/7cz9SdMSkeVvJDK3VcMFvf/hAShg8C74FW+06MaQPODHfDJp/z/zHfgawIJRjlu0RLg==

"@typescript-eslint/typescript-estree@5.62.0":
version "5.62.0"
Expand All @@ -823,13 +823,13 @@
semver "^7.3.7"
tsutils "^3.21.0"

"@typescript-eslint/typescript-estree@6.19.0":
version "6.19.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-6.19.0.tgz#0813ba364a409afb4d62348aec0202600cb468fa"
integrity sha512-o/zefXIbbLBZ8YJ51NlkSAt2BamrK6XOmuxSR3hynMIzzyMY33KuJ9vuMdFSXW+H0tVvdF9qBPTHA91HDb4BIQ==
"@typescript-eslint/typescript-estree@7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.1.tgz#1d52ac03da541693fa5bcdc13ad655def5046faf"
integrity sha512-SO9wHb6ph0/FN5OJxH4MiPscGah5wjOd0RRpaLvuBv9g8565Fgu0uMySFEPqwPHiQU90yzJ2FjRYKGrAhS1xig==
dependencies:
"@typescript-eslint/types" "6.19.0"
"@typescript-eslint/visitor-keys" "6.19.0"
"@typescript-eslint/types" "7.0.1"
"@typescript-eslint/visitor-keys" "7.0.1"
debug "^4.3.4"
globby "^11.1.0"
is-glob "^4.0.3"
Expand All @@ -851,17 +851,17 @@
eslint-scope "^5.1.1"
semver "^7.3.7"

"@typescript-eslint/utils@6.19.0":
version "6.19.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-6.19.0.tgz#557b72c3eeb4f73bef8037c85dae57b21beb1a4b"
integrity sha512-QR41YXySiuN++/dC9UArYOg4X86OAYP83OWTewpVx5ct1IZhjjgTLocj7QNxGhWoTqknsgpl7L+hGygCO+sdYw==
"@typescript-eslint/utils@7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-7.0.1.tgz#b8ceac0ba5fef362b4a03a33c0e1fedeea3734ed"
integrity sha512-oe4his30JgPbnv+9Vef1h48jm0S6ft4mNwi9wj7bX10joGn07QRfqIqFHoMiajrtoU88cIhXf8ahwgrcbNLgPA==
dependencies:
"@eslint-community/eslint-utils" "^4.4.0"
"@types/json-schema" "^7.0.12"
"@types/semver" "^7.5.0"
"@typescript-eslint/scope-manager" "6.19.0"
"@typescript-eslint/types" "6.19.0"
"@typescript-eslint/typescript-estree" "6.19.0"
"@typescript-eslint/scope-manager" "7.0.1"
"@typescript-eslint/types" "7.0.1"
"@typescript-eslint/typescript-estree" "7.0.1"
semver "^7.5.4"

"@typescript-eslint/visitor-keys@5.62.0":
Expand All @@ -872,12 +872,12 @@
"@typescript-eslint/types" "5.62.0"
eslint-visitor-keys "^3.3.0"

"@typescript-eslint/visitor-keys@6.19.0":
version "6.19.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-6.19.0.tgz#4565e0ecd63ca1f81b96f1dd76e49f746c6b2b49"
integrity sha512-hZaUCORLgubBvtGpp1JEFEazcuEdfxta9j4iUwdSAr7mEsYYAp3EAUyCZk3VEEqGj6W+AV4uWyrDGtrlawAsgQ==
"@typescript-eslint/visitor-keys@7.0.1":
version "7.0.1"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.1.tgz#864680ac5a8010ec4814f8a818e57595f79f464e"
integrity sha512-hwAgrOyk++RTXrP4KzCg7zB2U0xt7RUU0ZdMSCsqF3eKUwkdXUMyTb0qdCuji7VIbcpG62kKTU9M1J1c9UpFBw==
dependencies:
"@typescript-eslint/types" "6.19.0"
"@typescript-eslint/types" "7.0.1"
eslint-visitor-keys "^3.4.1"

"@ungap/promise-all-settled@1.1.2":
Expand Down Expand Up @@ -1938,7 +1938,7 @@ eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.1.0, eslint-visitor-keys@^3.3
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz#0cd72fe8550e3c2eae156a96a4dddcd1c8ac5800"
integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==

eslint@^8.9.0:
eslint@^8.56.0:
version "8.56.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.56.0.tgz#4957ce8da409dc0809f99ab07a1b94832ab74b15"
integrity sha512-Go19xM6T9puCOWntie1/P997aXxFsOi37JIHRWI514Hc6ZnaHGKY9xFhrU65RT6CcBEzZoGG1e6Nq+DT04ZtZQ==
Expand Down

0 comments on commit 3161f9b

Please sign in to comment.