Skip to content

Commit d084901

Browse files
committed
Add ESLint/Prettier setup and align code formatting
1 parent 4f04cfa commit d084901

17 files changed

Lines changed: 819 additions & 43 deletions

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
coverage
3+
package-lock.json
4+
prisma/migrations

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": true,
3+
"singleQuote": false,
4+
"trailingComma": "all",
5+
"printWidth": 100
6+
}

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ curl http://localhost:3000/users/me \
109109
- [X] Adicionar logs estruturados (pino) e correlation id via middleware.
110110
- [X] Configurar CI (GitHub Actions) com PostgreSQL e testes.
111111
- [X] Cobrir `AuthService` com testes unitários para cenários de erro e borda.
112-
- [ ] Adicionar lint e format (`eslint` + `prettier`) com checagem na CI.
113-
- [ ] Criar endpoints `/health` e `/ready` com verificação de banco.
112+
- [X] Adicionar lint e format (`eslint` + `prettier`) com checagem na CI.
113+
- [X] Criar endpoints `/health` e `/ready` com verificação de banco.
114114
- [ ] Publicar documentação OpenAPI/Swagger dos endpoints.
115115
- [ ] Persistir refresh token com hash no banco (evitar token em texto puro).
116116
- [ ] Migrar rate limit para store distribuído (Redis) visando escala horizontal.

eslint.config.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const js = require("@eslint/js");
2+
const globals = require("globals");
3+
const prettier = require("eslint-config-prettier");
4+
5+
module.exports = [
6+
{
7+
ignores: ["node_modules/**", "coverage/**", "prisma/migrations/**"],
8+
},
9+
js.configs.recommended,
10+
{
11+
files: ["**/*.js"],
12+
languageOptions: {
13+
ecmaVersion: "latest",
14+
sourceType: "commonjs",
15+
globals: {
16+
...globals.node,
17+
...globals.jest,
18+
},
19+
},
20+
rules: {
21+
"no-console": "off",
22+
"no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
23+
},
24+
},
25+
prettier,
26+
];

0 commit comments

Comments
 (0)