Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 0 additions & 48 deletions .eslintrc.json

This file was deleted.

100 changes: 100 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
import { defineConfig, globalIgnores } from "eslint/config";
import _import from "eslint-plugin-import";
import prettier from "eslint-plugin-prettier";
import { fixupPluginRules } from "@eslint/compat";
import globals from "globals";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});

export default defineConfig([
globalIgnores(["builds/**/*", "js/**/*", "tests/**/*", "eslint.config.mjs"]),
Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In ESLint flat config, global ignores should be specified using the ignores property in a configuration object, not as a function call. The correct format would be: { ignores: ["builds/**/*", "js/**/*", "tests/**/*", "eslint.config.mjs"] }

Suggested change
globalIgnores(["builds/**/*", "js/**/*", "tests/**/*", "eslint.config.mjs"]),
{ ignores: ["builds/**/*", "js/**/*", "tests/**/*", "eslint.config.mjs"] },

Copilot uses AI. Check for mistakes.
{
extends: compat.extends(
"eslint:recommended",
"plugin:prettier/recommended"
),

Copy link

Copilot AI Aug 6, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extends property is not valid in ESLint flat config. The compat.extends() result should be spread directly into the configuration array using the spread operator: ...compat.extends(...)

Suggested change
...compat.extends(
"eslint:recommended",
"plugin:prettier/recommended"
),
{

Copilot uses AI. Check for mistakes.
plugins: {
import: fixupPluginRules(_import),
prettier,
},

languageOptions: {
globals: {
...globals.browser,
...globals.node,
...globals.worker,
respecConfig: true,
},

ecmaVersion: 2023,
sourceType: "module",
},

rules: {
"import/extensions": [
"error",
"always",
{
ignorePackages: true,
},
],

"prettier/prettier": [
"error",
{
endOfLine: "auto",
},
],

"dot-notation": "error",
"eol-last": ["error", "always"],
indent: 0,
"no-console": 0,
"no-duplicate-imports": 2,
"no-eval": "error",
"no-implied-eval": "error",
"no-prototype-builtins": 0,

"no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
},
],

"no-var": 2,
"object-shorthand": 2,
"one-var": ["error", "never"],
"prefer-arrow-callback": 2,
"prefer-const": 2,
"prefer-template": 2,
quotes: 0,
"require-atomic-updates": 0,
semi: ["error", "always"],
"sort-imports": 2,

"spaced-comment": [
"error",
"always",
{
block: {
balanced: true,
},
},
],
},
},
]);
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"Robin Berjon"
],
"devDependencies": {
"@eslint/compat": "^1.3.1",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "^9.32.0",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^28.0.6",
"@rollup/plugin-node-resolve": "^16.0.1",
Expand All @@ -33,11 +36,12 @@
"chokidar": "^4.0.3",
"clean-css": "^5.3.3",
"epipebomb": "^1.0.0",
"eslint": "^8.57.1",
"eslint": "^9.32.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jasmine": "^4.2.2",
"eslint-plugin-prettier": "^5.5.3",
"globals": "^16.3.0",
"highlight.js": "^11.11.1",
"hyperhtml": "^2.34.2",
"idb": "^8.0.3",
Expand Down
Loading
Loading