-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from atlp-rwanda/feat-eslint-precommit-hook-187…
…419039 #187454781 Configure eslint and git pre-commit
- Loading branch information
Showing
36 changed files
with
11,539 additions
and
8,216 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,51 @@ | ||
# This workflow will install node dependencies, run tests and report coverage | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- feat-test-CI-implementation-187419042 | ||
- "*" | ||
- develop | ||
|
||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
DB_TEST_URL: ${{ secrets.DB_TEST_URL }} | ||
DEV_MODE: ${{ secrets.DEV_MODE }} | ||
DB_HOSTED_MODE: ${{ secrets.DB_HOSTED_MODE }} | ||
|
||
strategy: | ||
matrix: | ||
node-version: ["20.x"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run tests and build test coverage | ||
run: npm run test:ci | ||
|
||
- name: Test & publish code climate coverage | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
with: | ||
coverageCommand: npm run test:ci | ||
debug: true | ||
coverageLocations: | | ||
${{github.workspace}}/*.lcov:lcov | ||
# This workflow will install node dependencies, run tests and report coverage | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- feat-test-CI-implementation-187419042 | ||
- "*" | ||
- develop | ||
|
||
pull_request: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
env: | ||
DB_TEST_URL: ${{ secrets.DB_TEST_URL }} | ||
DEV_MODE: ${{ secrets.DEV_MODE }} | ||
DB_HOSTED_MODE: ${{ secrets.DB_HOSTED_MODE }} | ||
|
||
strategy: | ||
matrix: | ||
node-version: ["20.x"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: "npm" | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run tests and build test coverage | ||
run: npm run test:ci | ||
|
||
- name: Test & publish code climate coverage | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | ||
with: | ||
coverageCommand: npm run test:ci | ||
debug: true | ||
coverageLocations: | | ||
${{github.workspace}}/*.lcov:lcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run precommit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"semi": true, | ||
"tabWidth": 2, | ||
"useTabs": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"recommendations": [ | ||
"dbaeumer.vscode-eslint", | ||
"esbenp.prettier-vscode", | ||
"pkief.material-icon-theme", | ||
"ritwickdey.liveserver" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const eslint = require("@eslint/js"); | ||
const tseslint = require("typescript-eslint"); | ||
|
||
module.exports = tseslint.config( | ||
{ | ||
ignores: ["**/__test__", "**/*.json"], | ||
}, | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
project: true, | ||
ecmaVersion: 2020, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ["*.ts", "*.js"], | ||
...tseslint.configs.disableTypeChecked, | ||
}, | ||
{ | ||
files: ["*.test *.js"], | ||
rules: { | ||
"@typescript-eslint/no-unused-vars": 0, | ||
"@typescript-eslint/no-unsafe-call": 0, | ||
languageOptions: { | ||
globals: { | ||
it: "readonly", | ||
describe: "readonly", | ||
}, | ||
}, | ||
}, | ||
}, | ||
{ | ||
rules: { | ||
semi: "error", | ||
"@typescript-eslint/no-unused-vars": 2, | ||
"@typescript-eslint/no-explicit-any": 0, | ||
"@typescript-eslint/no-var-requires": 0, | ||
"no-shadow": [2, { allow: ["req", "res", "err"] }], | ||
"new-cap": 0, | ||
"one-var-declaration-per-line": 0, | ||
"consistent-return": 0, | ||
"no-param-reassign": 0, | ||
"comma-dangle": 0, | ||
"no-undef": 0, | ||
curly: ["error", "multi-line"], | ||
}, | ||
}, | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import dotenv from "dotenv"; | ||
dotenv.config(); | ||
import dotenv from "dotenv"; | ||
dotenv.config(); |
Oops, something went wrong.