Skip to content

Commit

Permalink
chore: lint规则调整
Browse files Browse the repository at this point in the history
  • Loading branch information
ZvonimirSun committed Sep 2, 2024
1 parent d3a8605 commit 69c7b33
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 97 deletions.
14 changes: 9 additions & 5 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ export default antfu(
{
rules: {
'no-console': 'off',
'curly': 'off',
'eslint-comments/no-unlimited-disable': 'off',
'no-restricted-globals': 'off',
'ts/no-this-alias': 'off',
'unused-imports/no-unused-vars': 'off'
'unicorn/consistent-function-scoping': 'off',
'unused-imports/no-unused-vars': [
'error', {
argsIgnorePattern: '^_',
caughtErrors: 'none',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true
}
],
},
},
)
9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@vueuse/integrations": "^11.0.3",
"algoliasearch": "^4.24.0",
"ali-oss": "^6.21.0",
"ant-design-vue": "^3.2.20",
"ant-design-vue": "^4.2.3",
"axios": "^1.7.7",
"buffer": "^6.0.3",
"codemirror": "^6.0.1",
Expand Down Expand Up @@ -76,9 +76,6 @@
"devDependencies": {
"@algolia/client-search": "^4.24.0",
"@antfu/eslint-config": "^3.0.0",
"@babel/core": "^7.25.2",
"@babel/eslint-parser": "^7.25.1",
"@babel/preset-env": "^7.25.4",
"@iconify-json/fa-solid": "^1.2.0",
"@iconify-json/fa6-solid": "^1.2.0",
"@iconify-json/icon-park": "^1.2.0",
Expand All @@ -95,8 +92,6 @@
"@types/qrcode": "^1.5.5",
"@types/three": "^0.168.0",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^8.3.0",
"@typescript-eslint/parser": "^8.3.0",
"@unocss/eslint-plugin": "^0.62.3",
"@vite-pwa/assets-generator": "^0.2.4",
"@vitejs/plugin-vue": "^5.1.3",
Expand Down Expand Up @@ -137,7 +132,7 @@
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*": "eslint --fix"
"*": "eslint . --fix"
},
"babel": {
"presets": [
Expand Down
102 changes: 35 additions & 67 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/plugins/PiniaPersist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ interface PersistOptions<S> {

declare module 'pinia' {

// eslint-disable-next-line unused-imports/no-unused-vars
export interface DefineStoreOptionsBase<S extends StateTree, Store> {
persist?: boolean | PersistOptions<S>
}
}

// eslint-disable-next-line unused-imports/no-unused-vars
export interface PluginOptions<S extends StateTree = StateTree> {
name?: string
storeName?: string
Expand Down
1 change: 1 addition & 0 deletions src/plugins/PiniaSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface SyncOptions<S> {

declare module 'pinia' {

// eslint-disable-next-line unused-imports/no-unused-vars
export interface DefineStoreOptionsBase<S extends StateTree, Store> {
sync?: boolean | SyncOptions<S>
}
Expand Down
6 changes: 3 additions & 3 deletions src/tools/hashFile/hashFile.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { type AlgoNames, algos } from './hashFile.service'

const hashFile = (algo: AlgoNames, value: lib.WordArray) => algos[algo](value).toString()

self.addEventListener('message', (event) => {
globalThis.addEventListener('message', (event) => {
if (event.data && event.data.value && event.data.value instanceof File) {
const algos = (event.data.algos || ['MD5']) as AlgoNames[]
const reader = new FileReader()
Expand All @@ -14,11 +14,11 @@ self.addEventListener('message', (event) => {
for (const algo of algos) {
result[algo] = hashFile(algo, wordArray)

self.postMessage(result)
globalThis.postMessage(result)
}
}
}
else {
self.postMessage(null)
globalThis.postMessage(null)
}
})
4 changes: 2 additions & 2 deletions src/tools/hashText/hashText.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ function formatWithEncoding(words: lib.WordArray, encoding: Encoding) {

const hashText = (algo: AlgoNames, value: string, encoding: Encoding = 'Hex') => formatWithEncoding(algos[algo](value), encoding)

self.addEventListener('message', (event) => {
globalThis.addEventListener('message', (event) => {
if (event.data) {
const result = {} as { [key in AlgoNames]: string }
for (const algo of algoNames) {
result[algo] = hashText(algo, event.data.value, event.data.encoding)
}
self.postMessage(result)
globalThis.postMessage(result)
}
})
Loading

0 comments on commit 69c7b33

Please sign in to comment.