Skip to content

Commit

Permalink
client: refactor plugins and bump eslint-config-joenn
Browse files Browse the repository at this point in the history
  • Loading branch information
wJoenn committed Apr 1, 2024
1 parent 373095c commit b09ca33
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 108 deletions.
88 changes: 0 additions & 88 deletions client/.vue/.eslintrc-auto-import.json

This file was deleted.

10 changes: 5 additions & 5 deletions client/.vue/eslint.components.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ export default {
rules: {
"vue/component-name-in-template-casing": ["error", "PascalCase", {
globals: [
"BaseButton",
"BaseContainer",
"BaseForm",
"KeepAlive",
"RouterLink",
"RouterView",
"Suspense",
"TaskTable",
"Teleport",
"Transition",
"TransitionGroup",
"BaseButton",
"BaseContainer",
"BaseForm",
"TaskTable"
"TransitionGroup"
]
}]
}
Expand Down
4 changes: 0 additions & 4 deletions client/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import fs from "fs"
import { vue } from "eslint-config-joenn"
import componentsConfig from "./.vue/eslint.components.config.js"

const autoImportConfig = JSON.parse(fs.readFileSync("./.vue/.eslintrc-auto-import.json"))

export default [
...vue,
componentsConfig,
{ languageOptions: autoImportConfig },
{
files: ["**/*.ts"],
ignores: ["src"],
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@vue/eslint-config-typescript": "^12.0.0",
"autoprefixer": "^10.4.17",
"eslint": "^8.57.0",
"eslint-config-joenn": "^0.2.9",
"eslint-config-joenn": "^0.2.10",
"sass": "^1.71.1",
"typescript": "^5.3.3",
"unplugin-auto-import": "^0.17.5",
Expand Down
4 changes: 0 additions & 4 deletions client/plugins/unplugin/autoImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ import { rootDir } from "."
const unpluginAutoImport = () => AutoImport({
dirs: [`${rootDir}/src/stores`, `${rootDir}/src/utils`],
dts: `${rootDir}/.vue/auto-import.d.ts`,
eslintrc: {
enabled: true,
filepath: `${rootDir}/.vue/.eslintrc-auto-import.json`
},
imports: [
"pinia",
"vue",
Expand Down
5 changes: 3 additions & 2 deletions client/plugins/unplugin/vueComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ const getComponents = (componentsDir = `${rootDir}/src/components/`): string[] =
const stat = fs.statSync(filePath)
return stat.isDirectory() ? getComponents(`${filePath}/`) : [file.replace(".vue", "")]
})
.sort()

const createEslintComponentsFile = () => {
const components = [...VUE_COMPONENTS, ...getComponents()].sort()

const eslintConfig = [
"/* eslint-disable */",
'import vue from "eslint-plugin-vue"',
Expand All @@ -34,7 +35,7 @@ const createEslintComponentsFile = () => {
" rules: {",
' "vue/component-name-in-template-casing": ["error", "PascalCase", {',
" globals: [",
VUE_COMPONENTS.concat(getComponents()).map(component => ` "${component}"`).join(",\n"),
components.map(component => ` "${component}"`).join(",\n"),
" ]",
" }]",
" }",
Expand Down
8 changes: 4 additions & 4 deletions client/pnpm-lock.yaml

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

0 comments on commit b09ca33

Please sign in to comment.