Skip to content

Commit

Permalink
chore: bump eslint v9
Browse files Browse the repository at this point in the history
  • Loading branch information
JCaiDev committed Nov 7, 2024
1 parent 85cbb63 commit ebe646d
Show file tree
Hide file tree
Showing 4 changed files with 3,227 additions and 1,015 deletions.
26 changes: 0 additions & 26 deletions .eslintrc.cjs

This file was deleted.

64 changes: 64 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import { fixupConfigRules } from "@eslint/compat";
import reactRefresh from "eslint-plugin-react-refresh";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";
const GLOBALS_BROWSER_FIX = Object.assign({}, globals.browser, {
AudioWorkletGlobalScope: globals.browser["AudioWorkletGlobalScope "],
});
delete GLOBALS_BROWSER_FIX["AudioWorkletGlobalScope "];

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 [
{
ignores: ["**/dist", "**/.eslintrc.cjs"],
},
...fixupConfigRules(
compat.extends(
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react/recommended",
"plugin:react/jsx-runtime",
"plugin:react-hooks/recommended",
"prettier",
),
),
{
plugins: {
"react-refresh": reactRefresh,
},

languageOptions: {
globals: {
...GLOBALS_BROWSER_FIX,
},

parser: tsParser,
},

settings: {
react: {
version: "detect",
},
},

rules: {
"react-refresh/only-export-components": [
"warn",
{
allowConstantExport: true,
},
],
},
},
];
Loading

0 comments on commit ebe646d

Please sign in to comment.