Skip to content

Commit

Permalink
Lint everything
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoattal committed Dec 10, 2024
1 parent 84c99b6 commit dde4f7a
Show file tree
Hide file tree
Showing 150 changed files with 350 additions and 339 deletions.
12 changes: 6 additions & 6 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import DefaultTheme from 'vitepress/theme'
import FloatingVue from 'floating-vue'
import { Icon } from '@iconify/vue'
import FloatingVue from 'floating-vue'
import DefaultTheme from 'vitepress/theme'
import DemoLinks from './DemoLinks.vue'
import DemoPreview from './DemoPreview.vue'
import MeetTeam from './MeetTeam.vue'
import SponsorButton from './SponsorButton.vue'
import 'floating-vue/dist/style.css'
import './style/vars.pcss'
import './style/index.pcss'
import SponsorButton from './SponsorButton.vue'
import MeetTeam from './MeetTeam.vue'
import DemoPreview from './DemoPreview.vue'
import DemoLinks from './DemoLinks.vue'

export default {
...DefaultTheme,
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/visual-regression-testing/percy.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ pnpm add -D @histoire/plugin-percy
Add the plugin in histoire config:

```js
import { defineConfig } from 'histoire'
import { HstPercy } from '@histoire/plugin-percy'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ Inside your setup file, you can export a `setupVue3` function that will be calle
```ts
// src/histoire.setup.ts

import { createPinia } from 'pinia'
import { defineSetupVue3 } from '@histoire/plugin-vue'
import { createPinia } from 'pinia'

export const setupVue3 = defineSetupVue3(({ app, story, variant }) => {
const pinia = createPinia()
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/svelte3/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ yarn add -D histoire @histoire/plugin-svelte
Create an `histoire.config.js` or `histoire.config.ts` file in your project root to enable the Svelte plugin:

```ts
import { defineConfig } from 'histoire'
import { HstSvelte } from '@histoire/plugin-svelte'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion docs/guide/vue3/app-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ You can define a setup function globally in your setup file defined by the `setu
For Vue 3, it must be called `setupVue3`. Histoire provides an optional `defineSetupVue3` helper to have better types in your IDE:

```ts
import { createPinia } from 'pinia'
import { defineSetupVue3 } from '@histoire/plugin-vue'
import { createPinia } from 'pinia'

export const setupVue3 = defineSetupVue3(({ app, story, variant }) => {
// Vue plugin
Expand Down
6 changes: 3 additions & 3 deletions docs/guide/vue3/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ yarn add -D histoire @histoire/plugin-vue
Create an `histoire.config.js` or `histoire.config.ts` file in your project root to enable the Vue plugin:

```ts
import { defineConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down Expand Up @@ -128,9 +128,9 @@ pnpm add -D @histoire/plugin-nuxt
Add the plugin in histoire config:

```js
import { defineConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import { HstNuxt } from '@histoire/plugin-nuxt'
import { HstVue } from '@histoire/plugin-vue'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ Learn more about configuring Histoire [here](../guide/config.md).
Array of plugins. Learn more about [official plugins](../guide/plugins/official.md) and [how to develop them](../guide/plugins/development.md).

```ts
import { HstVue } from '@histoire/plugin-vue'
import { HstNuxt } from '@histoire/plugin-nuxt'
import { HstVue } from '@histoire/plugin-vue'

export default defineConfig({
plugins: [
Expand Down
3 changes: 2 additions & 1 deletion examples/nuxt3/cypress/e2e/render-story.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('Story render', () => {

Check failure on line 3 in examples/nuxt3/cypress/e2e/render-story.cy.js

View workflow job for this annotation

GitHub Actions / Build and test

'describe' is not defined
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')

Check failure on line 4 in examples/nuxt3/cypress/e2e/render-story.cy.js

View workflow job for this annotation

GitHub Actions / Build and test

'cy' is not defined
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

Check failure on line 7 in examples/nuxt3/cypress/e2e/render-story.cy.js

View workflow job for this annotation

GitHub Actions / Build and test

'cy' is not defined

it('should display the story content', () => {

Check failure on line 9 in examples/nuxt3/cypress/e2e/render-story.cy.js

View workflow job for this annotation

GitHub Actions / Build and test

'it' is not defined
Expand Down
4 changes: 2 additions & 2 deletions examples/nuxt3/histoire.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import { HstNuxt } from '@histoire/plugin-nuxt'
import { HstVue } from '@histoire/plugin-vue'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
3 changes: 2 additions & 1 deletion examples/svelte4/cypress/e2e/render-story.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('Story render', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

it('should display the story content (with iframe)', () => {
Expand Down
3 changes: 2 additions & 1 deletion examples/svelte4/cypress/e2e/state-sync.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('State sync', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

it('should display the story content (with iframe)', () => {
Expand Down
4 changes: 2 additions & 2 deletions examples/svelte4/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="histoire" />

import { defineConfig } from 'vite'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { HstSvelte } from '@histoire/plugin-svelte'
import { svelte } from '@sveltejs/vite-plugin-svelte'
import { defineConfig } from 'vite'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/sveltekit/src/routes/todos/+page.server.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Action, PageServerLoad } from './$types'
import { error } from '@sveltejs/kit'
import { api } from './api'
import type { Action, PageServerLoad } from './$types'

interface Todo {
uid: string
Expand Down
4 changes: 2 additions & 2 deletions examples/sveltekit/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="histoire" />

import { defineConfig } from 'vite'
import { sveltekit } from '@sveltejs/kit/vite'
import { HstSvelte } from '@histoire/plugin-svelte'
import { sveltekit } from '@sveltejs/kit/vite'
import { defineConfig } from 'vite'

export default defineConfig({
plugins: [
Expand Down
4 changes: 2 additions & 2 deletions examples/vue3-percy/histoire.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import { HstPercy } from '@histoire/plugin-percy'
import { HstVue } from '@histoire/plugin-vue'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3-percy/src/histoire.setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './histoire.css'
import { defineSetupVue3 } from '@histoire/plugin-vue'
import './histoire.css'

export const setupVue3 = defineSetupVue3(({ app }) => {
app.provide('demo', 24)
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3-percy/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="histoire" />

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
// @TODO investigate ESM errors when this is imported in vite.config.ts
// https://github.com/vitejs/vite/issues/7981
// import { HstScreenshot } from '@histoire/plugin-screenshot'
Expand Down
4 changes: 2 additions & 2 deletions examples/vue3-screenshot/histoire.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import { HstScreenshot } from '@histoire/plugin-screenshot'
import { HstVue } from '@histoire/plugin-vue'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3-screenshot/src/histoire.setup.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import './histoire.css'
import { defineSetupVue3 } from '@histoire/plugin-vue'
import './histoire.css'

export const setupVue3 = defineSetupVue3(({ app }) => {
app.provide('demo', 42)
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3-screenshot/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="histoire" />

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
// @TODO investigate ESM errors when this is imported in vite.config.ts
// https://github.com/vitejs/vite/issues/7981
// import { HstScreenshot } from '@histoire/plugin-screenshot'
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3-themed/histoire.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3-themed/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defaultColors } from 'histoire'
import { defineConfig } from 'vite'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3-vuetify/histoire.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import { defineConfig } from 'histoire'

export default defineConfig({
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3-vuetify/src/components/v-btn.story.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script setup>
import { ref } from 'vue'
import { logEvent } from 'histoire/client'
import { ref } from 'vue'
const text = ref('Click me!')
</script>
Expand Down
6 changes: 3 additions & 3 deletions examples/vue3-vuetify/src/histoire.setup.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { defineSetupVue3 } from '@histoire/plugin-vue'

// Vuetify
import { createVuetify } from 'vuetify'
// Styles
import '@mdi/font/css/materialdesignicons.css'
import 'vuetify/styles'

// Vuetify
import { createVuetify } from 'vuetify'
import 'vuetify/styles'

export const setupVue3 = defineSetupVue3(({ app }) => {
app.use(createVuetify())
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3-vuetify/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="histoire" />

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'
import vuetify from 'vite-plugin-vuetify'

export default defineConfig({
Expand Down
3 changes: 2 additions & 1 deletion examples/vue3/cypress/e2e/controls.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('Controls', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

beforeEach(() => {
Expand Down
3 changes: 2 additions & 1 deletion examples/vue3/cypress/e2e/event.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('Event (iframe)', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

it('should send events', () => {
Expand Down
3 changes: 2 additions & 1 deletion examples/vue3/cypress/e2e/setup-vue3.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('Setup app (vue3)', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

it('should handle global setup', () => {
Expand Down
9 changes: 6 additions & 3 deletions examples/vue3/cypress/e2e/state.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('State Options API', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

beforeEach(() => {
Expand All @@ -18,7 +19,8 @@ describe('State Options API', () => {

describe('State Setup API', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

beforeEach(() => {
Expand All @@ -37,7 +39,8 @@ describe('State Setup API', () => {

describe('State Setup API (2)', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

beforeEach(() => {
Expand Down
3 changes: 1 addition & 2 deletions examples/vue3/cypress/e2e/stories-list.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ describe('Stories list', () => {
cy.visit('/')
cy.get('[data-test-id="story-list-item"]').should('have.length', 33)
cy.get('[data-test-id="story-list-item"]').contains('🐱 Meow')
cy.get('[data-test-id="story-list-item"]').contains('BaseButton')
.contains('3') // Variants count
cy.get('[data-test-id="story-list-item"]').contains('BaseButton').contains('3') // Variants count
cy.get('[data-test-id="story-list-item"]').contains('Demo')
cy.get('[data-test-id="story-list-folder"]').should('have.length', 2)
})
Expand Down
3 changes: 2 additions & 1 deletion examples/vue3/cypress/e2e/story-preview.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('Story preview', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

it('should display the untitled variant', () => {
Expand Down
3 changes: 2 additions & 1 deletion examples/vue3/cypress/e2e/toolbar-background.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('background color', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

const backgroundColorShouldBe = [
Expand Down
3 changes: 2 additions & 1 deletion examples/vue3/cypress/e2e/wrapper.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

describe('Wrapper', () => {
const getIframeBody = () => cy.get('iframe[data-test-id="preview-iframe"]')
.its('0.contentDocument.body').should('not.be.empty')
.its('0.contentDocument.body')
.should('not.be.empty')
.then(cy.wrap)

it('should display the wrapper', () => {
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3/histoire.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig, getDefaultConfig } from 'histoire'
import { HstVue } from '@histoire/plugin-vue'
import { defineConfig, getDefaultConfig } from 'histoire'

export default defineConfig({
// outDir: 'hdist',
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3/src/components/CodeGen.story.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script lang="ts" setup>
import { ref } from 'vue'
import BaseButton from './BaseButton.vue'
import ModalWithSlots from './ModalWithSlots.vue'
import SlotWithProps from './SlotWithProps.vue'
import BaseButton from './BaseButton.vue'
const vTooltip = {
mounted: (el, { value }) => {
Expand Down
2 changes: 1 addition & 1 deletion examples/vue3/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="histoire" />

import path from 'node:path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vite'

export default defineConfig({
// Example build config for a component library
Expand Down
Loading

0 comments on commit dde4f7a

Please sign in to comment.