mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 15:15:19 +00:00
chore: fix small typos (#26907)
This commit is contained in:
parent
9f9e3e6917
commit
fdbfed1280
@ -60,7 +60,7 @@ We currently ship an environment for unit testing code that needs a [Nuxt](https
|
|||||||
```
|
```
|
||||||
|
|
||||||
::tip
|
::tip
|
||||||
When importing `@nuxt/test-utils` in your vitest config, It is necessary to have `"type": "module"` specified in your `package.json` or rename your vitest config file appropriatly.
|
When importing `@nuxt/test-utils` in your vitest config, It is necessary to have `"type": "module"` specified in your `package.json` or rename your vitest config file appropriately.
|
||||||
> ie. `vitest.config.m{ts,js}`.
|
> ie. `vitest.config.m{ts,js}`.
|
||||||
::
|
::
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ The recommended approach for Nuxt is to enable ESLint support using the [`@nuxt/
|
|||||||
:::callout{icon="i-ph-lightbulb-duotone"}
|
:::callout{icon="i-ph-lightbulb-duotone"}
|
||||||
The module is designed for the [new ESLint flat config format](https://eslint.org/docs/latest/use/configure/configuration-files-new) with is the [default format since ESLint v9](https://eslint.org/blog/2024/04/eslint-v9.0.0-released/).
|
The module is designed for the [new ESLint flat config format](https://eslint.org/docs/latest/use/configure/configuration-files-new) with is the [default format since ESLint v9](https://eslint.org/blog/2024/04/eslint-v9.0.0-released/).
|
||||||
|
|
||||||
If you are using the legacy `.eslintrc` config, you will need to [configure manually with `@nuxt/eslint-config`](https://eslint.nuxt.com/packages/config#legacy-config-format). We highly recommand you to migrate over the flat config to be future-proof.
|
If you are using the legacy `.eslintrc` config, you will need to [configure manually with `@nuxt/eslint-config`](https://eslint.nuxt.com/packages/config#legacy-config-format). We highly recommend you to migrate over the flat config to be future-proof.
|
||||||
:::
|
:::
|
||||||
|
|
||||||
## Quick Setup
|
## Quick Setup
|
||||||
|
@ -18,7 +18,7 @@ export function hasSuffix (path: string, suffix: string) {
|
|||||||
|
|
||||||
export function resolveComponentNameSegments (fileName: string, prefixParts: string[]) {
|
export function resolveComponentNameSegments (fileName: string, prefixParts: string[]) {
|
||||||
/**
|
/**
|
||||||
* Array of fileName parts splitted by case, / or -
|
* Array of fileName parts split by case, / or -
|
||||||
* @example third-component -> ['third', 'component']
|
* @example third-component -> ['third', 'component']
|
||||||
* @example AwesomeComponent -> ['Awesome', 'Component']
|
* @example AwesomeComponent -> ['Awesome', 'Component']
|
||||||
*/
|
*/
|
||||||
|
@ -146,7 +146,7 @@ describe('treeshake client only in ssr', () => {
|
|||||||
expect(treeshaken).toContain('const { ButShouldNotBeTreeShaken } = defineAsyncComponent(async () => {')
|
expect(treeshaken).toContain('const { ButShouldNotBeTreeShaken } = defineAsyncComponent(async () => {')
|
||||||
expect(treeshaken).toContain('const [ { Dont, }, That] = defineAsyncComponent(async () => {')
|
expect(treeshaken).toContain('const [ { Dont, }, That] = defineAsyncComponent(async () => {')
|
||||||
|
|
||||||
// treeshake object that has an assignement pattern
|
// treeshake object that has an assignment pattern
|
||||||
expect(treeshaken).toContain('const { woooooo, } = defineAsyncComponent(async () => {')
|
expect(treeshaken).toContain('const { woooooo, } = defineAsyncComponent(async () => {')
|
||||||
expect(treeshaken).not.toContain('const { Deep, assignment: { Pattern = ofComponent } } = defineAsyncComponent(async () => {')
|
expect(treeshaken).not.toContain('const { Deep, assignment: { Pattern = ofComponent } } = defineAsyncComponent(async () => {')
|
||||||
|
|
||||||
|
@ -446,7 +446,7 @@ describe('pages', () => {
|
|||||||
expect(html).not.toContain('<p></p>')
|
expect(html).not.toContain('<p></p>')
|
||||||
expect(html).toContain('hi')
|
expect(html).toContain('hi')
|
||||||
|
|
||||||
// aysnc setup
|
// async setup
|
||||||
expect(html).toContain('Work with async setup')
|
expect(html).toContain('Work with async setup')
|
||||||
|
|
||||||
const { page, pageErrors } = await renderPage('/client-fallback')
|
const { page, pageErrors } = await renderPage('/client-fallback')
|
||||||
|
2
test/fixtures/basic-types/extends/node_modules/foo/layouts/override.vue
generated
vendored
2
test/fixtures/basic-types/extends/node_modules/foo/layouts/override.vue
generated
vendored
@ -1,3 +1,3 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>This layout should be overriden by bar</div>
|
<div>This layout should be overridden by bar</div>
|
||||||
</template>
|
</template>
|
||||||
|
2
test/fixtures/basic-types/extends/node_modules/foo/middleware/override.ts
generated
vendored
2
test/fixtures/basic-types/extends/node_modules/foo/middleware/override.ts
generated
vendored
@ -1,3 +1,3 @@
|
|||||||
export default defineNuxtRouteMiddleware((to) => {
|
export default defineNuxtRouteMiddleware((to) => {
|
||||||
to.meta.override = 'This middleware should be overriden by bar'
|
to.meta.override = 'This middleware should be overridden by bar'
|
||||||
})
|
})
|
||||||
|
2
test/fixtures/basic-types/extends/node_modules/foo/pages/override.vue
generated
vendored
2
test/fixtures/basic-types/extends/node_modules/foo/pages/override.vue
generated
vendored
@ -1,3 +1,3 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>This page should be overriden by bar</div>
|
<div>This page should be overridden by bar</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export function useLifecyleLogs (name: string) {
|
export function useLifecycleLogs (name: string) {
|
||||||
onMounted(() => console.log(`${name}: onMounted`))
|
onMounted(() => console.log(`${name}: onMounted`))
|
||||||
onUnmounted(() => console.log(`${name}: onUnmounted`))
|
onUnmounted(() => console.log(`${name}: onUnmounted`))
|
||||||
onActivated(() => console.log(`${name}: onActivated`))
|
onActivated(() => console.log(`${name}: onActivated`))
|
||||||
|
@ -1 +1 @@
|
|||||||
export const useOverrideableComposable = () => 'test from project'
|
export const useOverridableComposable = () => 'test from project'
|
||||||
|
@ -1 +1 @@
|
|||||||
export const useOverrideableComposable = () => 'test from layer'
|
export const useOverridableComposable = () => 'test from layer'
|
||||||
|
2
test/fixtures/basic/extends/node_modules/foo/components/ExtendsOverride.vue
generated
vendored
2
test/fixtures/basic/extends/node_modules/foo/components/ExtendsOverride.vue
generated
vendored
@ -1,3 +1,3 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>This component should be overriden by bar</div>
|
<div>This component should be overridden by bar</div>
|
||||||
</template>
|
</template>
|
||||||
|
2
test/fixtures/basic/extends/node_modules/foo/layouts/override.vue
generated
vendored
2
test/fixtures/basic/extends/node_modules/foo/layouts/override.vue
generated
vendored
@ -1,3 +1,3 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>This layout should be overriden by bar</div>
|
<div>This layout should be overridden by bar</div>
|
||||||
</template>
|
</template>
|
||||||
|
2
test/fixtures/basic/extends/node_modules/foo/pages/override.vue
generated
vendored
2
test/fixtures/basic/extends/node_modules/foo/pages/override.vue
generated
vendored
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>This page should be overriden by bar</div>
|
<div>This page should be overridden by bar</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
2
test/fixtures/basic/pages/extends.vue
vendored
2
test/fixtures/basic/pages/extends.vue
vendored
@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
{{ useOverrideableComposable() }}
|
{{ useOverridableComposable() }}
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
2
test/fixtures/basic/pages/islands.vue
vendored
2
test/fixtures/basic/pages/islands.vue
vendored
@ -2,7 +2,7 @@
|
|||||||
const islandProps = ref({
|
const islandProps = ref({
|
||||||
bool: true,
|
bool: true,
|
||||||
number: 100,
|
number: 100,
|
||||||
str: 'helo world',
|
str: 'hello world',
|
||||||
obj: { json: 'works' },
|
obj: { json: 'works' },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
useLifecyleLogs('keepalive-in-config')
|
useLifecycleLogs('keepalive-in-config')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
useLifecyleLogs('keepalive-in-nuxtpage-2')
|
useLifecycleLogs('keepalive-in-nuxtpage-2')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
useLifecyleLogs('keepalive-in-nuxtpage')
|
useLifecycleLogs('keepalive-in-nuxtpage')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
useLifecyleLogs('not-keepalive-in-nuxtpage')
|
useLifecycleLogs('not-keepalive-in-nuxtpage')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
useLifecyleLogs('not-keepalive')
|
useLifecycleLogs('not-keepalive')
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -37,7 +37,7 @@ beforeEach(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
describe('runtime server component', () => {
|
describe('runtime server component', () => {
|
||||||
it('expect no data-v- attrbutes #23051', () => {
|
it('expect no data-v- attributes #23051', () => {
|
||||||
// @ts-expect-error mock
|
// @ts-expect-error mock
|
||||||
vi.mocked(h).mockImplementation(() => null)
|
vi.mocked(h).mockImplementation(() => null)
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ describe('plugin dependsOn', () => {
|
|||||||
])
|
])
|
||||||
})
|
})
|
||||||
|
|
||||||
it('relying on plugin not registed yet', async () => {
|
it('relying on plugin not registered yet', async () => {
|
||||||
const nuxtApp = useNuxtApp()
|
const nuxtApp = useNuxtApp()
|
||||||
const sequence: string[] = []
|
const sequence: string[] = []
|
||||||
const plugins = [
|
const plugins = [
|
||||||
|
Loading…
Reference in New Issue
Block a user