Skip to content

Commit ca368ac

Browse files
committed
chore: update deps
1 parent 56f66eb commit ca368ac

File tree

9 files changed

+84
-68
lines changed

9 files changed

+84
-68
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.cjs

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/tests.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,35 @@ on:
66
- opened
77
push:
88
branches:
9-
- 'master'
9+
- master
1010
paths:
11-
- '**.vue'
11+
- '.github/workflows/tests.yml'
12+
- 'bun.lockb'
1213
- '**.ts'
14+
- '**.vue'
1315

1416
env:
1517
HUSKY: 0
1618

1719
jobs:
18-
js-tests:
19-
name: Run JS tests
20+
unit-tests:
2021
runs-on: ubuntu-22.04
22+
strategy:
23+
fail-fast: true
24+
matrix:
25+
node-version: [18, 20, 22, 23]
26+
27+
name: NodeJS ${{ matrix.node-version }}
2128

2229
steps:
2330
- uses: actions/checkout@v4
2431

2532
- name: Install Node.js
26-
uses: actions/setup-node@v3
33+
uses: actions/setup-node@v4
2734
with:
28-
node-version: 18
35+
node-version: ${{ matrix.node-version }}
2936

30-
- uses: oven-sh/setup-bun@v1
37+
- uses: oven-sh/setup-bun@v2
3138

3239
- name: Install dependencies
3340
run: bun install

bun.lockb

2.67 KB
Binary file not shown.

eslint.config.js

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import tseslint from 'typescript-eslint'
2+
import pluginVue from 'eslint-plugin-vue'
3+
import stylisticTs from '@stylistic/eslint-plugin-ts'
4+
5+
export default tseslint.config(
6+
...tseslint.configs.stylistic,
7+
...pluginVue.configs['flat/recommended'],
8+
{
9+
files: ['**/*.vue'],
10+
languageOptions: {
11+
parserOptions: {
12+
parser: '@typescript-eslint/parser',
13+
},
14+
},
15+
rules: {
16+
'vue/html-indent': ['warn', 4],
17+
'vue/max-attributes-per-line': ['warn', {
18+
singleline: {
19+
max: 3,
20+
},
21+
multiline: {
22+
max: 1,
23+
},
24+
}],
25+
},
26+
},
27+
{
28+
ignores: [
29+
'**/node_modules/**',
30+
'**/dist/**',
31+
],
32+
33+
plugins: {
34+
'@stylistic/ts': stylisticTs,
35+
},
36+
37+
// @see https://typescript-eslint.io/rules/
38+
rules: {
39+
'no-console': ['warn', { allow: ['warn', 'error'] }],
40+
'@stylistic/ts/semi': ['warn', 'never'],
41+
'@stylistic/ts/quotes': ['warn', 'single'],
42+
'@stylistic/ts/comma-dangle': ['warn', 'always-multiline'],
43+
'@/newline-per-chained-call': ['warn', {
44+
ignoreChainWithDepth: 2,
45+
}],
46+
},
47+
},
48+
)

package.json

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,34 @@
2020
"scripts": {
2121
"dev": "vite",
2222
"build": "vue-tsc && vite build",
23-
"lint": "eslint ./src --ext .vue,.ts --fix",
23+
"lint": "eslint ./src --fix",
2424
"test": "vitest run",
2525
"prepare": "node .husky/install.mjs"
2626
},
2727
"lint-staged": {
28-
"*.{ts,vue}": "eslint --fix"
28+
"*.{ts,vue}": "eslint ./src --fix"
2929
},
3030
"dependencies": {
31-
"vue": "^3.3.8"
31+
"vue": "^3.5.13"
3232
},
3333
"devDependencies": {
34-
"@types/node": "^20.9.0",
35-
"@typescript-eslint/eslint-plugin": "^7.0.0",
36-
"@typescript-eslint/parser": "^7.1.0",
37-
"@vitejs/plugin-vue": "^5.0.4",
38-
"@vue/test-utils": "^2.4.1",
34+
"@stylistic/eslint-plugin-ts": "^2.11.0",
35+
"@types/node": "^20.17.9",
36+
"@typescript-eslint/eslint-plugin": "^8.16.0",
37+
"@typescript-eslint/parser": "^8.16.0",
38+
"@vitejs/plugin-vue": "^5.2.1",
39+
"@vue/test-utils": "^2.4.6",
3940
"@vue/tsconfig": "^0.5.1",
40-
"eslint": "^8.53.0",
41-
"eslint-plugin-vue": "^9.18.1",
42-
"husky": "^9.1.6",
43-
"jsdom": "^24.0.0",
41+
"eslint": "^8.57.1",
42+
"eslint-plugin-vue": "^9.32.0",
43+
"husky": "^9.1.7",
44+
"jsdom": "^25.0.1",
4445
"lint-staged": "^15.2.10",
45-
"typescript": "^5.2.2",
46-
"vite": "^5.1.4",
47-
"vite-plugin-dts": "^3.6.3",
48-
"vitest": "^1.3.1",
49-
"vue-eslint-parser": "^9.3.2",
50-
"vue-tsc": "^1.8.22"
46+
"typescript": "5.6.2",
47+
"vite": "^5.4.11",
48+
"vite-plugin-dts": "^3.9.1",
49+
"vitest": "^1.6.0",
50+
"vue-eslint-parser": "^9.4.3",
51+
"vue-tsc": "2.0.29"
5152
}
5253
}

src/composables/useSmartCaptcha.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,9 @@ export const useSmartCaptcha = (container: CaptchaContainer, renderProps?: Rende
117117
const isSmartCaptchaLoaded = setInterval(() => {
118118
let attempt = 0
119119
if (++attempt === totalAttempts) {
120-
/* eslint-disable no-console */
121120
console.warn(
122-
`Captcha cannot be initialized for ${timeout}ms. Make sure widget script is loaded`
121+
`The captcha could not be initialized in ${timeout}ms. Make sure the widget script has been loaded`,
123122
)
124-
/* eslint-enable no-console */
125123

126124
clearInterval(isSmartCaptchaLoaded)
127125
return

src/types/smartcaptcha.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export interface SmartCaptchaRenderProps {
4747

4848
export type BaseEventCallback = () => void
4949
export type SuccessEventCallback = (token: Token) => void
50-
export type JavascriptError = { filename: string, message: string, col: number, line: number }
50+
export interface JavascriptError { filename: string, message: string, col: number, line: number }
5151
export type JavascriptErrorEventCallback = (error: JavascriptError) => void
5252
export type CaptchaSubscriptionEventCallback = BaseEventCallback | SuccessEventCallback | JavascriptErrorEventCallback
5353

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export default defineConfig({
3131
rollupOptions: {
3232
external: ['vue'],
3333
output: {
34+
exports: 'named',
3435
globals: {
3536
vue: 'Vue',
3637
},

0 commit comments

Comments
 (0)