From 3e86f9605f552cfba2928e81e802953c62368581 Mon Sep 17 00:00:00 2001 From: Antonio Salazar Cardozo Date: Mon, 2 Aug 2021 15:42:37 -0400 Subject: [PATCH] Add linting pre-commit config This uses the pre-commit project, instructions for whose installation are coming for the README soon. --- .pre-commit-config.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000000..808289c46f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,25 @@ +repos: + - repo: local + hooks: + - id: lint-js + name: "lint typescript and javascript" + entry: /usr/bin/env npx eslint + files: '\.jsx?$|\.tsx?$' + language: script + description: "Checks JS/TS code according to the package's linter configuration" + - repo: local + hooks: + - id: lint-config + name: "lint config files" + entry: /usr/bin/env npx prettier -c + files: '\.json$|\.yaml$|\.toml$' + language: script + description: "Checks config files according to the package's linter configuration" + - repo: local + hooks: + - id: lint-docs + name: "lint documentation files" + entry: /usr/bin/env npx prettier -c + files: '\.md$' + language: script + description: "Checks documentation files according to the package's linter configuration"