summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holthuis <jholthuis@mixxx.org>2022-01-10 23:40:51 +0100
committerJan Holthuis <jholthuis@mixxx.org>2022-01-10 23:55:02 +0100
commite020efbecf7e46ff204a92fd9272bae7cbf4a46c (patch)
treec48730cb430b718cbf01abdb0a2add8a4837a35e
parente5a00a7eb87a77e3f0c44098c1968d5e45b99981 (diff)
eslint: Add support for *.mjs files
-rw-r--r--.eslintrc.json28
-rw-r--r--.pre-commit-config.yaml2
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