Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
LarchLiu committed May 5, 2023
1 parent d27030e commit 6a43285
Show file tree
Hide file tree
Showing 17 changed files with 294 additions and 175 deletions.
6 changes: 5 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
dist
extension
local
node_modules
test/fixtures*
*.d.ts
.next
.turbo
1 change: 0 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ jobs:
- run: npx changelogithub # or changelogithub@0.12 if ensure the stable result
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,3 @@ jobs:
VITE_NOTION_API_KEY: ${{secrets.VITE_NOTION_API_KEY}}
VITE_NOTION_DATABASE_ID: ${{secrets.VITE_NOTION_DATABASE_ID}}
VITE_STAR_NEXUS_HUB_API: ${{secrets.VITE_STAR_NEXUS_HUB_API}}

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,5 @@ yarn-error.log*

# turbo
.turbo

.eslintcache
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"test": "vitest run",
"test:core": "turbo run test --filter=@starnexus/core",
"tscheck": "turbo run tscheck",
"lint": "turbo run lint",
"lint": "eslint --cache .",
"lint:fix": "turbo run lint -- --fix",
"up": "taze major -r",
"up:w": "taze major -r -w"
},
Expand All @@ -41,12 +42,22 @@
"@unocss/eslint-config": "^0.51.4",
"bumpp": "^9.1.0",
"eslint": "^8.39.0",
"lint-staged": "^13.2.2",
"rimraf": "^5.0.0",
"simple-git-hooks": "^2.8.1",
"taze": "^0.10.1",
"turbo": "^1.9.3",
"typescript": "^5.0.3",
"vite": "^4.3.1",
"vitest": "^0.30.1",
"vue-tsc": "^1.6.3"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
},
"lint-staged": {
"*.{js,ts,tsx,vue,md}": [
"eslint --cache --fix"
]
}
}
61 changes: 0 additions & 61 deletions packages/chrome-extension/scripts/hot-reload/background.ts

This file was deleted.

37 changes: 0 additions & 37 deletions packages/chrome-extension/scripts/hot-reload/content.ts

This file was deleted.

62 changes: 0 additions & 62 deletions packages/chrome-extension/scripts/hot-reload/injectCode.js

This file was deleted.

2 changes: 1 addition & 1 deletion packages/chrome-extension/scripts/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ async function copyIndexHtml() {
data = data.replace(/\.ts/g, '.js')
await fs.writeFile(r(`${outputDir}/${view}/index.html`), data, 'utf-8')
}
console.log('复制html文件成功')
// console.log('复制html文件成功')
}
function copyAssets() {
fs.copy(origin.assets, target.assets)
Expand Down
2 changes: 1 addition & 1 deletion packages/chrome-extension/src/popup/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ function animateButton() {
saveBtn.value?.classList.remove('star-animate')
saveBtn.value?.classList.remove('bubbly-animate')
saveBtn.value?.classList.add('star-animate')
starTimer = setTimeout(() => {
saveBtn.value?.classList.add('bubbly-animate')
bubblyTimer = setTimeout(() => {
Expand Down
2 changes: 0 additions & 2 deletions packages/chrome-extension/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import Unocss from 'unocss/vite'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import hotReloadBackground from './scripts/hot-reload/background'
import { __DEV__, outputDir } from './const'

export function r(...args: string[]) {
Expand Down Expand Up @@ -64,6 +63,5 @@ export default defineConfig({
resolvers: [ElementPlusResolver()],
dts: 'popup/components.d.ts',
}),
hotReloadBackground(),
],
})
2 changes: 0 additions & 2 deletions packages/chrome-extension/vite.content.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import { commonConfig, plugins, r } from './vite.config'
import { __DEV__, outputDir } from './const'
import hotReloadContent from './scripts/hot-reload/content'

// bundling the content script
export default defineConfig({
Expand Down Expand Up @@ -46,6 +45,5 @@ export default defineConfig({
resolvers: [ElementPlusResolver()],
dts: 'contentScript/components.d.ts',
}),
hotReloadContent(),
],
})
2 changes: 1 addition & 1 deletion packages/core/src/openai/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { FetchOpenai, PromptsLanguage, WebsiteInfo } from '../types'
import { countWord, fetchPost, getPromptsByTemplate, preprocessText } from '../utils'
import { ANSWER_IN_LANGUAGE, MAX_TOKEN_LENGTH, OPENAI_CHAT_API, SUMMARIZE_PROMPTS, USER_PROMPTS } from '../const'

async function summarizeContent(apiKey: string, websiteInfo: WebsiteInfo, language: PromptsLanguage = 'en'): Promise<FetchOpenai> {
async function summarizeContent(apiKey: string, websiteInfo: WebsiteInfo, language: PromptsLanguage = 'zh-CN'): Promise<FetchOpenai> {
try {
let summary = ''
let category = ''
Expand Down
Loading

0 comments on commit 6a43285

Please sign in to comment.