chore: add eslint + prettier

This commit is contained in:
Valentin Kaelin 2023-09-20 21:49:05 +02:00
parent 96d0c404b1
commit 20c69a3943
8 changed files with 4097 additions and 6 deletions

3
client-new/.eslintignore Normal file
View file

@ -0,0 +1,3 @@
dist
node_modules
*.html

13
client-new/.eslintrc.js Normal file
View file

@ -0,0 +1,13 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: ['plugin:vue/essential', 'eslint:recommended'],
parserOptions: {
parser: '@babel/eslint-parser',
},
rules: {
'vue/multi-word-component-names': 'off',
},
}

View file

@ -0,0 +1,3 @@
dist
node_modules
src/components/Global/SVGContainer.vue

11
client-new/.prettierrc Normal file
View file

@ -0,0 +1,11 @@
{
"trailingComma": "es5",
"semi": false,
"singleQuote": true,
"useTabs": false,
"quoteProps": "consistent",
"bracketSpacing": true,
"arrowParens": "always",
"printWidth": 100,
"endOfLine": "auto"
}

View file

@ -0,0 +1,14 @@
module.exports = {
presets: ['@babel/preset-env'],
plugins: [
function () {
return {
visitor: {
MetaProperty(path) {
path.replaceWithSourceString('process')
},
},
}
},
],
}

File diff suppressed because it is too large Load diff

View file

@ -5,16 +5,24 @@
"scripts": {
"dev": "vite",
"build": "vite build",
"preview": "vite preview --port 8080"
"preview": "vite preview --port 8080",
"lint": "eslint --ext .js,.ts,.jsx,.tsx,.vue --ignore-path .eslintignore .",
"format": "prettier --write \"**/*.{ts,tsx,js,css,vue}\" --ignore-path .prettierignore"
},
"devDependencies": {
"@babel/eslint-parser": "^7.22.15",
"@babel/preset-env": "^7.22.20",
"@tailwindcss/custom-forms": "^0.2.1",
"@vitejs/plugin-vue2": "^2.2.0",
"autoprefixer": "^10.4.15",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-vue": "^9.17.0",
"postcss": "^8.4.30",
"postcss-import": "^12.0.1",
"tailwindcss": "^1.9.6",
"vite": "^4.4.5"
"vite": "^4.4.5",
"vite-plugin-eslint": "^1.8.1"
},
"dependencies": {
"axios": "^1.5.0",

View file

@ -1,11 +1,12 @@
import path from 'path';
import path from 'path'
import eslint from 'vite-plugin-eslint'
import vue from '@vitejs/plugin-vue2'
export default {
esbuild: {
drop: ['console', 'debugger'],
},
plugins: [vue()],
plugins: [eslint(), vue()],
resolve: {
alias: {
'@/': `${path.resolve(__dirname, 'src')}/`,