|
| 1 | +import xo from "eslint-config-xo"; |
| 2 | +import typescriptEslintParser from "@typescript-eslint/parser"; |
| 3 | +import eslint from '@eslint/js'; |
| 4 | +import tseslint from 'typescript-eslint'; |
| 5 | +import unicornPlugin from 'eslint-plugin-unicorn'; |
| 6 | + |
| 7 | +export default tseslint.config( |
| 8 | + eslint.configs.recommended, |
| 9 | + eslint.configs.recommended, |
| 10 | + ...tseslint.configs.recommendedTypeChecked, |
| 11 | + ...tseslint.configs.stylisticTypeChecked, |
| 12 | + unicornPlugin.configs.recommended, |
| 13 | + ...xo, |
| 14 | + { |
| 15 | + languageOptions: { |
| 16 | + parser: typescriptEslintParser, |
| 17 | + parserOptions: { |
| 18 | + project: "./tsconfig.json", |
| 19 | + }, |
| 20 | + }, |
| 21 | + rules: { |
| 22 | + "@stylistic/function-paren-newline": ["off"], |
| 23 | + "@stylistic/indent": ["error", 4], |
| 24 | + "@stylistic/indent-binary-ops": ["error", 4], |
| 25 | + "@stylistic/max-len": ["off"], |
| 26 | + "@stylistic/multiline-ternary": ["off"], |
| 27 | + "@stylistic/operator-linebreak": ["off"], |
| 28 | + "@typescript-eslint/no-misused-promises": ["error", { |
| 29 | + checksVoidReturn: false |
| 30 | + }], |
| 31 | + "@typescript-eslint/no-unsafe-assignment": ["off"], |
| 32 | + "@typescript-eslint/no-unsafe-call": ["off"], |
| 33 | + "@typescript-eslint/no-unsafe-enum-comparison": ["off"], |
| 34 | + "@typescript-eslint/consistent-type-definitions": ["error", |
| 35 | + "type" |
| 36 | + ], |
| 37 | + "@typescript-eslint/array-type": ["error", { |
| 38 | + default: "array-simple" |
| 39 | + }], |
| 40 | + "@typescript-eslint/naming-convention": ["error", |
| 41 | + { |
| 42 | + "selector": "variableLike", |
| 43 | + "format": ["camelCase"] |
| 44 | + }, |
| 45 | + { |
| 46 | + "selector": "variableLike", |
| 47 | + "format": null, |
| 48 | + "modifiers": ["unused"] |
| 49 | + }, |
| 50 | + { |
| 51 | + "format": ["camelCase", "UPPER_CASE"], |
| 52 | + "selector": "variable", |
| 53 | + "modifiers": ["const"] |
| 54 | + }, |
| 55 | + { |
| 56 | + "format": ["PascalCase"], |
| 57 | + "selector": "variable", |
| 58 | + "modifiers": ["const"], |
| 59 | + "filter": "Validation$|Zod$" |
| 60 | + } |
| 61 | + ], |
| 62 | + "@typescript-eslint/prefer-promise-reject-errors": "off", |
| 63 | + "@typescript-eslint/promise-function-async": "off", |
| 64 | + "@typescript-eslint/strict-boolean-expressions": ["error", |
| 65 | + { |
| 66 | + "allowString": false, |
| 67 | + "allowNumber": false, |
| 68 | + "allowNullableObject": false |
| 69 | + } |
| 70 | + ], |
| 71 | + "@typescript-eslint/triple-slash-reference": "off", |
| 72 | + "capitalized-comments": "off", |
| 73 | + "@stylistic/object-curly-newline": ["error", { |
| 74 | + "ImportDeclaration": "never" |
| 75 | + }], |
| 76 | + "n/file-extension-in-import": "off", |
| 77 | + "promise-function-async": "off", |
| 78 | + "camelcase": "off", |
| 79 | + "default-case": "off", |
| 80 | + "import/extensions": "off", |
| 81 | + "import/no-unassigned-import": "off", |
| 82 | + "no-dupe-class-members": "off", |
| 83 | + "no-negated-condition": "off", |
| 84 | + "no-redeclare": "off", |
| 85 | + "no-unused-vars": "off", |
| 86 | + "no-useless-constructor": "off", |
| 87 | + "no-void": ["error", { |
| 88 | + allowAsStatement: true |
| 89 | + }], |
| 90 | + "no-warning-comments": "off", |
| 91 | + "prefer-promise-reject-errors": "off", |
| 92 | + "unicorn/consistent-function-scoping": "off", |
| 93 | + "unicorn/explicit-length-check": "off", |
| 94 | + "unicorn/filename-case": "off", |
| 95 | + "unicorn/no-negated-condition": "off", |
| 96 | + "unicorn/no-useless-undefined": ["error", { |
| 97 | + checkArguments: false |
| 98 | + }], |
| 99 | + "unicorn/prefer-top-level-await": "off", |
| 100 | + "unicorn/switch-case-braces": "off", |
| 101 | + "unicorn/prevent-abbreviations": "off", |
| 102 | + } |
| 103 | + } |
| 104 | +); |
0 commit comments