import eslint from "@eslint/js"; import tsEslint from "typescript-eslint"; import prettierEslintRecommended from "eslint-plugin-prettier/recommended"; export default tsEslint.config( eslint.configs.recommended, ...tsEslint.configs.strictTypeChecked, ...tsEslint.configs.stylisticTypeChecked, prettierEslintRecommended, { languageOptions: { parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname, }, }, }, { rules: { "@typescript-eslint/consistent-type-definitions": ["error", "type"], "@typescript-eslint/restrict-template-expressions": ["error", { allowNumber: true, allowNever: true }], }, }, { files: ["**/*.spec.*", "**/*.test.*"], rules: { // To make it easier to pass incorrect data to functions under test "@typescript-eslint/no-explicit-any": "off", "@typescript-eslint/no-unsafe-argument": "off", "@typescript-eslint/no-unsafe-assignment": "off", // With async test suites in TAP, we don't have to explicitly call t.end // (because TAP automatically determines that all assertions are done when the promise is settled), // so using async functions even when they don't have any awaits in them "@typescript-eslint/require-await": "off", }, }, );