chenkl 4 years ago
parent
commit
90de448338
3 changed files with 10 additions and 29 deletions
  1. 0 21
      .ls-lint.yml
  2. 2 2
      lint-staged.config.js
  3. 8 6
      package.json

+ 0 - 21
.ls-lint.yml

@@ -1,21 +0,0 @@
-ls:
-  src/*:
-    .js: kebab-case | PascalCase
-    .vue: PascalCase | regex:^index
-    .ts: camelCase | PascalCase
-    .tsx: camelCase | PascalCase
-    .d.ts: kebab-case
-    .mock.ts: kebab-case
-    .data.ts: camelCase | kebab-case
-    .test-d.ts: kebab-case
-    .less: kebab-case | PascalCase
-    .spec.ts: camelCase | PascalCase
-
-ignore:
-  - node_modules
-  - .git
-  - .circleci
-  - .github
-  - .vscode
-  - dist
-  - .local

+ 2 - 2
lint-staged.config.js

@@ -4,5 +4,5 @@ module.exports = {
   'package.json': ['prettier --write'],
   '*.vue': ['prettier --write', 'stylelint --fix'],
   '*.{scss,less,styl,css,html}': ['stylelint --fix', 'prettier --write'],
-  '*.md': ['prettier --write'],
-};
+  '*.md': ['prettier --write']
+}

+ 8 - 6
package.json

@@ -4,7 +4,6 @@
   "private": true,
   "scripts": {
     "serve": "vue-cli-service serve",
-    "ls-lint": "npx ls-lint",
     "lint": "vue-cli-service lint",
     "build-dev:index": "cross-env PROJECT_NAME=index vue-cli-service build --mode development",
     "build-pro:index": "cross-env PROJECT_NAME=index vue-cli-service build",
@@ -90,10 +89,13 @@
     "template",
     "element-plus"
   ],
-  "husky": {
-    "hooks": {
-      "pre-commit": "lint-staged",
-      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
-    }
+  "gitHooks": {
+    "pre-commit": "lint-staged",
+    "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
+  },
+  "lint-staged": {
+    "*.{js,vue}": [
+      "vue-cli-service lint"
+    ]
   }
 }