Browse Source

chore: license-header in lint-staged (#711)

chenjiawei.inizio 4 months ago
parent
commit
2c44e32dde

+ 6 - 0
common/autoinstallers/rush-lint-staged/.lintstagedrc.js

@@ -9,6 +9,12 @@ const path = require('path');
 const fs = require('fs');
 
 module.exports = {
+  '**/*.{js,ts,tsx,jsx,mjs,cjs,scss,less,css,sh}': async files => {
+    return [
+      `rush license-header`,
+      `git add ${files.join(' ')}`,
+    ];
+  },
   '**/*.{ts,tsx,js,jsx,mjs}': async files => {
     const match = micromatch.not(files, [
       '**/common/_templates/!(_*)/**/(.)?*',

+ 0 - 1
common/git-hooks/pre-commit

@@ -11,5 +11,4 @@
 if [ "$PRE_LINT" != "1" ]; then
   node common/scripts/install-run-rush.js -q lint-staged || exit $?
   node common/scripts/install-run-rush.js check
-  node common/scripts/install-run-rush.js license-header
 fi