|
1 | | -import js from '@eslint/js' |
2 | | -import globals from 'globals' |
3 | | -import react from 'eslint-plugin-react' |
4 | | -import reactHooks from 'eslint-plugin-react-hooks' |
5 | | -import reactRefresh from 'eslint-plugin-react-refresh' |
6 | | -import tseslint from "@typescript-eslint/eslint-plugin" |
7 | | -import tsparser from "@typescript-eslint/parser" |
| 1 | +import eslint from "@eslint/js"; |
| 2 | +import { defineConfig, globalIgnores } from "eslint/config"; |
| 3 | +import tseslint from "typescript-eslint"; |
| 4 | +import react from "eslint-plugin-react"; |
| 5 | +import reactHooks from "eslint-plugin-react-hooks"; |
| 6 | +import reactRefresh from "eslint-plugin-react-refresh"; |
| 7 | +import globals from "globals"; |
| 8 | +// import prettierConfigRecommended from "eslint-plugin-prettier/recommended"; |
8 | 9 |
|
9 | | -export default [ |
| 10 | +export default defineConfig([ |
| 11 | + // prettierConfigRecommended, |
| 12 | + reactHooks.configs.flat.recommended, |
| 13 | + eslint.configs.recommended, |
| 14 | + tseslint.configs.recommended, |
| 15 | + globalIgnores(["dist/"]), |
| 16 | + react.configs.flat.recommended, |
| 17 | + react.configs.flat["jsx-runtime"], |
| 18 | + reactRefresh.configs.vite, |
| 19 | + { languageOptions: { globals: globals.node } }, |
| 20 | + { settings: { react: { version: "detect" } } }, |
10 | 21 | { |
11 | | - ignores: ['dist'], |
12 | | - files: ['**/*.{js,jsx,ts,tsx}'], |
13 | | - languageOptions: { |
14 | | - parser: tsparser, |
15 | | - ecmaVersion: 2020, |
16 | | - globals: globals.browser, |
17 | | - parserOptions: { |
18 | | - ecmaVersion: 'latest', |
19 | | - ecmaFeatures: {jsx: true}, |
20 | | - sourceType: 'module', |
21 | | - }, |
22 | | - }, |
23 | | - settings: {react: {version: 'detect'}}, |
24 | | - plugins: { |
25 | | - react, |
26 | | - 'react-hooks': reactHooks, |
27 | | - 'react-refresh': reactRefresh, |
28 | | - '@typescript-eslint': tseslint, |
29 | | - }, |
30 | | - // extends: [ |
31 | | - // "eslint:recommended", |
32 | | - // "next/core-web-vitals", |
33 | | - // "plugin:react/recommended", |
34 | | - // "standard-with-typescript", |
35 | | - // "plugin:@typescript-eslint/recommended", |
36 | | - // ], |
37 | 22 | rules: { |
38 | | - ...js.configs.recommended.rules, |
39 | | - ...react.configs.recommended.rules, |
40 | | - ...react.configs['jsx-runtime'].rules, |
41 | | - ...reactHooks.configs.recommended.rules, |
42 | | - ...tseslint.configs.recommended.rules, |
43 | | - '@typescript-eslint/no-unused-vars': 'error', |
44 | | - '@typescript-eslint/no-explicit-any': 'off', |
45 | | - 'no-unused-vars': 'off', |
46 | | - 'react/jsx-no-target-blank': 'off', |
47 | | - 'react-refresh/only-export-components': [ |
48 | | - 'warn', |
49 | | - {allowConstantExport: true}, |
50 | | - ], |
| 23 | + "@typescript-eslint/no-unused-vars": "error", |
| 24 | + "@typescript-eslint/no-explicit-any": "off", |
| 25 | + "no-unused-vars": "off", |
51 | 26 | }, |
52 | 27 | }, |
53 | | -] |
| 28 | +]); |
0 commit comments