From e020efbecf7e46ff204a92fd9272bae7cbf4a46c Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Mon, 10 Jan 2022 23:40:51 +0100 Subject: eslint: Add support for *.mjs files --- .eslintrc.json | 28 +++++++++++++++++++++------- .pre-commit-config.yaml | 2 ++ 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 1c77f95525..84911dce95 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -62,11 +62,25 @@ "yoda": "warn" }, "globals": { - "console": "writable", - "svg": "writable", - "HIDController": "writable", - "HIDDebug": "writable", - "HIDPacket": "writable", - "controller": "writable" - } + "console": "readable" + }, + "overrides": [ + { + "files": ["**/*.mjs"], + "parserOptions": { + "sourceType": "module" + } + }, + { + "files": ["res/controllers/*.js"], + "globals": { + "console": "readable", + "svg": "writable", + "HIDController": "writable", + "HIDDebug": "writable", + "HIDPacket": "writable", + "controller": "writable" + } + } + ] } diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2b52d0fac2..468bfbaf32 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -67,6 +67,8 @@ repos: hooks: - id: eslint args: [--fix, --report-unused-disable-directives] + files: \.m?js$ + types: [file] stages: - commit - manual -- cgit v1.2.3