From bd1edbdc0a32f482e7d8aa6a8d84dd5cb0243782 Mon Sep 17 00:00:00 2001
From: Daniel Micay
Date: Mon, 8 Apr 2024 01:38:56 -0400
Subject: [PATCH] move to new eslint configuration format
---
.eslintrc.json | 18 ----------------
eslint.config.js | 22 +++++++++++++++++++
package.json | 3 ++-
static/build.html | 54 +++++++++++++++++++----------------------------
4 files changed, 46 insertions(+), 51 deletions(-)
delete mode 100644 .eslintrc.json
create mode 100644 eslint.config.js
diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index 9af32d61..00000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "env": {
- "browser": true,
- "es2022": true
- },
- "extends": "eslint:recommended",
- "parserOptions": {
- "ecmaVersion": 2022,
- "sourceType": "module"
- },
- "rules": {
- "indent": ["error", 4],
- "linebreak-style": ["error", "unix"],
- "quotes": ["error", "double"],
- "semi": ["error", "always"],
- "no-var": ["error"]
- }
-}
diff --git a/eslint.config.js b/eslint.config.js
new file mode 100644
index 00000000..f99de616
--- /dev/null
+++ b/eslint.config.js
@@ -0,0 +1,22 @@
+import js from "@eslint/js";
+import globals from "globals";
+
+export default [
+ js.configs.recommended,
+ {
+ languageOptions: {
+ globals: {
+ ...globals.browser
+ },
+ ecmaVersion: 2022,
+ sourceType: "module"
+ },
+ rules: {
+ indent: ["error", 4],
+ "linebreak-style": ["error", "unix"],
+ quotes: ["error", "double"],
+ semi: ["error", "always"],
+ "no-var": ["error"]
+ }
+ }
+];
diff --git a/package.json b/package.json
index edca6979..892d416d 100644
--- a/package.json
+++ b/package.json
@@ -7,5 +7,6 @@
"stylelint-config-standard": "^36.0.0",
"terser": "^5.30.3",
"vnu-jar": "^23.4.11"
- }
+ },
+ "type": "module"
}
diff --git a/static/build.html b/static/build.html
index 08e6c178..dcdbb175 100644
--- a/static/build.html
+++ b/static/build.html
@@ -1364,40 +1364,30 @@ rm android-cts-media-1.5.zip
declare variables, unless they are reassigned in which case they should be declared
with let
but never use var
as it is effectively broken. Try
to prefer loops with for..of
. JavaScript must pass verification with
- eslint
using the following .eslintrc.json
configuration:
+ eslint
using the following eslint.config.js
configuration:
- {
- "env": {
- "browser": true,
- "es2022": true
- },
- "extends": "eslint:recommended",
- "parserOptions": {
- "ecmaVersion": 2022,
- "sourceType": "module"
- },
- "rules": {
- "indent": [
- "error",
- 4
- ],
- "linebreak-style": [
- "error",
- "unix"
- ],
- "quotes": [
- "error",
- "double"
- ],
- "semi": [
- "error",
- "always"
- ],
- "no-var": [
- "error"
- ]
+ import js from "@eslint/js";
+import globals from "globals";
+
+export default [
+ js.configs.recommended,
+ {
+ languageOptions: {
+ globals: {
+ ...globals.browser
+ },
+ ecmaVersion: 2022,
+ sourceType: "module"
+ },
+ rules: {
+ indent: ["error", 4],
+ "linebreak-style": ["error", "unix"],
+ quotes: ["error", "double"],
+ semi: ["error", "always"],
+ "no-var": ["error"]
+ }
}
-}
+];
Cookies are only used for login sessions. Every cookie must have the
__Host
prefix to guarantee that it has the Secure