Skip to content

Commit

Permalink
chore: upgrade to eslint@9
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanchenko committed Jan 30, 2025
1 parent 7a9cc35 commit 9c3f8e6
Show file tree
Hide file tree
Showing 22 changed files with 418 additions and 894 deletions.
14 changes: 0 additions & 14 deletions .eslintrc.json

This file was deleted.

2 changes: 1 addition & 1 deletion .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"*.{js,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
"*.{js,cjs,mjs,jsx,ts,tsx}": ["eslint --fix", "prettier --write"],
"*.{md,json}": ["prettier --write"]
}
1 change: 0 additions & 1 deletion dev/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable import/no-extraneous-dependencies */
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

Expand Down
42 changes: 42 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import globals from "globals";
import eslint from "@eslint/js";
import tseslint from "typescript-eslint";
import eslintPluginReact from "eslint-plugin-react";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import eslintPluginJsxA11y from "eslint-plugin-jsx-a11y";
import eslintConfigPrettier from "eslint-config-prettier";

export default tseslint.config(
{ ignores: ["coverage", "**/dist"] },
eslint.configs.recommended,
tseslint.configs.recommended,
eslintPluginReact.configs.flat.recommended,
// eslintPluginReact.configs.flat["jsx-runtime"],
eslintPluginJsxA11y.flatConfigs.recommended,
eslintConfigPrettier,
{
settings: { react: { version: "detect" } },
languageOptions: { globals: globals.browser },
plugins: { "react-hooks": eslintPluginReactHooks },
rules: {
"no-console": "error",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
...eslintPluginReactHooks.configs.recommended.rules,
},
},
{
files: ["fixup-dist.js"],
languageOptions: { globals: globals.node },
},
);
2 changes: 0 additions & 2 deletions fixup-dist.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable import/no-extraneous-dependencies */

import os from "os";
import fs from "fs";
import path from "path";
Expand Down
Loading

0 comments on commit 9c3f8e6

Please sign in to comment.