|  | 
| 1 |  | -import jest from "eslint-plugin-jest"; | 
| 2 |  | -import typescriptEslint from "@typescript-eslint/eslint-plugin"; | 
| 3 |  | -import globals from "globals"; | 
| 4 |  | -import tsParser from "@typescript-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 |  | -    ignores: ["**/dist/", "**/lib/", "**/node_modules/", "**/jest.config.js"], | 
| 20 |  | -}, ...compat.extends("plugin:github/recommended"), { | 
| 21 |  | -    plugins: { | 
| 22 |  | -        jest, | 
| 23 |  | -        "@typescript-eslint": typescriptEslint, | 
| 24 |  | -    }, | 
| 25 |  | - | 
|  | 1 | +import eslint from '@eslint/js' | 
|  | 2 | +import typescriptEslint from '@typescript-eslint/eslint-plugin' | 
|  | 3 | +import tseslint from 'typescript-eslint' | 
|  | 4 | +import jest from 'eslint-plugin-jest' | 
|  | 5 | +import github from 'eslint-plugin-github' | 
|  | 6 | + | 
|  | 7 | +export default [ | 
|  | 8 | +  ...tseslint.config(eslint.configs.recommended, tseslint.configs.recommended), | 
|  | 9 | +  github.getFlatConfigs().recommended, | 
|  | 10 | +  { | 
|  | 11 | +    rules: { | 
|  | 12 | +      'importPlugin/no-unresolved': 'off' | 
|  | 13 | +    } | 
|  | 14 | +  }, | 
|  | 15 | +  ...github.getFlatConfigs().typescript, | 
|  | 16 | +  { | 
|  | 17 | +    files: ['__tests__/**/*.test.ts'], | 
|  | 18 | +    plugins: {jest: jest}, | 
| 26 | 19 |     languageOptions: { | 
| 27 |  | -        globals: { | 
| 28 |  | -            ...globals.node, | 
| 29 |  | -            ...jest.environments.globals.globals, | 
| 30 |  | -        }, | 
| 31 |  | - | 
| 32 |  | -        parser: tsParser, | 
| 33 |  | -        ecmaVersion: 9, | 
| 34 |  | -        sourceType: "module", | 
| 35 |  | - | 
| 36 |  | -        parserOptions: { | 
| 37 |  | -            project: "./tsconfig.json", | 
| 38 |  | -        }, | 
|  | 20 | +      globals: jest.environments.globals.globals | 
| 39 | 21 |     }, | 
| 40 |  | - | 
| 41 | 22 |     rules: { | 
| 42 |  | -        "i18n-text/no-en": "off", | 
| 43 |  | -        "eslint-comments/no-use": "off", | 
| 44 |  | -        "import/no-namespace": "off", | 
| 45 |  | -        "no-unused-vars": "off", | 
| 46 |  | -        "@typescript-eslint/no-unused-vars": "error", | 
| 47 |  | - | 
| 48 |  | -        "@typescript-eslint/explicit-member-accessibility": ["error", { | 
| 49 |  | -            accessibility: "no-public", | 
| 50 |  | -        }], | 
| 51 |  | - | 
| 52 |  | -        "@typescript-eslint/no-require-imports": "error", | 
| 53 |  | -        "@typescript-eslint/array-type": "error", | 
| 54 |  | -        "@typescript-eslint/await-thenable": "error", | 
| 55 |  | -        "@typescript-eslint/ban-ts-comment": "error", | 
| 56 |  | -        camelcase: "off", | 
| 57 |  | -        "@typescript-eslint/consistent-type-assertions": "error", | 
| 58 |  | - | 
| 59 |  | -        "@typescript-eslint/explicit-function-return-type": ["error", { | 
| 60 |  | -            allowExpressions: true, | 
| 61 |  | -        }], | 
| 62 |  | - | 
| 63 |  | -        "@typescript-eslint/func-call-spacing": ["error", "never"], | 
| 64 |  | -        "@typescript-eslint/no-array-constructor": "error", | 
| 65 |  | -        "@typescript-eslint/no-empty-interface": "error", | 
| 66 |  | -        "@typescript-eslint/no-explicit-any": "error", | 
| 67 |  | -        "@typescript-eslint/no-extraneous-class": "error", | 
| 68 |  | -        "@typescript-eslint/no-for-in-array": "error", | 
| 69 |  | -        "@typescript-eslint/no-inferrable-types": "error", | 
| 70 |  | -        "@typescript-eslint/no-misused-new": "error", | 
| 71 |  | -        "@typescript-eslint/no-namespace": "error", | 
| 72 |  | -        "@typescript-eslint/no-non-null-assertion": "warn", | 
| 73 |  | -        "@typescript-eslint/no-unnecessary-qualifier": "error", | 
| 74 |  | -        "@typescript-eslint/no-unnecessary-type-assertion": "error", | 
| 75 |  | -        "@typescript-eslint/no-useless-constructor": "error", | 
| 76 |  | -        "@typescript-eslint/no-var-requires": "error", | 
| 77 |  | -        "@typescript-eslint/prefer-for-of": "warn", | 
| 78 |  | -        "@typescript-eslint/prefer-function-type": "warn", | 
| 79 |  | -        "@typescript-eslint/prefer-includes": "error", | 
| 80 |  | -        "@typescript-eslint/prefer-string-starts-ends-with": "error", | 
| 81 |  | -        "@typescript-eslint/promise-function-async": "error", | 
| 82 |  | -        "@typescript-eslint/require-array-sort-compare": "error", | 
| 83 |  | -        "@typescript-eslint/restrict-plus-operands": "error", | 
| 84 |  | -        semi: "off", | 
| 85 |  | -        "@typescript-eslint/semi": ["error", "never"], | 
| 86 |  | -        "@typescript-eslint/type-annotation-spacing": "error", | 
| 87 |  | -        "@typescript-eslint/unbound-method": "error", | 
| 88 |  | -    }, | 
| 89 |  | -}]; | 
|  | 23 | +      'jest/no-disabled-tests': 'warn', | 
|  | 24 | +      'jest/no-focused-tests': 'error', | 
|  | 25 | +      'jest/no-identical-title': 'error', | 
|  | 26 | +      'jest/prefer-to-have-length': 'warn', | 
|  | 27 | +      'jest/valid-expect': 'error' | 
|  | 28 | +    } | 
|  | 29 | +  } | 
|  | 30 | +] | 
0 commit comments