Include GramJs into pre-commit linter hook (#1211)

This commit is contained in:
Alexander Zinchuk 2021-07-07 18:38:31 +03:00
parent d41d87325d
commit 7fb57ac4d8
3 changed files with 5 additions and 6 deletions

View File

@ -1 +0,0 @@
src/lib/gramjs

View File

@ -11,7 +11,7 @@
"deploy:production": "npm run build:production && git add -A && git commit -a -m '[Build]' --no-verify && git push", "deploy:production": "npm run build:production && git add -A && git commit -a -m '[Build]' --no-verify && git push",
"inc_version": "echo $((`cat .patch-version` + 1)) > .patch-version && echo \"$(node -p -e \"require('./package.json').version.match(/^\\d+\\.\\d+/)[0]\").$(cat .patch-version)\"", "inc_version": "echo $((`cat .patch-version` + 1)) > .patch-version && echo \"$(node -p -e \"require('./package.json').version.match(/^\\d+\\.\\d+/)[0]\").$(cat .patch-version)\"",
"perf:serve": "APP_ENV=perf parcel src/index-perf.html", "perf:serve": "APP_ENV=perf parcel src/index-perf.html",
"lint": "eslint . --ext .ts,.tsx", "lint": "eslint . --ext .ts,.tsx --ignore-pattern src/lib/gramjs",
"lint:fix": "npm run lint -- --fix", "lint:fix": "npm run lint -- --fix",
"gramjs:tl": "node ./src/lib/gramjs/tl/generateModules.js", "gramjs:tl": "node ./src/lib/gramjs/tl/generateModules.js",
"gramjs:lint:fix": "eslint ./src/lib/gramjs --ignore-path=src/lib/gramjs/.eslintignore --fix", "gramjs:lint:fix": "eslint ./src/lib/gramjs --ignore-path=src/lib/gramjs/.eslintignore --fix",
@ -27,7 +27,7 @@
} }
}, },
"lint-staged": { "lint-staged": {
"*.{ts,tsx}": "eslint" "*.{ts,tsx,js}": "eslint"
}, },
"author": "Alexander Zinchuk (alexander@zinchuk.com)", "author": "Alexander Zinchuk (alexander@zinchuk.com)",
"license": "GPL-3.0-or-later", "license": "GPL-3.0-or-later",

View File

@ -1,8 +1,8 @@
const SELECTED_APPENDIX_BACKGROUND = 'rgba(255,255,255,1)'; const SELECTED_APPENDIX_BACKGROUND = Promise.resolve('rgba(255,255,255,1)');
export default async (src: string, isOwn: boolean, inSelectMode?: boolean, isSelected?: boolean) => { export default function getCustomAppendixBg(src: string, isOwn: boolean, inSelectMode?: boolean, isSelected?: boolean) {
return isSelected ? SELECTED_APPENDIX_BACKGROUND : getAppendixColorFromImage(src, isOwn); return isSelected ? SELECTED_APPENDIX_BACKGROUND : getAppendixColorFromImage(src, isOwn);
}; }
async function getAppendixColorFromImage(src: string, isOwn: boolean) { async function getAppendixColorFromImage(src: string, isOwn: boolean) {
const img = new Image(); const img = new Image();