Browse Source

Maintenance: Add ESlint to CI and overcommit

Bola Ahmed Buari 3 years ago
parent
commit
9230942aba
4 changed files with 10 additions and 0 deletions
  1. 2 0
      .eslintignore
  2. 2 0
      .gitlab/ci/pre.yml
  3. 4 0
      .overcommit.yml
  4. 2 0
      script/build/cleanup.sh

+ 2 - 0
.eslintignore

@@ -1 +1,3 @@
 **/*{.,-}min.js
+# autogenerated file
+app/frontend/apps/mobile/graphql/api.ts

+ 2 - 0
.gitlab/ci/pre.yml

@@ -76,6 +76,8 @@
     - echo "Stylelint check..."
     - yarn install
     - yarn lint:css
+    - echo "ESLint check..."
+    - yarn lint
     - echo "Rubocop check..."
     - echo -e "\\e[0Ksection_start:`date +%s`:bundle_install[collapsed=true]\\r\\e[0Kbundle install"
     - bundle config set --local frozen 'true'

+ 4 - 0
.overcommit.yml

@@ -26,6 +26,10 @@ PreCommit:
     flags: ['generate', 'translation_catalog', '--check']
   Stylelint:
     enabled: true
+  EsLint:
+    required_executable: 'yarn'
+    enabled: true
+    command: ['yarn', 'lint']
 
 PostCheckout:
   ALL:

+ 2 - 0
script/build/cleanup.sh

@@ -20,9 +20,11 @@ rm -rf .rubocop
 rm .stylelintrc.json
 rm .eslintignore
 rm .eslintrc
+rm .eslintrc.js
 rm .rubocop.yml
 rm coffeelint.json
 rm .overcommit.yml
+rm .prettierrc.json
 
 # misc
 rm .codeclimate.yml