- add eslint to vite

This commit is contained in:
Kamil Niemczycki 2023-08-06 00:15:25 +02:00
parent 62f05232d8
commit 70f63c8e9f
Signed by: kamilniemczycki
GPG Key ID: 04D4E2012F969213
3 changed files with 53 additions and 9 deletions

53
package-lock.json generated
View File

@ -27,7 +27,8 @@
}, },
"devDependencies": { "devDependencies": {
"eslint": "^8.29.0", "eslint": "^8.29.0",
"eslint-plugin-vue": "^9.8.0" "eslint-plugin-vue": "^9.8.0",
"vite-plugin-eslint": "^1.8.1"
} }
}, },
"node_modules/@aashutoshrathi/word-wrap": { "node_modules/@aashutoshrathi/word-wrap": {
@ -636,11 +637,23 @@
"node": ">= 8" "node": ">= 8"
} }
}, },
"node_modules/@rollup/pluginutils": {
"version": "4.2.1",
"resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-4.2.1.tgz",
"integrity": "sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==",
"dev": true,
"dependencies": {
"estree-walker": "^2.0.1",
"picomatch": "^2.2.2"
},
"engines": {
"node": ">= 8.0.0"
}
},
"node_modules/@types/eslint": { "node_modules/@types/eslint": {
"version": "8.44.1", "version": "8.44.1",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.1.tgz", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.1.tgz",
"integrity": "sha512-XpNDc4Z5Tb4x+SW1MriMVeIsMoONHCkWFMkR/aPJbzEsxqHy+4Glu/BqTdPrApfDeMaXbtNh6bseNgl5KaWrSg==", "integrity": "sha512-XpNDc4Z5Tb4x+SW1MriMVeIsMoONHCkWFMkR/aPJbzEsxqHy+4Glu/BqTdPrApfDeMaXbtNh6bseNgl5KaWrSg==",
"peer": true,
"dependencies": { "dependencies": {
"@types/estree": "*", "@types/estree": "*",
"@types/json-schema": "*" "@types/json-schema": "*"
@ -659,14 +672,12 @@
"node_modules/@types/estree": { "node_modules/@types/estree": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.1.tgz",
"integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==", "integrity": "sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA=="
"peer": true
}, },
"node_modules/@types/json-schema": { "node_modules/@types/json-schema": {
"version": "7.0.12", "version": "7.0.12",
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.12.tgz",
"integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA=="
"peer": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "20.4.5", "version": "20.4.5",
@ -3239,6 +3250,36 @@
} }
} }
}, },
"node_modules/vite-plugin-eslint": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/vite-plugin-eslint/-/vite-plugin-eslint-1.8.1.tgz",
"integrity": "sha512-PqdMf3Y2fLO9FsNPmMX+//2BF5SF8nEWspZdgl4kSt7UvHDRHVVfHvxsD7ULYzZrJDGRxR81Nq7TOFgwMnUang==",
"dev": true,
"dependencies": {
"@rollup/pluginutils": "^4.2.1",
"@types/eslint": "^8.4.5",
"rollup": "^2.77.2"
},
"peerDependencies": {
"eslint": ">=7",
"vite": ">=2"
}
},
"node_modules/vite-plugin-eslint/node_modules/rollup": {
"version": "2.79.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.1.tgz",
"integrity": "sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==",
"dev": true,
"bin": {
"rollup": "dist/bin/rollup"
},
"engines": {
"node": ">=10.0.0"
},
"optionalDependencies": {
"fsevents": "~2.3.2"
}
},
"node_modules/vue": { "node_modules/vue": {
"version": "3.3.4", "version": "3.3.4",
"resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz", "resolved": "https://registry.npmjs.org/vue/-/vue-3.3.4.tgz",

View File

@ -6,8 +6,8 @@
"dev": "vite", "dev": "vite",
"build": "vite build", "build": "vite build",
"preview": "vite preview", "preview": "vite preview",
"lint": "./node_modules/.bin/eslint src --ext .js,.vue", "lint": "eslint --ext .js,.vue --ignore-path .gitignore",
"lintf": "./node_modules/.bin/eslint src --ext .js,.vue --fix" "lintf": "eslint --ext .js,.vue --ignore-path .gitignore--fix"
}, },
"dependencies": { "dependencies": {
"@fortawesome/fontawesome-svg-core": "^6.4.0", "@fortawesome/fontawesome-svg-core": "^6.4.0",
@ -29,7 +29,8 @@
}, },
"devDependencies": { "devDependencies": {
"eslint": "^8.29.0", "eslint": "^8.29.0",
"eslint-plugin-vue": "^9.8.0" "eslint-plugin-vue": "^9.8.0",
"vite-plugin-eslint": "^1.8.1"
}, },
"eslintConfig": { "eslintConfig": {
"root": true, "root": true,

View File

@ -1,6 +1,7 @@
import { fileURLToPath, URL } from 'node:url'; import { fileURLToPath, URL } from 'node:url';
import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite'; import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite';
import vue from '@vitejs/plugin-vue'; import vue from '@vitejs/plugin-vue';
import eslint from 'vite-plugin-eslint';
export default defineConfig((mode) => { export default defineConfig((mode) => {
const env = loadEnv(mode, process.cwd(), ""); const env = loadEnv(mode, process.cwd(), "");
@ -15,6 +16,7 @@ export default defineConfig((mode) => {
plugins: [ plugins: [
vue(), vue(),
splitVendorChunkPlugin(), splitVendorChunkPlugin(),
eslint(),
], ],
resolve: { resolve: {
vue: 'vue/dist/vue.esm-bundler.js', vue: 'vue/dist/vue.esm-bundler.js',