Skip to content

Commit

Permalink
Merge pull request #17 from gehuilherme/add-eslint
Browse files Browse the repository at this point in the history
Adiciona `ESLint` ao pipeline de CI
  • Loading branch information
gehuilherme authored Jul 20, 2024
2 parents 2a4fc87 + c189383 commit 5834d84
Show file tree
Hide file tree
Showing 8 changed files with 4,172 additions and 643 deletions.
8 changes: 8 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": [
"eslint:recommended",
"plugin:jest/recommended",
"prettier",
"next/core-web-vitals"
]
}
11 changes: 11 additions & 0 deletions .github/workflows/linting.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,14 @@ jobs:
node-version: "lts/hydrogen"
- run: npm ci
- run: npm run lint:prettier:check

eslint:
name: ESLint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "lts/hydrogen"
- run: npm ci
- run: npm run lint:eslint:check
4 changes: 3 additions & 1 deletion infra/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ async function getNewClient() {
return client;
}

export default {
const database = {
query,
getNewClient,
};

export default database;

function getSSLValues() {
// No .env, caso necessário utilizar um certificado auto-assinado, remover os caracteres de newline e substituir para \n (Ex. Banco de dados hospedado pela Digital Ocean).
if (process.env.POSTGRES_CA) {
Expand Down
1 change: 1 addition & 0 deletions infra/migrations/1720659613167_test-migrations.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-unused-vars */
/* eslint-disable camelcase */

exports.shorthands = undefined;
Expand Down
2 changes: 1 addition & 1 deletion infra/scripts/wait-for-postgres.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function checkPostgres() {
handleReturn,
);

function handleReturn(error, stdout, stderr) {
function handleReturn(error, stdout) {
if (stdout.search("accepting connections") === -1) {
process.stdout.write(".");
checkPostgres();
Expand Down
Loading

0 comments on commit 5834d84

Please sign in to comment.