From 4c6176d1c46ddca606364815cff3d3ec5639685d Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Thu, 12 Jan 2023 13:02:33 +0100 Subject: [PATCH] chore: apply format --- .eslintrc.js | 9 +++++++-- package.json | 4 ++-- test-dts/defineComponent.test-d.tsx | 14 +++++++------- test-dts/defineCustomElement.test-d.ts | 16 ++++++++-------- test-dts/setupHelpers.test-d.ts | 2 +- 5 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.eslintrc.js b/.eslintrc.js index cdbb1dffd91..c0282ebd817 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,7 +6,7 @@ module.exports = { parserOptions: { sourceType: 'module' }, - plugins: ["jest"], + plugins: ['jest'], rules: { 'no-debugger': 'error', 'no-unused-vars': [ @@ -72,7 +72,12 @@ module.exports = { }, // Node scripts { - files: ['scripts/**', './*.js', 'packages/**/index.js', 'packages/size-check/**'], + files: [ + 'scripts/**', + './*.js', + 'packages/**/index.js', + 'packages/size-check/**' + ], rules: { 'no-restricted-globals': 'off', 'no-restricted-syntax': 'off' diff --git a/package.json b/package.json index 27dcc42903a..53bd782547d 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "size-global": "node scripts/build.js vue runtime-dom -f global -p", "size-baseline": "node scripts/build.js runtime-dom runtime-core reactivity shared -f esm-bundler && cd packages/size-check && vite build && node brotli", "lint": "eslint --cache --ext .ts packages/*/{src,__tests__}/**.ts", - "format": "prettier --write --cache --parser typescript \"packages/**/*.ts?(x)\"", - "format-check": "prettier --check --cache --parser typescript \"packages/**/*.ts?(x)\"", + "format": "prettier --write --cache --parser typescript \"**/*.[tj]s?(x)\"", + "format-check": "prettier --check --cache --parser typescript \"**/*.[tj]s?(x)\"", "test": "run-s \"test-unit {@}\" \"test-e2e {@}\"", "test-unit": "jest --filter ./scripts/filter-unit.js", "test-e2e": "node scripts/build.js vue -f global -d && jest --filter ./scripts/filter-e2e.js --runInBand", diff --git a/test-dts/defineComponent.test-d.tsx b/test-dts/defineComponent.test-d.tsx index 208501e4286..1ad6ee1f38f 100644 --- a/test-dts/defineComponent.test-d.tsx +++ b/test-dts/defineComponent.test-d.tsx @@ -1041,13 +1041,13 @@ describe('inject', () => { }, inject: { foo: 'foo', - bar: 'bar', + bar: 'bar' }, created() { expectType(this.foo) expectType(this.bar) // @ts-expect-error - expectError(this.foobar = 1) + expectError((this.foobar = 1)) } }) @@ -1059,7 +1059,7 @@ describe('inject', () => { expectType(this.foo) expectType(this.bar) // @ts-expect-error - expectError(this.foobar = 1) + expectError((this.foobar = 1)) } }) @@ -1073,13 +1073,13 @@ describe('inject', () => { bar: { from: 'pbar', default: 'bar' - }, + } }, created() { expectType(this.foo) expectType(this.bar) // @ts-expect-error - expectError(this.foobar = 1) + expectError((this.foobar = 1)) } }) @@ -1088,9 +1088,9 @@ describe('inject', () => { props: ['a', 'b'], created() { // @ts-expect-error - expectError(this.foo = 1) + expectError((this.foo = 1)) // @ts-expect-error - expectError(this.bar = 1) + expectError((this.bar = 1)) } }) }) diff --git a/test-dts/defineCustomElement.test-d.ts b/test-dts/defineCustomElement.test-d.ts index 8e60ac1c1df..7433f23c14f 100644 --- a/test-dts/defineCustomElement.test-d.ts +++ b/test-dts/defineCustomElement.test-d.ts @@ -8,13 +8,13 @@ describe('inject', () => { }, inject: { foo: 'foo', - bar: 'bar', + bar: 'bar' }, created() { expectType(this.foo) expectType(this.bar) // @ts-expect-error - expectError(this.foobar = 1) + expectError((this.foobar = 1)) } }) @@ -26,7 +26,7 @@ describe('inject', () => { expectType(this.foo) expectType(this.bar) // @ts-expect-error - expectError(this.foobar = 1) + expectError((this.foobar = 1)) } }) @@ -40,13 +40,13 @@ describe('inject', () => { bar: { from: 'pfoo', default: 'bar' - }, + } }, created() { expectType(this.foo) expectType(this.bar) // @ts-expect-error - expectError(this.foobar = 1) + expectError((this.foobar = 1)) } }) @@ -55,9 +55,9 @@ describe('inject', () => { props: ['a', 'b'], created() { // @ts-expect-error - expectError(this.foo = 1) + expectError((this.foo = 1)) // @ts-expect-error - expectError(this.bar = 1) + expectError((this.bar = 1)) } }) -}) \ No newline at end of file +}) diff --git a/test-dts/setupHelpers.test-d.ts b/test-dts/setupHelpers.test-d.ts index d099d37441d..e8066e4e5b7 100644 --- a/test-dts/setupHelpers.test-d.ts +++ b/test-dts/setupHelpers.test-d.ts @@ -70,7 +70,7 @@ describe('defineProps w/ union type declaration + withDefaults', () => { union1: 123, union2: () => [123], union3: () => ({ x: 123 }), - union4: () => 123, + union4: () => 123 } ) })