UNPKG

@jimmy.codes/eslint-config

Version:

A simple, modern ESLint config that covers most use cases.

47 lines (46 loc) 1.83 kB
import { GLOB_PLAYWRIGHT } from "./globs.mjs"; import { n as extractOptions, t as unwrapDefault } from "./interop-default-CAdBatTA.mjs"; import { t as upwarn } from "./upwarn-CSmqblU7.mjs"; //#region src/rules/playwright.ts const playwrightRules = async (options) => { return { ...upwarn((await unwrapDefault(import("eslint-plugin-playwright"))).configs["flat/recommended"].rules), "playwright/consistent-spacing-between-blocks": "error", "playwright/expect-expect": "error", "playwright/max-nested-describe": "error", "playwright/no-commented-out-tests": "error", "playwright/no-conditional-expect": "error", "playwright/no-conditional-in-test": "error", "playwright/no-element-handle": "error", "playwright/no-eval": "error", "playwright/no-force-option": "error", "playwright/no-nested-step": "error", "playwright/no-page-pause": "error", "playwright/no-skipped-test": "error", "playwright/no-slowed-test": "error", "playwright/no-useless-await": "error", "playwright/no-useless-not": "error", "playwright/no-wait-for-selector": "error", "playwright/no-wait-for-timeout": "error", "playwright/prefer-strict-equal": "error", "playwright/prefer-to-be": "error", "playwright/prefer-to-contain": "error", "playwright/require-to-pass-timeout": "error", "playwright/require-to-throw-message": "error", "playwright/valid-title": "off", ...options?.overrides }; }; //#endregion //#region src/configs/playwright.ts async function playwrightConfig(options) { const extractedOptions = extractOptions(options); return [{ ...(await unwrapDefault(import("eslint-plugin-playwright"))).configs["flat/recommended"], files: GLOB_PLAYWRIGHT, name: "jimmy.codes/playwright", rules: await playwrightRules(extractedOptions) }]; } //#endregion export { playwrightConfig as default };