|
| 1 | +import eslint from "@eslint/js"; |
| 2 | +import prettierPlugin from "eslint-plugin-prettier"; |
| 3 | +import unusedImportsPlugin from "eslint-plugin-unused-imports"; |
| 4 | +import prettierExtends from "eslint-config-prettier"; |
| 5 | +import { fixupPluginRules } from "@eslint/compat"; |
| 6 | +import globals from "globals"; |
| 7 | +import tseslint from "typescript-eslint"; |
| 8 | + |
| 9 | +const globalToUse = { |
| 10 | + ...globals.browser, |
| 11 | + ...globals.serviceworker, |
| 12 | + ...globals.es2021, |
| 13 | + ...globals.worker, |
| 14 | + ...globals.node, |
| 15 | +}; |
| 16 | + |
| 17 | +export default tseslint.config({ |
| 18 | + extends: [ |
| 19 | + { |
| 20 | + ignores: [ |
| 21 | + "client/cypress/plugins/index.js", |
| 22 | + ".lintstagedrc.js", |
| 23 | + ".next/**/*", |
| 24 | + "public/js/*", |
| 25 | + ".yarn/js/*", |
| 26 | + "ui/out/**/*", |
| 27 | + "apps/expo/ios/**/*", |
| 28 | + "apps/expo/android/**/*", |
| 29 | + "electron/build/**/*", |
| 30 | + "public/*.js", |
| 31 | + "public/*.map", |
| 32 | + ], |
| 33 | + }, |
| 34 | + prettierExtends, |
| 35 | + eslint.configs.recommended, |
| 36 | + ...tseslint.configs.recommended, |
| 37 | + ], |
| 38 | + settings: { |
| 39 | + react: { version: "detect" }, |
| 40 | + }, |
| 41 | + plugins: { |
| 42 | + prettierPlugin, |
| 43 | + "unused-imports": fixupPluginRules(unusedImportsPlugin), |
| 44 | + }, |
| 45 | + rules: { |
| 46 | + "prefer-rest-params": "off", |
| 47 | + "prefer-const": "error", |
| 48 | + "prefer-spread": "off", |
| 49 | + "no-case-declarations": "off", |
| 50 | + curly: ["error", "all"], |
| 51 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 52 | + "@typescript-eslint/consistent-type-definitions": ["error", "interface"], |
| 53 | + "@typescript-eslint/consistent-type-imports": [ |
| 54 | + "error", |
| 55 | + { |
| 56 | + prefer: "type-imports", |
| 57 | + }, |
| 58 | + ], |
| 59 | + "@typescript-eslint/ban-ts-comment": "off", |
| 60 | + "@typescript-eslint/no-explicit-any": "off", |
| 61 | + "@typescript-eslint/no-use-before-define": ["off"], |
| 62 | + "object-shorthand": "error", |
| 63 | + "@typescript-eslint/no-unused-vars": [ |
| 64 | + "warn", |
| 65 | + { varsIgnorePattern: "^_", argsIgnorePattern: "^_", ignoreRestSiblings: true }, |
| 66 | + ], |
| 67 | + "unused-imports/no-unused-imports": "error", |
| 68 | + }, |
| 69 | + languageOptions: { |
| 70 | + globals: globalToUse, |
| 71 | + parserOptions: { |
| 72 | + ecmaFeatures: { |
| 73 | + jsx: true, |
| 74 | + }, |
| 75 | + }, |
| 76 | + }, |
| 77 | +}); |
0 commit comments