|
| 1 | +// This file is created via running `yarn dlx @eslint/migrate-config .eslintrc.json` on top of our old `.eslintrc.json` file |
| 2 | +import { fixupConfigRules, fixupPluginRules } from "@eslint/compat"; |
| 3 | +import prettier from "eslint-plugin-prettier"; |
| 4 | +import babelParser from "@babel/eslint-parser"; |
| 5 | +import path from "node:path"; |
| 6 | +import { fileURLToPath } from "node:url"; |
| 7 | +import js from "@eslint/js"; |
| 8 | +import { FlatCompat } from "@eslint/eslintrc"; |
| 9 | + |
| 10 | +const __filename = fileURLToPath(import.meta.url); |
| 11 | +const __dirname = path.dirname(__filename); |
| 12 | +const compat = new FlatCompat({ |
| 13 | + baseDirectory: __dirname, |
| 14 | + recommendedConfig: js.configs.recommended, |
| 15 | + allConfig: js.configs.all, |
| 16 | +}); |
| 17 | + |
| 18 | +export default [ |
| 19 | + ...fixupConfigRules( |
| 20 | + compat.extends("plugin:prettier/recommended", "react-app", "prettier"), |
| 21 | + ), |
| 22 | + { |
| 23 | + plugins: { |
| 24 | + prettier: fixupPluginRules(prettier), |
| 25 | + }, |
| 26 | + |
| 27 | + languageOptions: { |
| 28 | + parser: babelParser, |
| 29 | + ecmaVersion: 5, |
| 30 | + sourceType: "script", |
| 31 | + |
| 32 | + parserOptions: { |
| 33 | + requireConfigFile: false, |
| 34 | + |
| 35 | + babelOptions: { |
| 36 | + presets: ["@babel/preset-react"], |
| 37 | + }, |
| 38 | + }, |
| 39 | + }, |
| 40 | + |
| 41 | + rules: { |
| 42 | + "prettier/prettier": "error", |
| 43 | + "react/jsx-uses-react": "off", |
| 44 | + "react/react-in-jsx-scope": "off", |
| 45 | + }, |
| 46 | + }, |
| 47 | +]; |
0 commit comments