From 7c668b985a983ecc48732b2ed2cbc2d803d2831b Mon Sep 17 00:00:00 2001 From: Minionguyjpro Date: Sat, 7 Jun 2025 18:04:53 +0200 Subject: [PATCH] Update and rename .eslintrc.yml to eslint.config.js --- .github/linters/.eslintrc.yml | 47 ------------------------- .github/linters/eslint.config.js | 59 ++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 47 deletions(-) delete mode 100644 .github/linters/.eslintrc.yml create mode 100644 .github/linters/eslint.config.js diff --git a/.github/linters/.eslintrc.yml b/.github/linters/.eslintrc.yml deleted file mode 100644 index 43c90e0..0000000 --- a/.github/linters/.eslintrc.yml +++ /dev/null @@ -1,47 +0,0 @@ -env: - es6: true - node: true - jest: true - -globals: - Atomics: readonly - SharedArrayBuffer: readonly - -ignorePatterns: - - '!.*' - - '**/node_modules/.*' - - '**/dist/.*' - - '**/coverage/.*' - - '*.json' - -parser: '@babel/eslint-parser' - -parserOptions: - ecmaVersion: 2023 - sourceType: module - requireConfigFile: false - babelOptions: - babelrc: false - configFile: false - presets: - - jest - -plugins: - - jest - -extends: - - eslint:recommended - - plugin:github/recommended - - plugin:jest/recommended - -rules: - camelcase: off - eslint-comments/no-use: off - eslint-comments/no-unused-disable: off - i18n-text/no-en: off - import/no-commonjs: error # Enforce ES modules only - import/no-namespace: off - no-console: off - no-unused-vars: off - prettier/prettier: error - semi: off diff --git a/.github/linters/eslint.config.js b/.github/linters/eslint.config.js new file mode 100644 index 0000000..9a2c4d4 --- /dev/null +++ b/.github/linters/eslint.config.js @@ -0,0 +1,59 @@ +import js from "@eslint/js"; +import github from "eslint-plugin-github"; +import jest from "eslint-plugin-jest"; +import babelParser from "@babel/eslint-parser"; +import prettier from "eslint-plugin-prettier"; + +// ESLint flat config expects an array of config objects +export default [ + { + files: ["**/*.js", "**/*.mjs", "**/*.cjs"], + ignores: [ + "!.*", + "**/node_modules/**", + "**/dist/**", + "**/coverage/**", + "*.json", + ], + languageOptions: { + ecmaVersion: 2023, + sourceType: "module", + globals: { + Atomics: "readonly", + SharedArrayBuffer: "readonly", + }, + parser: babelParser, + parserOptions: { + ecmaVersion: 2023, + sourceType: "module", + requireConfigFile: false, + babelOptions: { + babelrc: false, + configFile: false, + presets: ["jest"], + }, + }, + }, + plugins: { + github, + jest, + prettier, + }, + rules: { + camelcase: "off", + "eslint-comments/no-use": "off", + "eslint-comments/no-unused-disable": "off", + "i18n-text/no-en": "off", + "import/no-commonjs": "error", // Enforce ES modules only + "import/no-namespace": "off", + "no-console": "off", + "no-unused-vars": "off", + "prettier/prettier": "error", + semi: "off", + }, + settings: {}, + }, + js.configs.recommended, + github.configs.recommended, + jest.configs.recommended, +];