Skip to content

Commit

Permalink
fix cypress lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoattal committed Dec 10, 2024
1 parent 8d205a4 commit fa96833
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 8 deletions.
5 changes: 5 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ export default antfu({
rules: {
'import/first': 'off',
},
}, {
files: ['**/*.cy.js'],
env: {
'cypress/globals': true,
},
})
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"@vueuse/core": "^12.0.0",
"autoprefixer": "^10.4.20",
"eslint": "^9.16.0",
"eslint-plugin-cypress": "^4.1.0",
"floating-vue": "5.2.2",
"postcss": "^8.4.49",
"rimraf": "^6.0.1",
Expand Down
1 change: 0 additions & 1 deletion packages/histoire-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"@histoire/controls": "workspace:^",
"@histoire/shared": "workspace:^",
"@histoire/vendors": "workspace:^",
"@types/flexsearch": "^0.7.6",
"flexsearch": "0.7.43",
"shiki-es": "^0.14.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { SearchResult, SearchResultType, Story, Variant } from '../../types
import type { SearchData } from './types'
import { Icon } from '@iconify/vue'
import { useDebounce, useFocus } from '@vueuse/core'
import * as flexsearch from 'flexsearch'
import FlexSearch from 'flexsearch'
import language from 'flexsearch/dist/module/lang/en.js'
import charset from 'flexsearch/dist/module/lang/latin/advanced.js'
import { registeredCommands } from 'virtual:$histoire-commands'
Expand Down Expand Up @@ -57,11 +57,11 @@ const rateLimitedSearch = useDebounce(searchInputText, 50)
const storyStore = useStoryStore()
let titleSearchIndex: flexsearch.Document<any, any>
let titleSearchIndex: FlexSearch.Document<any, any>
let titleIdMap: SearchData['idMap']
function createIndex() {
return new flexsearch.Document({
return new FlexSearch.Document({
preset: 'match',
document: {
id: 'id',
Expand Down Expand Up @@ -92,7 +92,7 @@ onUpdate((searchData) => {
loadSearchIndex(searchData)
})
let docSearchIndex: flexsearch.Document<any, any>
let docSearchIndex: FlexSearch.Document<any, any>
let docIdMap: SearchData['idMap']
async function loadDocSearchIndex() {
Expand Down
1 change: 0 additions & 1 deletion packages/histoire/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
"@histoire/controls": "workspace:^",
"@histoire/shared": "workspace:^",
"@histoire/vendors": "workspace:^",
"@types/flexsearch": "^0.7.6",
"@types/markdown-it": "^14.1.2",
"birpc": "^0.2.19",
"change-case": "^5.4.4",
Expand Down
4 changes: 2 additions & 2 deletions packages/histoire/src/node/search.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Context } from './context.js'
import { createRequire } from 'node:module'
import { noCase } from 'change-case'
import flexsearch from 'flexsearch'
import FlexSearch from 'flexsearch'
import path from 'pathe'
import { loadModule } from './load.js'

Expand Down Expand Up @@ -53,7 +53,7 @@ export async function generateDocSearchData(ctx: Context) {

async function createIndex() {
const flexsearchRoot = path.dirname(require.resolve('flexsearch/package.json'))
return new flexsearch.Document({
return new FlexSearch.Document({
preset: 'match',
document: {
id: 'id',
Expand Down

0 comments on commit fa96833

Please sign in to comment.