From: mar77i Date: Sun, 20 Oct 2024 09:45:23 +0000 (+0200) Subject: add jslint and more fixes X-Git-Url: https://git.mar77i.info/?a=commitdiff_plain;h=47d07fdc21701d95d19a2dc5e1b43249c191557a;p=chat add jslint and more fixes --- diff --git a/.gitignore b/.gitignore index 7285869..78d5c6e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ chat/settings_local.py .coverage .idea/ +jslint.js __pycache__/ staticfiles venv/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8bc47c1..06d9357 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,3 +14,20 @@ repos: - id: ruff args: [ --fix, --extend-select, I ] - id: ruff-format +- repo: local + hooks: + - id: pyjslint + name: pyjslint + language: script + entry: pyjslint.py + files: "\\.js$" + args: [ + -o, "maxerr:20", + -o, "for:true", + -o, "devel:true", + -o, "browser:true", + -o, "this:true", + -g, _, + -g, WebSocket, + -j, jslint.js + ] diff --git a/chat/apps.py b/chat/apps.py index 580e57a..7bcedb3 100644 --- a/chat/apps.py +++ b/chat/apps.py @@ -6,6 +6,7 @@ from .utils import get_app_configs class ChatConfig(AppConfig): default_auto_field = "django.db.models.BigAutoField" + name = __module__[: -len(".apps")] @staticmethod def autodiscover_models(): diff --git a/chat/static/chat/chat.html b/chat/static/chat/chat.html index c546f24..891af21 100644 --- a/chat/static/chat/chat.html +++ b/chat/static/chat/chat.html @@ -13,6 +13,7 @@