|
1 | | -import js from "@eslint/js"; |
2 | 1 | import tseslint from "typescript-eslint"; |
3 | 2 | import pluginReactHooks from "eslint-plugin-react-hooks"; |
4 | 3 | import pluginReact from "eslint-plugin-react"; |
5 | 4 | import globals from "globals"; |
6 | 5 | import { config as baseConfig } from "./base.js"; |
7 | 6 |
|
8 | | -import { FlatCompat } from "@eslint/eslintrc"; |
9 | | -import path from "path"; |
10 | | -import { fileURLToPath } from "url"; |
11 | | - |
12 | | -// this could just be import.meta.dirname if we set minimun node to 20.11 |
13 | | -const __filename = fileURLToPath(import.meta.url); |
14 | | -const __dirname = path.dirname(__filename); |
15 | | - |
16 | | -const compat = new FlatCompat({ |
17 | | - baseDirectory: __dirname, |
18 | | -}); |
19 | | - |
20 | 7 | /** |
21 | 8 | * A custom ESLint configuration for libraries that use React. |
22 | 9 | * |
@@ -44,38 +31,4 @@ export const config = [ |
44 | 31 | "react/react-in-jsx-scope": "off", |
45 | 32 | }, |
46 | 33 | }, |
47 | | - |
48 | | - // additions |
49 | | - ...compat.extends("eslint-config-turbo"), |
50 | | - { |
51 | | - languageOptions: { |
52 | | - globals: { |
53 | | - ...globals.browser, |
54 | | - React: true, |
55 | | - }, |
56 | | - // IMPORTANT: This is given as an example, but must be repeated in each project. Cwd fails in editors. |
57 | | - parserOptions: { |
58 | | - project: true, |
59 | | - tsconfigRootDir: ".", |
60 | | - ecmaFeatures: { |
61 | | - jsx: true, |
62 | | - }, |
63 | | - }, |
64 | | - }, |
65 | | - // Force ESLint to detect .tsx files |
66 | | - files: ["**/*.ts?(x)", "**/*.js?(x)"], |
67 | | - }, |
68 | | - { |
69 | | - files: ["**/*.js?(x)", "**/*.mjs"], |
70 | | - ...tseslint.configs["flat/disable-type-checked"], |
71 | | - }, |
72 | | - { |
73 | | - ignores: [ |
74 | | - // Ignore dotfiles |
75 | | - ".*.js", |
76 | | - "node_modules/", |
77 | | - "dist/", |
78 | | - "*.config.*", |
79 | | - ], |
80 | | - }, |
81 | 34 | ]; |
0 commit comments