Skip to content

Commit 221ce99

Browse files
chore: apply lint fixes
Co-authored-by: Alexander Lichter <github@lichter.io>
1 parent 23f0974 commit 221ce99

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

packages/nuxt/src/app/components/route-provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const defineRouteProvider = (name = 'RouteProvider') => defineComponent({
3636
onMounted(() => {
3737
nextTick(() => {
3838
if (['#comment', '#text'].includes(vnode?.el?.nodeName)) {
39-
const filename = (vnode?.type as any).__file
39+
const filename = (vnode?.type as any)?.__file
4040
console.warn(`[nuxt] \`${filename}\` does not have a single root node and will cause errors when navigating between routes.`)
4141
}
4242
})

packages/nuxt/src/app/entry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ if (import.meta.client) {
4949
import.meta.webpackHot.accept()
5050
}
5151

52-
// eslint-disable-next-line
52+
// eslint-disable-next-line prefer-const
5353
let vueAppPromise: Promise<App<Element>>
5454

5555
entry = async function initApp () {

packages/nuxt/src/pages/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export default defineNuxtModule({
200200
// way to add a route without a file, which must be possible
201201
const route = addedPagePaths.has(absolutePagePath)
202202
? parent
203-
: /^\//.test(page.path)
203+
: page.path[0] === '/'
204204
// @ts-expect-error TODO: either fix types upstream or figure out another
205205
// way to add a route without a file, which must be possible
206206
? rootPage.insert(page.path, page.file)

packages/nuxt/test/nitro/render-index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const nitroApp = useNitroApp()
77

88
async function renderIndex () {
99
const text = await (nitroApp as NitroApp).localFetch('/', {}).then(r => r.text())
10-
// eslint-disable-next-line
10+
// eslint-disable-next-line no-console
1111
console.log(text)
1212
}
1313

packages/vite/src/runtime/vite-node.mjs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const runner = createRunner()
1111
/** @type {(ssrContext: import('#app').NuxtSSRContext) => Promise<any>} */
1212
let render
1313

14-
/** @param ssrContext {import('#app').NuxtSSRContext} */
14+
/** @param {import('#app').NuxtSSRContext} ssrContext */
1515
export default async (ssrContext) => {
1616
// Workaround for stub mode
1717
// https://github.com/nuxt/framework/pull/3983
@@ -74,16 +74,16 @@ function createRunner () {
7474
}
7575

7676
/**
77-
* @param errorData {any}
78-
* @param id {string}
77+
* @param {any} errorData
78+
* @param {string} id
7979
*/
8080
function formatViteError (errorData, id) {
8181
const errorCode = errorData.name || errorData.reasonCode || errorData.code
8282
const frame = errorData.frame || errorData.source || errorData.pluginCode
8383

84-
/** @param locObj {{ file?: string, id?: string, url?: string }} */
84+
/** @param {{ file?: string, id?: string, url?: string }} locObj */
8585
const getLocId = (locObj = {}) => locObj.file || locObj.id || locObj.url || id || ''
86-
/** @param locObj {{ line?: string, column?: string }} */
86+
/** @param {{ line?: string, column?: string }} locObj */
8787
const getLocPos = (locObj = {}) => locObj.line ? `${locObj.line}:${locObj.column || 0}` : ''
8888
const locId = getLocId(errorData.loc) || getLocId(errorData.location) || getLocId(errorData.input) || getLocId(errorData)
8989
const locPos = getLocPos(errorData.loc) || getLocPos(errorData.location) || getLocPos(errorData.input) || getLocPos(errorData)

test/fixtures/basic-types/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ describe('middleware', () => {
175175
definePageMeta({
176176
validate: async () => {
177177
await new Promise(resolve => setTimeout(resolve, 1000))
178-
// eslint-disable-next-line
178+
// eslint-disable-next-line no-constant-condition
179179
if (0) {
180180
return createError({
181181
statusCode: 404,

0 commit comments

Comments
 (0)