Install ESLint and Prettier plugins

This commit is contained in:
Maciej Pędzich 2023-05-23 10:05:36 +02:00
parent 8ddb5a89c9
commit deb3d07612
4 changed files with 3006 additions and 23 deletions

View File

@ -1,14 +1,17 @@
module.exports = { module.exports = {
root: true, root: true,
env: { env: {
node: true, node: true
}, },
extends: [ extends: [
'plugin:vue/vue3-essential', 'plugin:vue/vue3-essential',
'eslint:recommended', 'eslint:recommended',
'@vue/eslint-config-typescript', '@vue/eslint-config-typescript',
'prettier'
], ],
plugins: ['prettier'],
rules: { rules: {
'vue/multi-word-component-names': 'off', 'vue/multi-word-component-names': 'off',
}, 'prettier/prettier': 'error'
} }
};

2982
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
{ {
"name": "racemash", "name": "racemash",
"version": "0.0.0", "version": "0.1.0",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "vue-tsc --noEmit && vite build", "build": "vue-tsc --noEmit && vite build",
"preview": "vite preview", "preview": "vite preview",
"lint": "eslint . --fix --ignore-path .gitignore" "lint": "eslint . --fix --ignore-path .gitignore",
"prettier-format": "prettier --config .prettierrc --ignore-path .gitignore --write \"./**/*.{vue,js,ts}\""
}, },
"dependencies": { "dependencies": {
"@mdi/font": "7.0.96", "@mdi/font": "7.0.96",
@ -22,9 +23,12 @@
"@vitejs/plugin-vue": "^3.2.0", "@vitejs/plugin-vue": "^3.2.0",
"@vue/eslint-config-typescript": "^11.0.0", "@vue/eslint-config-typescript": "^11.0.0",
"eslint": "^8.0.0", "eslint": "^8.0.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.0.0", "eslint-plugin-vue": "^9.0.0",
"typescript": "^5.0.0", "typescript": "^5.0.0",
"vite": "^4.2.0", "vite": "^4.2.0",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-vuetify": "^1.0.0", "vite-plugin-vuetify": "^1.0.0",
"vue-tsc": "^1.2.0" "vue-tsc": "^1.2.0"
} }

View File

@ -1,10 +1,11 @@
// Plugins // Plugins
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue';
import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify' import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify';
import eslint from 'vite-plugin-eslint';
// Utilities // Utilities
import { defineConfig } from 'vite' import { defineConfig } from 'vite';
import { fileURLToPath, URL } from 'node:url' import { fileURLToPath, URL } from 'node:url';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
@ -14,25 +15,18 @@ export default defineConfig({
}), }),
// https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin // https://github.com/vuetifyjs/vuetify-loader/tree/next/packages/vite-plugin
vuetify({ vuetify({
autoImport: true, autoImport: true
}), }),
eslint()
], ],
define: { 'process.env': {} }, define: { 'process.env': {} },
resolve: { resolve: {
alias: { alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)) '@': fileURLToPath(new URL('./src', import.meta.url))
}, },
extensions: [ extensions: ['.js', '.json', '.jsx', '.mjs', '.ts', '.tsx', '.vue']
'.js',
'.json',
'.jsx',
'.mjs',
'.ts',
'.tsx',
'.vue',
],
}, },
server: { server: {
port: 3000, port: 3000
}, }
}) });