Skip to content

Commit

Permalink
fix: some ci fix
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Apr 5, 2024
1 parent 8a2bb29 commit 0278f24
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: ['plugin:markdown/recommended', 'prettier'],
extends: ['plugin:markdown/recommended-legacy', 'prettier'],
overrides: [
{
files: '*.mjs',
Expand Down Expand Up @@ -39,7 +39,7 @@ module.exports = {
},
{
files: ['*.ts', '*.tsx'],
extends: ['standard-with-typescript', 'plugin:import/typescript'],
extends: ['love', 'plugin:import/typescript'],
parserOptions: {
project: './tsconfig.json',
ecmaFeatures: {
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
"@rollup/plugin-terser": "^0.4.3",
"@types/estree": "^1.0.1",
"@types/jest": "^29.5.4",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^7.0.2",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
"@vicons/fluent": "^0.12.0",
"@vicons/ionicons4": "^0.12.0",
"@vicons/ionicons5": "^0.12.0",
Expand All @@ -106,11 +106,11 @@
"deepmerge": "^4.3.1",
"esbuild": "0.20.1",
"eslint": "^8.48.0",
"eslint-config-love": "^44.0.0",
"eslint-config-prettier": "^9.0.0",
"eslint-config-standard": "^17.1.0",
"eslint-config-standard-with-typescript": "^43.0.0",
"eslint-plugin-import": "^2.28.1",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-markdown": "^4.0.1",
"eslint-plugin-n": "^16.0.2",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.1.1",
Expand Down
5 changes: 1 addition & 4 deletions src/auto-complete/tests/AutoComplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,7 @@ describe('n-auto-complete', () => {
const wrapper = mount(NAutoComplete)
await wrapper.setProps({
getShow: (value: string | null) => {
if (value && value.endsWith('@')) {
return true
}
return false
return !!value?.endsWith('@')
},
options
})
Expand Down
21 changes: 9 additions & 12 deletions src/code/tests/Code.spec.ts → src/code/tests/Code.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { toRaw, h } from 'vue'
import { mount } from '@vue/test-utils'
import { NCode } from '../index'
import hljs from 'highlight.js/lib/core'
Expand All @@ -21,23 +22,19 @@ describe('n-code', () => {
wrapper.unmount()
})
it('should work with `language` prop', () => {
const wrapper = mount(NCode, {
props: {
code: 'console.log(a)',
language: 'javascript',
hljs
}
const wrapper = mount(() => {
return (
<NCode code="console.log(a)" language="javascript" hljs={toRaw(hljs)} />
)
})
expect(wrapper.find('.hljs-variable').text()).toBe('console')
wrapper.unmount()
})
it('should work with `hljs` prop', () => {
const wrapper = mount(NCode, {
props: {
code: 'console.log(a)',
language: 'javascript',
hljs
}
const wrapper = mount(() => {
return (
<NCode code="console.log(a)" language="javascript" hljs={toRaw(hljs)} />
)
})
expect(wrapper.find('.function_').text()).toBe('log')
wrapper.unmount()
Expand Down
1 change: 1 addition & 0 deletions src/form/src/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export default defineComponent({
})
}
if (formInvalid) {
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
reject(errors.length ? errors : undefined)
} else {
resolve({
Expand Down
1 change: 1 addition & 0 deletions src/form/src/FormItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ export default defineComponent({
if (validateCallback) {
validateCallback(errors, { warnings })
}
// eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors
reject(errors)
}
})
Expand Down

0 comments on commit 0278f24

Please sign in to comment.