Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui/eslint): add eslint plugin for artalk ui development #995

Merged
merged 8 commits into from
Oct 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,12 @@ jobs:
- name: Package Build Test
run: pnpm build:all

- name: Unit test
- name: Unit Test
run: pnpm test

- name: Plugins Build Test
run: pnpm build:plugins

- name: Lint
run: pnpm eslint ui && pnpm prettier --check ui

Expand Down
8 changes: 3 additions & 5 deletions docs/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,9 @@
},
"devDependencies": {
"artalk": "workspace:^",
"vitepress": "1.3.4"
},
"dependencies": {
"@artalk/plugin-katex": "^0.2.3",
"@artalk/plugin-lightbox": "^0.2.3",
"vitepress": "1.3.4",
"@artalk/plugin-katex": "^0.2.4",
"@artalk/plugin-lightbox": "^0.2.4",
"katex": "^0.16.11",
"lightgallery": "^2.7.2",
"vue": "^3.5.6"
Expand Down
6 changes: 2 additions & 4 deletions docs/landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,12 @@
"preview": "vite preview",
"update:readme": "npx tsx ./scripts/update-readme.ts"
},
"dependencies": {
"devDependencies": {
"include-media": "^2.0.0",
"normalize.css": "^8.0.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-icons": "5.3.0"
},
"devDependencies": {
"react-icons": "5.3.0",
"@headlessui/react": "^2.1.8",
"@types/react": "^18.3.7",
"@types/react-dom": "^18.3.0",
Expand Down
3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import pluginVue from 'eslint-plugin-vue'
import globals from 'globals'
import eslintTs from 'typescript-eslint'
import vueParser from 'vue-eslint-parser'
import pluginArtalk from 'eslint-plugin-artalk'

const __dirname = path.dirname(url.fileURLToPath(import.meta.url))
const tsProjects = ['./tsconfig.base.json', './ui/*/tsconfig.json', './docs/*/tsconfig.json']
Expand Down Expand Up @@ -65,9 +66,11 @@ export default eslintTs.config(
plugins: {
'@typescript-eslint': pluginTS,
'import-x': pluginImportX,
artalk: pluginArtalk,
},
rules: {
...pluginImportX.configs.recommended.rules,
...pluginArtalk.configs.recommended.rules,
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-expressions': [
Expand Down
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@
"dev:landing": "pnpm -F=docs-landing dev",
"build": "pnpm -F artalk build",
"build:sidebar": "pnpm -F @artalk/artalk-sidebar build",
"build:plugin-kit": "pnpm -F @artalk/plugin-kit build",
"build:all": "pnpm build && pnpm build:sidebar",
"build:plugins": "pnpm -F @artalk/plugin-* build",
"build:auth": "pnpm -F @artalk/plugin-auth build",
"build:all": "pnpm build && pnpm build:sidebar && pnpm build:plugin-kit",
"build:plugin-kit": "pnpm -F @artalk/plugin-kit build",
"build:eslint-plugin": "pnpm -F eslint-plugin-artalk build",
"build:docs": "pnpm build && pnpm -F=docs-landing build && pnpm -F=docs-swagger swagger:build && pnpm -F=docs build:docs && pnpm patch:docs",
"patch:docs": "cp -rf docs/landing/dist/* docs/swagger/dist/* docs/docs/.vitepress/dist",
"lint:eslint": "eslint .",
Expand All @@ -22,6 +24,7 @@
"test": "pnpm -F artalk test"
},
"devDependencies": {
"@artalk/plugin-kit": "^1.0.7",
"@eslint/compat": "^1.1.1",
"@eslint/js": "^9.10.0",
"@playwright/test": "^1.47.1",
Expand All @@ -33,6 +36,7 @@
"eslint": "^9.10.0",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript": "3.6.3",
"eslint-plugin-artalk": "^1.0.1",
"eslint-plugin-compat": "^6.0.1",
"eslint-plugin-import-x": "^4.2.1",
"eslint-plugin-react": "^7.36.1",
Expand Down
Loading