chore: add tailwindcss eslint daisyUI config

This commit is contained in:
Asam
2023-06-26 17:40:28 +08:00
parent e2c7319868
commit 39a26df231
12 changed files with 999 additions and 18 deletions

View File

@@ -0,0 +1,19 @@
*.sh
*.md
*.woff
*.ttf
*.yaml
.vscode
.idea
node_modules
dist
public
docs
.husky
.eslintrc.js
# Allowlist 'test.js' in the '.build' folder
# But do not allow anything else in the '.build' folder to be linted
!.build
.build/*
!.build/test.js

View File

@@ -0,0 +1,24 @@
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
'eslint-config-prettier',
],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
sourceType: 'module',
},
plugins: ['vue', '@typescript-eslint', 'prettier'],
rules: {
indent: ['error', 2],
semi: ['error', 'always'],
},
};

View File

@@ -13,8 +13,7 @@ dist-ssr
*.local *.local
# Editor directories and files # Editor directories and files
.vscode/* .vscode
!.vscode/extensions.json
.idea .idea
.DS_Store .DS_Store
*.suo *.suo

View File

@@ -11,14 +11,25 @@
"vue": "^3.3.4" "vue": "^3.3.4"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^20.3.1",
"@typescript-eslint/eslint-plugin": "^5.60.0",
"@typescript-eslint/parser": "^5.60.0",
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^4.2.3",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
"daisyui": "^3.1.6",
"eslint": "^8.43.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.15.1",
"postcss": "^8.4.24", "postcss": "^8.4.24",
"postcss-import": "^15.1.0",
"prettier": "^2.8.8", "prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0", "prettier-plugin-tailwindcss": "^0.3.0",
"tailwindcss": "^3.3.2", "tailwindcss": "^3.3.2",
"typescript": "^5.1.3", "typescript": "^5.1.3",
"vite": "^4.3.9", "vite": "^4.3.9",
"vite-plugin-eslint": "^1.8.1",
"vue-eslint-parser": "^9.3.1",
"vue-tsc": "^1.8.1" "vue-tsc": "^1.8.1"
} }
} }

View File

@@ -1,5 +1,7 @@
export default { export default {
plugins: { plugins: {
'postcss-import': {},
'tailwindcss/nesting': {},
tailwindcss: {}, tailwindcss: {},
autoprefixer: {}, autoprefixer: {},
}, },

View File

@@ -0,0 +1 @@
@import './tailwindcss';

View File

@@ -1,5 +1,5 @@
import { createApp } from "vue"; import { createApp } from 'vue';
import "./style.css"; import './assets/styles/index.css';
import App from "./App.vue"; import App from './App.vue';
createApp(App).mount("#app"); createApp(App).mount('#app');

View File

@@ -1,8 +1,8 @@
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
export default { export default {
content: ["./index.html", "./src/**/*.{vue,js,ts,jsx,tsx}"], content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
theme: { theme: {
extend: {}, extend: {},
}, },
plugins: [], plugins: [require('daisyui')],
}; };

View File

@@ -1,5 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"baseUrl": ".",
"target": "ES2020", "target": "ES2020",
"useDefineForClassFields": true, "useDefineForClassFields": true,
"module": "ESNext", "module": "ESNext",
@@ -18,7 +19,15 @@
"strict": true, "strict": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"noFallthroughCasesInSwitch": true "noFallthroughCasesInSwitch": true,
/* types */
"types": ["vite/client"],
/* paths */
"paths": {
"@/*": ["src/*"]
}
}, },
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"],
"references": [{ "path": "./tsconfig.node.json" }] "references": [{ "path": "./tsconfig.node.json" }]

View File

@@ -1,7 +1,19 @@
import { defineConfig } from "vite"; import { defineConfig } from 'vite';
import vue from "@vitejs/plugin-vue"; import vue from '@vitejs/plugin-vue';
import eslintPlugin from 'vite-plugin-eslint';
import { resolve } from 'path';
const pathResolve = (path: string) => resolve(__dirname, path);
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [vue()], resolve: {
alias: [
{
find: '@',
replacement: pathResolve('src'),
},
],
},
plugins: [vue(), eslintPlugin()],
}); });

916
client/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff