chore(lint): enable eslint on mjs (#1804)

This commit is contained in:
Xin Du (Clark) 2021-11-10 12:06:22 +00:00 committed by GitHub
parent bf716f3978
commit 6ec518ff24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 6 deletions

View File

@ -17,7 +17,7 @@
"play": "yarn run nuxi dev playground", "play": "yarn run nuxi dev playground",
"example": "yarn workspace example-$0 dev", "example": "yarn workspace example-$0 dev",
"example:build": "yarn workspace example-$0 build", "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 ./", "lint:docs": "./node_modules/.bin/markdownlint ./",
"test": "yarn lint && yarn test:presets", "test": "yarn lint && yarn test:presets",
"test:presets": "mocha test/presets/*.mjs", "test:presets": "mocha test/presets/*.mjs",

View File

@ -4,5 +4,4 @@ export { EffectScope, computed, createApp, createRef, customRef, defineAsyncComp
export const isFunction = fn => fn instanceof Function export const isFunction = fn => fn instanceof Function
export { Vue as default } export { Vue as default }

View File

@ -9,11 +9,11 @@ import { fixtureDir, resolveWorkspace } from '../utils.mjs'
const isBridge = Boolean(process.env.TEST_BRIDGE) const isBridge = Boolean(process.env.TEST_BRIDGE)
export function importModule(path) { export function importModule (path) {
return import(pathToFileURL(path).href) return import(pathToFileURL(path).href)
} }
export function setupTest(preset) { export function setupTest (preset) {
const fixture = isBridge ? 'bridge' : 'basic' const fixture = isBridge ? 'bridge' : 'basic'
const rootDir = fixtureDir(fixture) const rootDir = fixtureDir(fixture)
const buildDir = resolve(rootDir, '.nuxt-' + preset) const buildDir = resolve(rootDir, '.nuxt-' + preset)
@ -49,11 +49,11 @@ export function setupTest(preset) {
return ctx return ctx
} }
export async function startServer(ctx, handle) { export async function startServer (ctx, handle) {
ctx.server = await listen(handle) ctx.server = await listen(handle)
} }
export function testNitroBehavior(_ctx, getHandler) { export function testNitroBehavior (_ctx, getHandler) {
let handler let handler
it('setup handler', async () => { it('setup handler', async () => {