瀏覽代碼

refactor: Enable eslint cache

Owen Diffey 1 年之前
父節點
當前提交
1542d4131a
共有 4 個文件被更改,包括 7 次插入6 次删除
  1. 1 0
      .gitignore
  2. 1 1
      backend/package.json
  3. 1 1
      frontend/package.json
  4. 4 4
      musare.sh

+ 1 - 0
.gitignore

@@ -33,6 +33,7 @@ frontend/dist/config/default.json
 npm
 node_modules
 package-lock.json
+.eslintcache
 
 # Logs
 log/

+ 1 - 1
backend/package.json

@@ -12,7 +12,7 @@
     "dev": "nodemon --es-module-specifier-resolution=node",
     "docker:dev": "nodemon --es-module-specifier-resolution=node --legacy-watch --no-stdin /opt/app",
     "docker:prod": "node --es-module-specifier-resolution=node /opt/app",
-    "lint": "npx eslint logic"
+    "lint": "npx eslint --cache logic"
   },
   "dependencies": {
     "async": "^3.2.3",

+ 1 - 1
frontend/package.json

@@ -12,7 +12,7 @@
   "license": "GPL-3.0",
   "repository": "https://github.com/Musare/Musare",
   "scripts": {
-    "lint": "npx eslint src --ext .js,.vue",
+    "lint": "npx eslint --cache src --ext .js,.vue",
     "dev": "npx vite",
     "prod": "npx vite build --emptyOutDir"
   },

+ 4 - 4
musare.sh

@@ -254,11 +254,11 @@ case $1 in
         fi
         case $2 in
             frontend)
-                ${dockerCompose} exec -T frontend npx eslint src --ext .js,.vue $fix
+                ${dockerCompose} exec -T frontend npx eslint --cache src --ext .js,.vue $fix
                 exitValue=$?
                 ;;
             backend)
-                ${dockerCompose} exec -T backend npx eslint logic $fix
+                ${dockerCompose} exec -T backend npx eslint --cache logic $fix
                 exitValue=$?
                 ;;
             docs)
@@ -266,9 +266,9 @@ case $1 in
                 exitValue=$?
                 ;;
             ""|fix|--fix)
-                ${dockerCompose} exec -T frontend npx eslint src --ext .js,.vue $fix
+                ${dockerCompose} exec -T frontend npx eslint --cache src --ext .js,.vue $fix
                 frontendExitValue=$?
-                ${dockerCompose} exec -T backend npx eslint logic $fix
+                ${dockerCompose} exec -T backend npx eslint --cache logic $fix
                 backendExitValue=$?
                 ${docker} run -v "${scriptLocation}":/workdir ghcr.io/igorshubovych/markdownlint-cli:latest ".wiki" "*.md" $fix
                 docsExitValue=$?