diff --git a/docs/public/_redirects b/docs/public/_redirects index beb48da63..72f09d1d0 100644 --- a/docs/public/_redirects +++ b/docs/public/_redirects @@ -1,4 +1,4 @@ -/* /zh/:splat 302 Language=zh,zh-CN +/ /zh/ 301! Language=zh,zh-CN /guide /guide/ 301 /config /config/ 301 diff --git a/eslint.config.mjs b/eslint.config.mjs index 0b6879eb4..69a25fb43 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -17,6 +17,9 @@ export default antfu( vue: { 'vue/no-v-text-v-html-on-component': 'off', }, + test: { + 'test/prefer-lowercase-title': 'off', + }, }, ignores: [ '!./docs/.vitepress', diff --git a/packages/@cz-git/plugin-inquirer/__tests__/fuzzy.test.ts b/packages/@cz-git/plugin-inquirer/__tests__/fuzzy.test.ts index d0890f6eb..91bc93871 100644 --- a/packages/@cz-git/plugin-inquirer/__tests__/fuzzy.test.ts +++ b/packages/@cz-git/plugin-inquirer/__tests__/fuzzy.test.ts @@ -6,7 +6,7 @@ import { fuzzyFilter, fuzzyMatch } from '../src' */ describe('fuzzyMatch', () => { it('function should be check param fit', () => { - // @ts-expect-error + // @ts-expect-error expect(fuzzyMatch(null, null)).toBe(null) // @ts-expect-error expect(fuzzyMatch(undefined, null)).toBe(null) @@ -74,25 +74,31 @@ describe('fuzzyFilter', () => { }) it('empty input should be return origin array', () => { + // @ts-expect-error expect(fuzzyFilter('', testArr)).toBe(testArr) }) it('normal match should be return right array', () => { + // @ts-expect-error expect(fuzzyFilter('cz-git', testArr)).toEqual([ { name: 'cz-git', value: 'cz-git', index: 0, score: Infinity }, ]) + // @ts-expect-error expect(fuzzyFilter('ty', testArr)).toEqual([ { name: 'empty', value: false, index: 5, score: 4 }, ]) + // @ts-expect-error expect(fuzzyFilter('inq', testArr)).toEqual([ { name: 'plugin-inquirer', value: 'plugin-inquirer', index: 1, score: 5 }, ]) + // @ts-expect-error expect(fuzzyFilter('ii', testArr)).toEqual([ { name: 'plugin-inquirer', value: 'plugin-inquirer', index: 1, score: 2 }, ]) }) it('same score shoule be return sort by index', () => { + // @ts-expect-error expect(fuzzyFilter('plu', testArr)).toEqual([ { name: 'plugin-inquirer', value: 'plugin-inquirer', index: 1, score: 11 }, { name: 'plugin-loader', value: 'plugin-loader', index: 2, score: 11 }, diff --git a/packages/@cz-git/plugin-inquirer/__tests__/style.test.ts b/packages/@cz-git/plugin-inquirer/__tests__/style.test.ts index e31393e2d..528fe42e0 100644 --- a/packages/@cz-git/plugin-inquirer/__tests__/style.test.ts +++ b/packages/@cz-git/plugin-inquirer/__tests__/style.test.ts @@ -20,16 +20,15 @@ describe('isColorizenSupport()', () => { it('param force false should be false', () => { expect(isColorizenSupport(false)).toBe(false) }) - it('nO_COLOR should be false', () => { + it('NO_COLOR should be false', () => { process.env.NO_COLOR = 'true' expect(isColorizenSupport()).toBe(false) }) - it('tERM is dumb should be false | platform is win32 should be true', () => { + it('TERM is dumb should be false | platform is win32 should be true', () => { delete process.env.CI process.env.TERM = 'dumb' if (process.platform === 'win32') expect(isColorizenSupport()).toBe(true) - else expect(isColorizenSupport()).toBe(false) })