Add pre-commit hooks for eslint and ruff (#1817)

This commit is contained in:
Gabriel Luiz Freitas Almeida 2024-05-02 17:02:06 -03:00
commit 2eb2f3bec6
3 changed files with 114 additions and 1 deletions

24
.pre-commit-config.yaml Normal file
View file

@ -0,0 +1,24 @@
repos:
- repo: https://github.com/pre-commit/mirrors-eslint
rev: "96c6321"
hooks:
- id: eslint
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
types: [file]
additional_dependencies:
- eslint-plugin-prettier
- eslint-config-prettier
- prettier
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.2
hooks:
# Run the linter.
- id: ruff
# Python
files: \.py$
types: [file]
# Run the formatter.
- id: ruff-format
files: \.py$
types: [file]