|
| 1 | +import js from "@eslint/js"; |
| 2 | +import globals from "globals"; |
| 3 | +import tseslint from "typescript-eslint"; |
| 4 | + |
| 5 | +import importPlugin from "eslint-plugin-import"; |
| 6 | + |
| 7 | +export default tseslint.config( |
| 8 | + { |
| 9 | + ignores: ["dist"], |
| 10 | + }, |
| 11 | + { |
| 12 | + name: "default", |
| 13 | + extends: [js.configs.recommended, ...tseslint.configs.recommended], |
| 14 | + files: ["packages/**/src/**/*.ts"], |
| 15 | + languageOptions: { |
| 16 | + ecmaVersion: 2020, |
| 17 | + globals: globals.browser, |
| 18 | + }, |
| 19 | + plugins: { |
| 20 | + import: importPlugin, |
| 21 | + }, |
| 22 | + settings: { |
| 23 | + react: { |
| 24 | + version: "detect", |
| 25 | + }, |
| 26 | + }, |
| 27 | + rules: { |
| 28 | + camelcase: "off", |
| 29 | + semi: ["warn", "always"], |
| 30 | + eqeqeq: ["error", "smart"], |
| 31 | + "default-case": "off", |
| 32 | + "array-callback-return": "error", |
| 33 | + "arrow-body-style": "off", |
| 34 | + "comma-dangle": "off", |
| 35 | + "jsx-quotes": ["error", "prefer-single"], |
| 36 | + "linebreak-style": ["error", "unix"], |
| 37 | + "no-console": "off", |
| 38 | + "no-mixed-spaces-and-tabs": "warn", |
| 39 | + "no-self-compare": "error", |
| 40 | + "no-underscore-dangle": "off", |
| 41 | + "no-use-before-define": "off", |
| 42 | + "no-useless-concat": "error", |
| 43 | + "no-var": "error", |
| 44 | + "no-script-url": "error", |
| 45 | + "no-continue": "off", |
| 46 | + "object-shorthand": "warn", |
| 47 | + "prefer-const": "warn", |
| 48 | + "require-await": "off", |
| 49 | + "sort-imports": [ |
| 50 | + "error", |
| 51 | + { |
| 52 | + allowSeparatedGroups: true, |
| 53 | + ignoreCase: true, |
| 54 | + ignoreDeclarationSort: true, |
| 55 | + ignoreMemberSort: false, |
| 56 | + memberSyntaxSortOrder: ["none", "all", "multiple", "single"], |
| 57 | + }, |
| 58 | + ], |
| 59 | + "sort-keys": "off", |
| 60 | + "valid-typeof": "error", |
| 61 | + "max-classes-per-file": "off", |
| 62 | + "no-unused-expressions": "off", |
| 63 | + "import/prefer-default-export": "off", |
| 64 | + "import/extensions": "off", |
| 65 | + // "import/no-extraneous-dependencies": [ |
| 66 | + // "warn", |
| 67 | + // { |
| 68 | + // devDependencies: false, |
| 69 | + // optionalDependencies: false, |
| 70 | + // peerDependencies: false, |
| 71 | + // }, |
| 72 | + // ], |
| 73 | + "no-unused-vars": "off", |
| 74 | + "@typescript-eslint/no-unused-vars": [ |
| 75 | + "error", |
| 76 | + { |
| 77 | + args: "all", |
| 78 | + argsIgnorePattern: "^_", |
| 79 | + caughtErrors: "all", |
| 80 | + caughtErrorsIgnorePattern: "^_", |
| 81 | + destructuredArrayIgnorePattern: "^_", |
| 82 | + varsIgnorePattern: "^_", |
| 83 | + ignoreRestSiblings: true, |
| 84 | + }, |
| 85 | + ], |
| 86 | + "@typescript-eslint/no-unsafe-function-type": "error", |
| 87 | + "@typescript-eslint/no-wrapper-object-types": "error", |
| 88 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 89 | + "no-empty-function": "off", |
| 90 | + "@typescript-eslint/no-empty-function": "off", |
| 91 | + "@typescript-eslint/no-require-imports": "error", |
| 92 | + "@typescript-eslint/consistent-type-imports": "error", |
| 93 | + "@typescript-eslint/no-empty-object-type": "off", |
| 94 | + "@typescript-eslint/no-empty-generator-function": "off", |
| 95 | + "@typescript-eslint/no-explicit-any": "off", |
| 96 | + }, |
| 97 | + }, |
| 98 | +); |
0 commit comments