|
| 1 | +import js from "@eslint/js"; |
| 2 | +import typescriptParser from "@typescript-eslint/parser"; |
| 3 | +import eslintPluginTypescriptEslint from "@typescript-eslint/eslint-plugin"; |
| 4 | +import eslintConfigPrettier from "eslint-config-prettier"; |
| 5 | +import globals from "globals"; |
| 6 | + |
| 7 | +export default [ |
| 8 | + js.configs.recommended, |
| 9 | + eslintConfigPrettier, |
| 10 | + { |
| 11 | + files: ["src/**/*.ts"], |
| 12 | + languageOptions: { |
| 13 | + parser: typescriptParser, |
| 14 | + globals: { |
| 15 | + ...globals.browser, |
| 16 | + }, |
| 17 | + }, |
| 18 | + plugins: { "@typescript-eslint": eslintPluginTypescriptEslint }, |
| 19 | + rules: { |
| 20 | + "@typescript-eslint/explicit-function-return-type": "off", |
| 21 | + "@typescript-eslint/no-use-before-define": "off", |
| 22 | + "@typescript-eslint/no-non-null-assertion": "off", |
| 23 | + "@typescript-eslint/no-explicit-any": "off", |
| 24 | + "@typescript-eslint/explicit-module-boundary-types": "off", |
| 25 | + "@typescript-eslint/member-delimiter-style": [ |
| 26 | + "error", |
| 27 | + { |
| 28 | + multiline: { |
| 29 | + delimiter: "semi", |
| 30 | + requireLast: true, |
| 31 | + }, |
| 32 | + singleline: { |
| 33 | + delimiter: "semi", |
| 34 | + requireLast: false, |
| 35 | + }, |
| 36 | + }, |
| 37 | + ], |
| 38 | + "@typescript-eslint/no-unused-vars": [ |
| 39 | + "warn", |
| 40 | + { |
| 41 | + vars: "all", |
| 42 | + args: "all", |
| 43 | + ignoreRestSiblings: true, |
| 44 | + argsIgnorePattern: "^_", |
| 45 | + }, |
| 46 | + ], |
| 47 | + |
| 48 | + quotes: "off", |
| 49 | + "@typescript-eslint/quotes": [ |
| 50 | + "error", |
| 51 | + "double", |
| 52 | + { allowTemplateLiterals: true, avoidEscape: true }, |
| 53 | + ], |
| 54 | + semi: "off", |
| 55 | + "@typescript-eslint/semi": ["error", "always", { omitLastInOneLineBlock: true }], |
| 56 | + "comma-dangle": [ |
| 57 | + "error", |
| 58 | + { |
| 59 | + arrays: "always-multiline", |
| 60 | + objects: "always-multiline", |
| 61 | + imports: "always-multiline", |
| 62 | + exports: "always-multiline", |
| 63 | + functions: "never", |
| 64 | + }, |
| 65 | + ], |
| 66 | + "comma-spacing": ["error"], |
| 67 | + eqeqeq: ["error", "smart"], |
| 68 | + indent: "off", |
| 69 | + "@typescript-eslint/indent": 0, |
| 70 | + "no-multi-spaces": "error", |
| 71 | + "object-curly-spacing": ["error", "always"], |
| 72 | + "arrow-parens": "error", |
| 73 | + "arrow-spacing": "error", |
| 74 | + "key-spacing": "error", |
| 75 | + "keyword-spacing": "error", |
| 76 | + "func-call-spacing": "off", |
| 77 | + "@typescript-eslint/func-call-spacing": ["error"], |
| 78 | + "space-before-function-paren": [ |
| 79 | + "error", |
| 80 | + { |
| 81 | + anonymous: "always", |
| 82 | + named: "never", |
| 83 | + asyncArrow: "always", |
| 84 | + }, |
| 85 | + ], |
| 86 | + "space-in-parens": ["error", "never"], |
| 87 | + "space-before-blocks": "error", |
| 88 | + curly: ["error", "all"], |
| 89 | + "space-infix-ops": "error", |
| 90 | + "consistent-return": "error", |
| 91 | + "jsx-quotes": ["error"], |
| 92 | + "array-bracket-spacing": "error", |
| 93 | + "brace-style": "off", |
| 94 | + "@typescript-eslint/brace-style": ["error", "1tbs", { allowSingleLine: true }], |
| 95 | + "no-useless-constructor": "off", |
| 96 | + "@typescript-eslint/no-useless-constructor": "warn", |
| 97 | + }, |
| 98 | + }, |
| 99 | + { |
| 100 | + ignores: ["eslint.config.js", "dist/**/*", "**/.*", "src/openapi/*"], |
| 101 | + }, |
| 102 | +]; |
0 commit comments