mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
Fix precommit hook
This commit is contained in:
parent
60adf8eff3
commit
08e454724e
|
|
@ -26,7 +26,7 @@ module.exports = {
|
|||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": "tsconfig.json",
|
||||
"project": ["tsconfig.json", "tsconfig.eslint.json"],
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
|
|
|
|||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -13,3 +13,4 @@ tags
|
|||
compiler/*.js
|
||||
compiler/**/*.js
|
||||
.*.generated.ts
|
||||
.tmp/
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ otherfiles=$(cachedPrettierFiles)
|
|||
|
||||
# Check if any of the files are ugly or contain a console.log call
|
||||
consoleFiles=$(noisy $jsfiles)
|
||||
uglyFiles = "$(eslintUgly) $jsfiles"
|
||||
uglyFiles="$(eslintUgly $jsfiles)"
|
||||
if [ ! -n "$uglyFiles" ]; then
|
||||
uglyFiles="$(prettierUgly $otherfiles)"
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -33,12 +33,14 @@ eslintUgly() {
|
|||
local acc=""
|
||||
local IFS=$'\n'
|
||||
local tmpdir
|
||||
tmpdir=$(mktemp -d "eslint.XXXXXXXXX")
|
||||
|
||||
mkdir -p .tmp
|
||||
tmpdir=$(mktemp --tmpdir=".tmp/" -d "tslint.XXXXXXXXX")
|
||||
for jsfile in "$@"; do
|
||||
tmpfile="$tmpdir/$jsfile"
|
||||
mkdir -p "$(dirname "$tmpfile")"
|
||||
staged "$jsfile" > "$tmpfile"
|
||||
"$(yarn bin)/eslint" --quiet -o /dev/null "$tmpfile" || acc="$jsfile"$'\n'"$acc"
|
||||
"$(yarn bin)/eslint" --no-ignore --quiet -o /dev/null "$tmpfile" || acc="$jsfile"$'\n'"$acc"
|
||||
done
|
||||
rm -rf "$tmpdir"
|
||||
echo "$acc"
|
||||
|
|
|
|||
6
tsconfig.eslint.json
Normal file
6
tsconfig.eslint.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"include": [
|
||||
".tmp/**/*.ts"
|
||||
]
|
||||
}
|
||||
Loading…
Reference in a new issue