Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 27, 2022
1 parent 51459c9 commit 6933c90
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 85 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,12 @@
"vitest": "workspace:*"
}
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
},
"lint-staged": {
"*.{js,ts,tsx,vue,md}": [
"eslint --fix"
]
},
"simple-git-hooks": {
"pre-commit": "npx lint-staged"
}
}
1 change: 1 addition & 0 deletions packages/ui/client/components/views/ViewEditor.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
import type CodeMirror from 'codemirror'
import { createTooltip, destroyTooltip } from 'floating-vue'
import { openInEditor } from '../../composables/error'
Expand Down
12 changes: 6 additions & 6 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@
"url": "git+https://github.com/vitest-dev/vitest.git",
"directory": "packages/ui"
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./*": "./*"
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"sideEffects": false,
"scripts": {
"build": "rimraf dist && pnpm build:node && pnpm build:client",
"build:client": "vite build",
Expand Down
56 changes: 28 additions & 28 deletions packages/vite-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,43 @@
"type": "module",
"version": "0.12.9",
"description": "Vite as Node.js runtime",
"homepage": "https://github.com/vitest-dev/vitest/blob/main/packages/vite-node#readme",
"bugs": {
"url": "https://github.com/vitest-dev/vitest/issues"
},
"license": "MIT",
"author": "Anthony Fu <[email protected]>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/vitest-dev/vitest/blob/main/packages/vite-node#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/vitest-dev/vitest.git",
"directory": "packages/vite-node"
},
"funding": "https://github.com/sponsors/antfu",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"bugs": {
"url": "https://github.com/vitest-dev/vitest/issues"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"types": "./dist/index.d.ts"
"require": "./dist/index.cjs"
},
"./client": {
"types": "./dist/client.d.ts",
"import": "./dist/client.js",
"require": "./dist/client.cjs",
"types": "./dist/client.d.ts"
"require": "./dist/client.cjs"
},
"./server": {
"types": "./dist/server.d.ts",
"import": "./dist/server.js",
"require": "./dist/server.cjs",
"types": "./dist/server.d.ts"
"require": "./dist/server.cjs"
},
"./utils": {
"types": "./dist/utils.d.ts",
"import": "./dist/utils.js",
"require": "./dist/utils.cjs",
"types": "./dist/utils.d.ts"
"require": "./dist/utils.cjs"
}
},
"files": [
"dist",
"*.d.ts",
"*.mjs"
],
"bin": {
"vite-node": "./vite-node.mjs"
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"typesVersions": {
"*": {
"*": [
Expand All @@ -56,6 +48,17 @@
]
}
},
"bin": {
"vite-node": "./vite-node.mjs"
},
"files": [
"dist",
"*.d.ts",
"*.mjs"
],
"engines": {
"node": ">=v14.16.0"
},
"scripts": {
"build": "rimraf dist && rollup -c",
"dev": "rollup -c --watch --watch.include=src/** -m inline",
Expand All @@ -73,8 +76,5 @@
"@types/debug": "^4.1.7",
"cac": "^6.7.12",
"rollup": "^2.74.1"
},
"engines": {
"node": ">=v14.16.0"
}
}
50 changes: 25 additions & 25 deletions packages/vitest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,27 @@
"type": "module",
"version": "0.12.9",
"description": "A blazing fast unit test framework powered by Vite",
"author": "Anthony Fu <[email protected]>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/vitest-dev/vitest#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/vitest-dev/vitest.git"
},
"bugs": {
"url": "https://github.com/vitest-dev/vitest/issues"
},
"keywords": [
"vite",
"vite-node",
"test",
"jest"
],
"homepage": "https://github.com/vitest-dev/vitest#readme",
"bugs": {
"url": "https://github.com/vitest-dev/vitest/issues"
},
"license": "MIT",
"author": "Anthony Fu <[email protected]>",
"repository": {
"type": "git",
"url": "git+https://github.com/vitest-dev/vitest.git"
},
"funding": "https://github.com/sponsors/antfu",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
},
"./*": "./*",
"./globals": {
Expand All @@ -36,23 +33,29 @@
"types": "./importMeta.d.ts"
},
"./node": {
"import": "./dist/node.js",
"types": "./dist/node.d.ts"
"types": "./dist/node.d.ts",
"import": "./dist/node.js"
},
"./config": {
"types": "./config.d.ts",
"import": "./dist/config.js",
"require": "./dist/config.cjs",
"types": "./config.d.ts"
"require": "./dist/config.cjs"
}
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"bin": {
"vitest": "./vitest.mjs"
},
"files": [
"dist",
"bin",
"*.d.ts",
"*.mjs"
],
"bin": {
"vitest": "./vitest.mjs"
"engines": {
"node": ">=v14.16.0"
},
"scripts": {
"build": "rimraf dist && rollup -c",
Expand Down Expand Up @@ -128,8 +131,5 @@
"typescript": "^4.7.2",
"vite-node": "workspace:*",
"ws": "^8.7.0"
},
"engines": {
"node": ">=v14.16.0"
}
}
2 changes: 1 addition & 1 deletion packages/vitest/src/integrations/chai/jest-expect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export const JestChaiExpect: ChaiPlugin = (chai, utils) => {
pass = true
}
else {
expectedDiff = Math.pow(10, -precision) / 2
expectedDiff = 10 ** -precision / 2
receivedDiff = Math.abs(expected - received)
pass = receivedDiff < expectedDiff
}
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/integrations/chai/jest-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ const hasPropertyInObject = (object: object, key: string): boolean => {
const isObjectWithKeys = (a: any) =>
isObject(a)
&& !(a instanceof Error)
&& !(a instanceof Array)
&& !(Array.isArray(a))
&& !(a instanceof Date)

export const subsetEquality = (
Expand Down
14 changes: 7 additions & 7 deletions packages/web-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
"type": "module",
"version": "0.12.9",
"description": "Web Worker support for testing in Vitest",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./index.d.ts",
"exports": {
".": {
"types": "./index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js",
"types": "./index.d.ts"
"default": "./dist/index.js"
},
"./pure": {
"types": "./pure.d.ts",
"import": "./dist/pure.js",
"default": "./dist/pure.js",
"types": "./pure.d.ts"
"default": "./dist/pure.js"
}
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./index.d.ts",
"files": [
"dist",
"*.d.ts"
Expand Down
28 changes: 14 additions & 14 deletions packages/ws-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,34 @@
"type": "module",
"version": "0.12.9",
"description": "WebSocket client wrapper for communicating with Vitest",
"homepage": "https://github.com/vitest-dev/vitest#readme",
"bugs": {
"url": "https://github.com/vitest-dev/vitest/issues"
},
"license": "MIT",
"author": "Anthony Fu <[email protected]>",
"license": "MIT",
"funding": "https://github.com/sponsors/antfu",
"homepage": "https://github.com/vitest-dev/vitest#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/vitest-dev/vitest.git"
},
"funding": "https://github.com/sponsors/antfu",
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"bugs": {
"url": "https://github.com/vitest-dev/vitest/issues"
},
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"main": "./dist/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"files": [
"dist",
"*.d.ts",
"*.mjs"
],
"engines": {
"node": ">=v14.16.0"
},
"scripts": {
"build": "rimraf dist && rollup -c",
"dev": "rollup -c --watch --watch.include=src/**",
Expand All @@ -41,8 +44,5 @@
},
"devDependencies": {
"rollup": "^2.74.1"
},
"engines": {
"node": ">=v14.16.0"
}
}

0 comments on commit 6933c90

Please sign in to comment.