From 4113252f18154821b203f6964b9cf1d8e8debd14 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Thu, 4 Jun 2020 18:22:21 +0100 Subject: [PATCH] Tools: Build TypeScript in pre-commit to check for any error --- .eslintignore | 1 - .gitignore | 1 - lint-staged.config.js | 7 +++++++ package.json | 6 ------ 4 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 lint-staged.config.js diff --git a/.eslintignore b/.eslintignore index 7c4cf0b839..86a551e09b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -68,7 +68,6 @@ ElectronClient/gui/NoteEditor/NoteBody/AceEditor/styles/index.js ElectronClient/gui/NoteEditor/NoteBody/AceEditor/Toolbar.js ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/index.js ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/types.js -ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/useFocus.js ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/useListIdent.js ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/utils/useScroll.js diff --git a/.gitignore b/.gitignore index 5443587248..2297c54d0c 100644 --- a/.gitignore +++ b/.gitignore @@ -58,7 +58,6 @@ ElectronClient/gui/NoteEditor/NoteBody/AceEditor/styles/index.js ElectronClient/gui/NoteEditor/NoteBody/AceEditor/Toolbar.js ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/index.js ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/types.js -ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/useFocus.js ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/useListIdent.js ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.js ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/utils/useScroll.js diff --git a/lint-staged.config.js b/lint-staged.config.js new file mode 100644 index 0000000000..02f97b8058 --- /dev/null +++ b/lint-staged.config.js @@ -0,0 +1,7 @@ +module.exports = { + '**/*.ts?(x)': () => 'npm run build', + '*.{js,jsx,ts,tsx}': [ + 'npm run linter', + 'git add', + ], +}; diff --git a/package.json b/package.json index 352bd83246..8d1dbc1293 100644 --- a/package.json +++ b/package.json @@ -14,12 +14,6 @@ "pre-commit": "lint-staged" } }, - "lint-staged": { - "*.{js,jsx,ts,tsx}": [ - "npm run linter", - "git add" - ] - }, "repository": { "type": "git", "url": "git+https://github.com/laurent22/joplin.git"