]> git.joonet.de Git - adminer.git/commitdiff
JS: Add ESLint config
authorJakub Vrana <jakub@vrana.cz>
Thu, 20 Mar 2025 08:26:53 +0000 (09:26 +0100)
committerJakub Vrana <jakub@vrana.cz>
Thu, 20 Mar 2025 08:54:44 +0000 (09:54 +0100)
To use this: Create package.json and run:
npm install --save-dev eslint @eslint/js

eslint.config.mjs [new file with mode: 0644]

diff --git a/eslint.config.mjs b/eslint.config.mjs
new file mode 100644 (file)
index 0000000..0fe7889
--- /dev/null
@@ -0,0 +1,26 @@
+// prepend adminer/include/functions.js to adminer/include/editing.js and editor/include/editing.js, then delete
+
+import { globalIgnores } from "eslint/config";
+import js from "@eslint/js";
+import globals from "globals";
+
+export default [
+       globalIgnores(["externals/"]),
+       js.configs.recommended,
+       {
+               languageOptions: {
+                       globals: {
+                               ...globals.browser,
+                               jush: false, jushLinks: false,
+                               offlineMessage: false, thousandsSeparator: false, // include/design.inc.php
+                               indexColumns: false, // select.inc.php
+                               tablePos: false, em: false, // schema.inc.php
+                       }
+               },
+               rules: {
+                       "no-var": "error",
+                       "prefer-const": "error",
+                       "no-unused-vars": "off", //! we want this only on global level
+               },
+       },
+];