From 6ec518ff244a17c1986a092d2d28ac4c0d6182d5 Mon Sep 17 00:00:00 2001 From: "Xin Du (Clark)" Date: Wed, 10 Nov 2021 12:06:22 +0000 Subject: [PATCH] chore(lint): enable eslint on mjs (#1804) --- package.json | 2 +- packages/bridge/src/runtime/vue2-bridge.mjs | 1 - test/presets/_tests.mjs | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 39ec49ac21..818240fdad 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "play": "yarn run nuxi dev playground", "example": "yarn workspace example-$0 dev", "example:build": "yarn workspace example-$0 build", - "lint": "eslint --ext .vue,.ts,.js .", + "lint": "eslint --ext .vue,.ts,.js,.mjs .", "lint:docs": "./node_modules/.bin/markdownlint ./", "test": "yarn lint && yarn test:presets", "test:presets": "mocha test/presets/*.mjs", diff --git a/packages/bridge/src/runtime/vue2-bridge.mjs b/packages/bridge/src/runtime/vue2-bridge.mjs index 1ac8e642ea..f77707a746 100644 --- a/packages/bridge/src/runtime/vue2-bridge.mjs +++ b/packages/bridge/src/runtime/vue2-bridge.mjs @@ -4,5 +4,4 @@ export { EffectScope, computed, createApp, createRef, customRef, defineAsyncComp export const isFunction = fn => fn instanceof Function - export { Vue as default } diff --git a/test/presets/_tests.mjs b/test/presets/_tests.mjs index 7c8dd72cfb..ea695b5b7f 100644 --- a/test/presets/_tests.mjs +++ b/test/presets/_tests.mjs @@ -9,11 +9,11 @@ import { fixtureDir, resolveWorkspace } from '../utils.mjs' const isBridge = Boolean(process.env.TEST_BRIDGE) -export function importModule(path) { +export function importModule (path) { return import(pathToFileURL(path).href) } -export function setupTest(preset) { +export function setupTest (preset) { const fixture = isBridge ? 'bridge' : 'basic' const rootDir = fixtureDir(fixture) const buildDir = resolve(rootDir, '.nuxt-' + preset) @@ -49,11 +49,11 @@ export function setupTest(preset) { return ctx } -export async function startServer(ctx, handle) { +export async function startServer (ctx, handle) { ctx.server = await listen(handle) } -export function testNitroBehavior(_ctx, getHandler) { +export function testNitroBehavior (_ctx, getHandler) { let handler it('setup handler', async () => {