summaryrefslogtreecommitdiffstats
path: root/.eslintrc
diff options
context:
space:
mode:
authorsilverwind <me@silverwind.io>2020-04-13 15:02:31 +0200
committerGitHub <noreply@github.com>2020-04-13 16:02:31 +0300
commit27e3cddfbef533f783898800ac4abdd5a453b436 (patch)
tree1ba9f63c9fac2f06549a28e043c3669042cf9ced /.eslintrc
parentcc4da79fb6302f35dfe9e2d5af7cda384083b0af (diff)
downloadgitea-27e3cddfbef533f783898800ac4abdd5a453b436.tar.gz
gitea-27e3cddfbef533f783898800ac4abdd5a453b436.zip
Move syntax highlighting to web worker (#11017)
This should eliminate page freezes when loading big files/diff. `highlightBlock` is needed to preserve existing nodes when highlighting and for that, highlight.js needs access to the DOM API so I added a DOM implementation to make it work, which adds around 300kB to the output file size of the lazy-loaded `highlight.js`. Co-authored-by: Lauris BH <lauris@nix.lv>
Diffstat (limited to '.eslintrc')
-rw-r--r--.eslintrc7
1 files changed, 7 insertions, 0 deletions
diff --git a/.eslintrc b/.eslintrc
index 76e6f8c48d..8fd53d54a1 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -24,6 +24,13 @@ globals:
SimpleMDE: false
u2fApi: false
+overrides:
+ - files: ["web_src/**/*.worker.js"]
+ env:
+ worker: true
+ rules:
+ no-restricted-globals: [0]
+
rules:
arrow-body-style: [0]
arrow-parens: [2, always]