Skip to content

Commit

Permalink
chore: clean up eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed May 29, 2022
1 parent 1cf7fe6 commit c9a8fb0
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 77 deletions.
2 changes: 1 addition & 1 deletion examples/vue/test/async.test.ts
Expand Up @@ -6,7 +6,7 @@ test('async component with suspense', async () => {
expect(AsyncWrapper).toBeTruthy()

let resolve: Function
// eslint-disable-next-line promise/param-names

const promise = new Promise(_resolve => resolve = _resolve)
const wrapper = mount(AsyncWrapper, {
props: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,7 +29,7 @@
"ui:test": "npm -C packages/ui run test:run"
},
"devDependencies": {
"@antfu/eslint-config": "^0.24.2",
"@antfu/eslint-config": "^0.25.0",
"@antfu/ni": "^0.16.2",
"@rollup/plugin-alias": "^3.1.9",
"@rollup/plugin-commonjs": "^22.0.0",
Expand Down
16 changes: 8 additions & 8 deletions packages/vite-node/package.json
Expand Up @@ -18,23 +18,23 @@
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs"
"require": "./dist/index.cjs",
"import": "./dist/index.js"
},
"./client": {
"types": "./dist/client.d.ts",
"import": "./dist/client.js",
"require": "./dist/client.cjs"
"require": "./dist/client.cjs",
"import": "./dist/client.js"
},
"./server": {
"types": "./dist/server.d.ts",
"import": "./dist/server.js",
"require": "./dist/server.cjs"
"require": "./dist/server.cjs",
"import": "./dist/server.js"
},
"./utils": {
"types": "./dist/utils.d.ts",
"import": "./dist/utils.js",
"require": "./dist/utils.cjs"
"require": "./dist/utils.cjs",
"import": "./dist/utils.js"
}
},
"main": "./dist/index.js",
Expand Down
1 change: 0 additions & 1 deletion packages/vite-node/src/cli.ts
Expand Up @@ -74,7 +74,6 @@ async function run(files: string[], options: CliOptions = {}) {
await server.close()

server.watcher.on('change', async (path) => {
// eslint-disable-next-line no-console
console.log(`${cyan('[vite-node]')} File change detected. ${dim(path)}`)

// invalidate module cache but not node_modules
Expand Down
1 change: 0 additions & 1 deletion packages/vite-node/src/client.ts
Expand Up @@ -286,7 +286,6 @@ function exportAll(exports: any, sourceModule: any) {
if (exports === sourceModule)
return

// eslint-disable-next-line no-restricted-syntax
for (const key in sourceModule) {
if (key !== 'default') {
try {
Expand Down
4 changes: 2 additions & 2 deletions packages/vitest/package.json
Expand Up @@ -38,8 +38,8 @@
},
"./config": {
"types": "./config.d.ts",
"import": "./dist/config.js",
"require": "./dist/config.cjs"
"require": "./dist/config.cjs",
"import": "./dist/config.js"
}
},
"main": "./dist/index.js",
Expand Down
Expand Up @@ -107,7 +107,6 @@ export class ObjectContaining extends AsymmetricMatcher<Record<string, unknown>>

let result = true

// eslint-disable-next-line no-restricted-syntax
for (const property in this.sample) {
if (!this.hasProperty(other, property) || !equals(this.sample[property], other[property])) {
result = false
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/integrations/chai/jest-utils.ts
Expand Up @@ -188,7 +188,7 @@ function eq(

function keys(obj: object, hasKey: (obj: object, key: string) => boolean) {
const keys = []
// eslint-disable-next-line no-restricted-syntax

for (const key in obj) {
if (hasKey(obj, key))
keys.push(key)
Expand Down
1 change: 0 additions & 1 deletion packages/vitest/src/integrations/coverage.ts
Expand Up @@ -44,7 +44,6 @@ export function takeCoverage() {
export async function reportCoverage(ctx: Vitest) {
takeCoverage()

// eslint-disable-next-line @typescript-eslint/no-var-requires
const createReport = require('c8/lib/report')
const report = createReport(ctx.config.coverage)

Expand Down
1 change: 0 additions & 1 deletion packages/vitest/src/integrations/globals.ts
Expand Up @@ -4,7 +4,6 @@ import * as index from '../index'
export function registerApiGlobally() {
globalApis.forEach((api) => {
// @ts-expect-error I know what I am doing :P
// eslint-disable-next-line import/namespace
globalThis[api] = index[api]
})
}
1 change: 0 additions & 1 deletion packages/vitest/src/node/error.ts
@@ -1,5 +1,4 @@
/* eslint-disable prefer-template */
/* eslint-disable no-template-curly-in-string */
import { existsSync, readFileSync } from 'fs'
import { join, normalize, relative } from 'pathe'
import c from 'picocolors'
Expand Down

0 comments on commit c9a8fb0

Please sign in to comment.