From 5332aad8d6a784f6b4b52487510fcbc5877c7edd Mon Sep 17 00:00:00 2001 From: Matt Kramer Date: Mon, 9 May 2022 14:55:33 -0500 Subject: [PATCH] Add `pre-commit` config for `eslint` (#259) * Add eslint config Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- .pre-commit-config.yaml | 13 +++++++++++++ pyscriptjs/tsconfig.json | 4 +++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index aa5ad405..6ebffeb8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -62,3 +62,16 @@ repos: - id: pyupgrade args: - --py310-plus + +- repo: https://github.com/pre-commit/mirrors-eslint + rev: v8.4.0 + hooks: + - id: eslint + files: pyscriptjs/src/.*\.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx + types: [file] + additional_dependencies: + - eslint + - eslint-plugin-svelte3 + - typescript + - '@typescript-eslint/eslint-plugin' + - '@typescript-eslint/parser' diff --git a/pyscriptjs/tsconfig.json b/pyscriptjs/tsconfig.json index 91d60a8d..31509cef 100644 --- a/pyscriptjs/tsconfig.json +++ b/pyscriptjs/tsconfig.json @@ -1,5 +1,7 @@ { - "extends": "@tsconfig/svelte/tsconfig.json", + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Svelte", + "_version": "3.0.0", "include": ["src/**/*"], "exclude": ["node_modules/*", "__sapper__/*", "public/*"],