mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-19 18:13:41 -05:00
pre-commit: add tsc and eslint hooks
This commit is contained in:
parent
2b6c00fa04
commit
88919a2667
5 changed files with 28 additions and 1 deletions
|
@ -24,3 +24,16 @@ repos:
|
|||
rev: v0.3.1
|
||||
hooks:
|
||||
- id: prevent-literal-http-methods
|
||||
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: eslint
|
||||
name: eslint
|
||||
entry: .pre-commit-eslint.sh
|
||||
language: system
|
||||
types_or: [ts, tsx]
|
||||
- id: typescript
|
||||
name: typescript
|
||||
entry: .pre-commit-tsc.sh
|
||||
language: system
|
||||
types_or: [ts, tsx]
|
||||
|
|
6
.pre-commit-eslint.sh
Executable file
6
.pre-commit-eslint.sh
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
cd web > /dev/null
|
||||
if [[ -f "./node_modules/.bin/eslint" ]]; then
|
||||
ARGS=("$@")
|
||||
eslint ${ARGS[@]/#web\// }
|
||||
fi
|
5
.pre-commit-tsc.sh
Executable file
5
.pre-commit-tsc.sh
Executable file
|
@ -0,0 +1,5 @@
|
|||
#!/bin/bash
|
||||
cd web > /dev/null
|
||||
if [[ -f "./node_modules/.bin/tsc" ]]; then
|
||||
tsc --build --noEmit
|
||||
fi
|
|
@ -13,6 +13,9 @@ export default tseslint.config(
|
|||
languageOptions: {
|
||||
ecmaVersion: 2023,
|
||||
globals: globals.browser,
|
||||
parserOptions: {
|
||||
warnOnUnsupportedTypeScriptVersion: false,
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
"react-hooks": reactHooks,
|
||||
|
|
|
@ -189,7 +189,7 @@ export const sanitizeHtmlParams: sanitizeHtml.IOptions = {
|
|||
// custom ones first:
|
||||
font: ["color", "data-mx-bg-color", "data-mx-color", "style"], // custom to matrix
|
||||
span: [
|
||||
"data-mx-maths", "data-mx-bg-color", "data-mx-color", "data-mx-spoiler", "style", "title"
|
||||
"data-mx-maths", "data-mx-bg-color", "data-mx-color", "data-mx-spoiler", "style", "title",
|
||||
], // custom to matrix
|
||||
div: ["data-mx-maths"],
|
||||
// eslint-disable-next-line id-length
|
||||
|
|
Loading…
Add table
Reference in a new issue