-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#187454781 Configure eslint and git pre-commit #9
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npm run precommit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"semi": true, | ||
"tabWidth": 2, | ||
"useTabs": true | ||
} |
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" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
const eslint = require("@eslint/js"); | ||
const tseslint = require("typescript-eslint"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz). |
||
|
||
module.exports = tseslint.config( | ||
{ | ||
ignores: ["**/__test__", "**/*.json"], | ||
}, | ||
eslint.configs.recommended, | ||
...tseslint.configs.recommended, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 'spread/rest operator' is only available in ES6 (use 'esversion: 6'). |
||
{ | ||
languageOptions: { | ||
parserOptions: { | ||
project: true, | ||
ecmaVersion: 2020, | ||
}, | ||
}, | ||
}, | ||
{ | ||
files: ["*.ts", "*.js"], | ||
...tseslint.configs.disableTypeChecked, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Expected ')' and instead saw 'tseslint'. |
||
}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unexpected '}'. |
||
{ | ||
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"], | ||
}, | ||
}, | ||
); |
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(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).