From 66d93196086e6d0767f88ef29eb36815498855db Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 13 Dec 2024 02:17:01 +0200 Subject: [PATCH 1/8] Update .gitattributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index bdb0cab..1e78b8c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ # Auto detect text files and perform LF normalization -* text=auto +* text=auto eol=lf # Custom for Visual Studio *.cs diff=csharp From b19bbd8c3c3bff313d3ef9414c578c5028ee1c52 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 17:55:01 +0200 Subject: [PATCH 2/8] Delete codeql-analysis.yml [CodeQL code scanning] Drop advanced setup (codeql-analysis.yml) in favor of default setup --- .github/workflows/codeql-analysis.yml | 72 --------------------------- 1 file changed, 72 deletions(-) delete mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index 3e97f43..0000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,72 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: [ master ] - pull_request: - # The branches below must be a subset of the branches above - branches: [ master ] - schedule: - - cron: '23 10 * * 6' - -jobs: - analyze: - name: Analyze - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: [ 'javascript' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - # Initializes the CodeQL tools for scanning. - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - queries: +security-and-quality - - # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). - # If this step fails, then you should remove it and run the build manually (see below) - - name: Autobuild - uses: github/codeql-action/autobuild@v3 - - # â„šī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # âœī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - - #- run: | - # make bootstrap - # make release - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 From 313dc43be9a4241dc7a6b5d07647ec0d5fd72048 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 22:07:46 +0200 Subject: [PATCH 3/8] Drop .eslintignore Drop .eslintignore in favor of using the "ignores" property in "eslint.config.js" (flat config format)(flat config format) --- .eslintignore => .eslintignore [DEPRECATED] | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .eslintignore => .eslintignore [DEPRECATED] (100%) diff --git a/.eslintignore b/.eslintignore [DEPRECATED] similarity index 100% rename from .eslintignore rename to .eslintignore [DEPRECATED] From e3e80600506be714f8362642f45edc065869d6ff Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 22:08:45 +0200 Subject: [PATCH 4/8] Migrate to flat config format --- .eslintrc.json [DEPRECATED] | 61 ++++++++++ eslint.config.js | 208 +++++++++++++++++++++++++++++++++++ 2 files changed, 269 insertions(+) create mode 100644 .eslintrc.json [DEPRECATED] create mode 100644 eslint.config.js diff --git a/.eslintrc.json [DEPRECATED] b/.eslintrc.json [DEPRECATED] new file mode 100644 index 0000000..a34a4d6 --- /dev/null +++ b/.eslintrc.json [DEPRECATED] @@ -0,0 +1,61 @@ +{ + "root": true, + "env": { + "browser": true, + "es6": true, + "greasemonkey": true, + "jquery": true + }, + "parserOptions": { + "ecmaVersion": "latest", + "sourceType": "script", + "ecmaFeatures": { + "globalReturn ": true, + "impliedStrict": true + } + }, + "extends": [ + "eslint:recommended", + "plugin:css/recommended", + "plugin:jsonc/recommended-with-json", + "plugin:no-jquery/deprecated", + "plugin:regexp/recommended" + ], + "plugins": [ + "css", + "jsonc", + "no-jquery", + "regexp" + ], + "rules": { + "complexity": ["warn", 20], + "eqeqeq": "warn", + "func-style": "off", + "indent": ["warn","tab", { "ignoreComments": false, "SwitchCase": 1 } ], + "linebreak-style": ["warn","unix"], + "max-len": "off", + "max-statements-per-line": "off", + "new-cap": "off", + "no-alert": "warn", + "no-console": "warn", + "no-dupe-keys": "warn", + "no-extra-semi": "warn", + "no-inline-comments": "off", + "no-magic-numbers": "off", + "no-misleading-character-class": "warn", + "no-mixed-spaces-and-tabs": "warn", + "no-multiple-empty-lines": "off", + "no-tabs": "off", + "no-unused-labels": "warn", + "no-unused-vars": ["warn", {"vars": "all", "args": "after-used"}], + "no-useless-escape": "warn", + "padded-blocks": "off", + "quotes": ["warn", "single", { "allowTemplateLiterals": true }] , + "require-jsdoc": "off", + "require-unicode-regexp": "off", + "semi": ["warn","always"], + "space-before-function-paren": "off", + "unicode-bom": ["warn", "never"] + }, + "reportUnusedDisableDirectives": true +} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..d7f634b --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,208 @@ +/* eslint-disable @stylistic/js/quotes */ +/* eslint-disable @stylistic/js/indent */ + +// import * as cssPlugin from "eslint-plugin-css"; +import css from "@eslint/css"; +import eslintPluginJsonc from 'eslint-plugin-jsonc'; +import json from "@eslint/json"; +import noJquery from "eslint-plugin-no-jquery"; +import * as regexpPlugin from "eslint-plugin-regexp"; +import markdown from "@eslint/markdown"; +import globals from "globals"; +import js from "@eslint/js"; +import stylisticJs from "@stylistic/eslint-plugin-js"; + + +export default [ + { + files: ['**/*.js', '**/*.mjs'], + ...js.configs.recommended + }, + // cssPlugin.configs["flat/recommended"], + ...eslintPluginJsonc.configs['flat/recommended-with-jsonc'], + { + files: ['**/*.js', '**/*.mjs'], + ...regexpPlugin.configs["flat/recommended"], + }, + ...markdown.configs.recommended, + { + files: ["**/*.js"], + ignores: ["**/*.min.js"], + + plugins: { + "@stylistic/js": stylisticJs + }, + + linterOptions: { + reportUnusedDisableDirectives: true, + }, + + languageOptions: { + globals: { + ...globals.browser, + ...globals.greasemonkey, + ...globals.jquery, + }, + + ecmaVersion: "latest", + sourceType: "module", + + + parserOptions: { + ecmaFeatures: { + "globalReturn ": true, + impliedStrict: true, + }, + }, + }, + + rules: { + complexity: ["warn", 20], + eqeqeq: "warn", + "func-style": "off", + + "@stylistic/js/indent": ["warn", "tab", { + ignoreComments: false, + SwitchCase: 1, + }], + + "@stylistic/js/linebreak-style": ["warn", "unix"], + "@stylistic/js/max-len": "off", + "@stylistic/js/max-statements-per-line": "off", + "new-cap": "off", + "no-alert": "warn", + "no-console": "warn", + "no-dupe-keys": "warn", + "@stylistic/js/no-extra-semi": "warn", + "no-inline-comments": "off", + "no-magic-numbers": "off", + "no-misleading-character-class": "warn", + "@stylistic/js/no-mixed-spaces-and-tabs": "warn", + "@stylistic/js/no-multiple-empty-lines": "off", + "@stylistic/js/no-tabs": "off", + "no-unused-labels": "warn", + + "no-unused-vars": ["warn", { + vars: "all", + args: "after-used", + }], + + "no-useless-escape": "warn", + "@stylistic/js/padded-blocks": "off", + + "@stylistic/js/quotes": ["warn", "single", { + allowTemplateLiterals: true, + }], + + "require-jsdoc": "off", + "require-unicode-regexp": "off", + "@stylistic/js/semi": ["warn", "always"], + "@stylistic/js/space-before-function-paren": "off", + "unicode-bom": ["warn", "never"], + }, + + }, + + + // https://github.com/eslint/json#usage + { + plugins: { + json, + }, + }, + // lint JSON files // (from: https://github.com/eslint/json#recommended-configuration) + { + files: ["**/*.json"], + language: "json/json", + ...json.configs.recommended, + }, + + // lint JSON-C files + { + // files: ["**/*.jsonc"], + files: ["**/*.jsonc", ".vscode/*.json"], // https://github.com/eslint/json/pull/11 + language: "json/jsonc", + ...json.configs.recommended, + }, + + + + // https://github.com/eslint/markdown#configuring + { + // 1. Add the plugin + plugins: { + markdown + } + }, + + // https://www.npmjs.com/package/eslint-plugin-markdown + // https://eslint.org/docs/latest/use/configure/plugins + // https://github.com/eslint/json + { + // 2. Enable the Markdown processor for all .md files. + files: ["**/*.md"], + // files: ["**/*.md/*.js"], + // plugins: { + // markdown + // }, + processor: "markdown/markdown" + }, + { + // // 3. Optionally, customize the configuration ESLint uses for ```js + // // fenced code blocks inside .md files. + files: ["**/*.md/*.js"], + rules: { + // ... + + // 2. Disable other rules. + // "no-console": "off", + // "import/no-unresolved": "off" + } + }, + + + + + + + + + // https://eslint.org/blog/2025/02/eslint-css-support/ [NEW ADDITION 20/2/2025] + // + // lint css files + { + files: ["**/*.css"], + plugins: { + css, + }, + language: "css/css", + rules: { + "css/no-duplicate-imports": "error", + }, + }, + + + + + // https://eslint.org/docs/latest/use/configure/ignore + // https://eslint.org/docs/latest/use/configure/migration-guide#ignoring-files + { + // Note: there should be no other properties in this object + ignores: [ + + "node_modules/*", + "**/*.min.js", + "package-lock.json" + + ] + + } + + + + + + + + +]; \ No newline at end of file From 7af1130058bfe5a997276da477226845c313c4d6 Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 23:43:11 +0200 Subject: [PATCH 5/8] Update eslint.config.js --- eslint.config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eslint.config.js b/eslint.config.js index d7f634b..5b0a1aa 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -45,7 +45,8 @@ export default [ }, ecmaVersion: "latest", - sourceType: "module", + // sourceType: "module", + sourceType: "script", parserOptions: { From 8dbf3b1b942c44a12d0627ee81395438d1dbe1fe Mon Sep 17 00:00:00 2001 From: darkred Date: Thu, 6 Mar 2025 23:45:10 +0200 Subject: [PATCH 6/8] Revert "Update eslint.config.js" This reverts commit 7af1130058bfe5a997276da477226845c313c4d6. --- eslint.config.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index 5b0a1aa..d7f634b 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -45,8 +45,7 @@ export default [ }, ecmaVersion: "latest", - // sourceType: "module", - sourceType: "script", + sourceType: "module", parserOptions: { From b7fda557e6ab3ab3ef203cfea3e74b6a58a81b1c Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 7 Mar 2025 00:29:38 +0200 Subject: [PATCH 7/8] Update package.json --- package.json | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d678f81..36eeb6d 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,29 @@ { + "type": "module", "devDependencies": { - "eslint": "*", + "@biomejs/biome": "*", + "@eslint/config-inspector": "*", + "@eslint/css": "*", + "@eslint/eslintrc": "*", + "@eslint/js": "*", + "@eslint/json": "*", + "@eslint/markdown": "*", + "@eslint/migrate-config": "*", + "@stylistic/eslint-plugin": "*", + "@stylistic/eslint-plugin-js": "*", + "eslint": "^9.10.0", "eslint-plugin-css": "*", "eslint-plugin-es-x": "*", + "eslint-plugin-jsdoc": "*", "eslint-plugin-jsonc": "*", "eslint-plugin-no-jquery": "*", "eslint-plugin-regexp": "*", "eslint-plugin-userscripts": "*", - "eslint-plugin-yml": "*" + "eslint-plugin-yml": "*", + "globals": "*" + }, + "dependencies": { + "rescript": "*", + "turbo": "*" } } From 5137627e96d6e06cb0d13cc6ebdc5f4f9917cb0a Mon Sep 17 00:00:00 2001 From: darkred Date: Fri, 7 Mar 2025 00:34:49 +0200 Subject: [PATCH 8/8] Drop .eslintrc.js --- .eslintrc.js => .eslintrc.js [DEPRECATED] | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .eslintrc.js => .eslintrc.js [DEPRECATED] (100%) diff --git a/.eslintrc.js b/.eslintrc.js [DEPRECATED] similarity index 100% rename from .eslintrc.js rename to .eslintrc.js [DEPRECATED]