generated from nhcarrigan/template
feat: add rules for playwright (!3)
Reviewed-on: https://codeberg.org/nhcarrigan/eslint-config/pulls/3 Co-authored-by: Naomi Carrigan <commits@nhcarrigan.com> Co-committed-by: Naomi Carrigan <commits@nhcarrigan.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import vitest from "@vitest/eslint-plugin";
|
||||
import deprecation from "eslint-plugin-deprecation";
|
||||
import importPlugin from "eslint-plugin-import";
|
||||
import jsdoc from "eslint-plugin-jsdoc";
|
||||
import playwright from "eslint-plugin-playwright";
|
||||
import sortKeysFix from "eslint-plugin-sort-keys-fix";
|
||||
import unicorn from "eslint-plugin-unicorn";
|
||||
import globals from "globals";
|
||||
@@ -19,6 +20,7 @@ import { deprecationRules } from "./rules/deprecation.js";
|
||||
import { disabledEslintRules, eslintRules } from "./rules/eslint.js";
|
||||
import { importRules } from "./rules/import.js";
|
||||
import { jsdocRules } from "./rules/jsdoc.js";
|
||||
import { playwrightRules } from "./rules/playwright.js";
|
||||
import { sortKeysFixRules } from "./rules/sortKeysFix.js";
|
||||
import { stylisticRules } from "./rules/stylistic.js";
|
||||
import { typescriptEslintRules, typescriptEslintRulesWithTypes }
|
||||
@@ -49,6 +51,8 @@ const config: Array<Linter.Config> = [
|
||||
"deprecation": fixupPluginRules(deprecation),
|
||||
"import": fixupPluginRules(importPlugin as ESLint.Plugin),
|
||||
"jsdoc": jsdoc,
|
||||
// @ts-expect-error I'm not sure what's going on here, to be honest.
|
||||
"playwright": fixupPluginRules(playwright),
|
||||
"sort-keys-fix": sortKeysFix as ESLint.Plugin,
|
||||
// @ts-expect-error They haven't typedef this yet because it technically doesn't support eslint9
|
||||
"stylistic": fixupPluginRules(stylistic),
|
||||
@@ -67,6 +71,7 @@ const config: Array<Linter.Config> = [
|
||||
...unicornRules,
|
||||
...sortKeysFixRules,
|
||||
...vitestRules,
|
||||
...playwrightRules,
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/**
|
||||
* @copyright nhcarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import type { Linter } from "eslint";
|
||||
|
||||
export const playwrightRules: Linter.RulesRecord = {
|
||||
"playwright/expect-expect": "warn",
|
||||
"playwright/max-nested-describe": [ "warn", { max: 2 } ],
|
||||
"playwright/missing-playwright-await": "warn",
|
||||
"playwright/no-commented-out-tests": "warn",
|
||||
"playwright/no-conditional-expect": "warn",
|
||||
"playwright/no-conditional-in-test": "warn",
|
||||
"playwright/no-duplicate-hooks": "warn",
|
||||
"playwright/no-element-handle": "warn",
|
||||
"playwright/no-eval": "warn",
|
||||
"playwright/no-focused-test": "warn",
|
||||
"playwright/no-force-option": "warn",
|
||||
"playwright/no-get-by-title": "warn",
|
||||
"playwright/no-nested-step": "warn",
|
||||
"playwright/no-networkidle": "warn",
|
||||
"playwright/no-nth-methods": "warn",
|
||||
"playwright/no-page-pause": "warn",
|
||||
"playwright/no-raw-locators": "warn",
|
||||
"playwright/no-skipped-test": "warn",
|
||||
"playwright/no-standalone-expect": "warn",
|
||||
"playwright/no-unsafe-references": "warn",
|
||||
"playwright/no-useless-await": "warn",
|
||||
"playwright/no-useless-not": "warn",
|
||||
"playwright/no-wait-for-selector": "warn",
|
||||
"playwright/no-wait-for-timeout": "warn",
|
||||
"playwright/prefer-comparison-matcher": "warn",
|
||||
"playwright/prefer-equality-matcher": "warn",
|
||||
"playwright/prefer-hooks-in-order": "warn",
|
||||
"playwright/prefer-hooks-on-top": "warn",
|
||||
"playwright/prefer-lowercase-title": "warn",
|
||||
"playwright/prefer-strict-equal": "warn",
|
||||
"playwright/prefer-to-be": "warn",
|
||||
"playwright/prefer-to-contain": "warn",
|
||||
"playwright/prefer-to-have-count": "warn",
|
||||
"playwright/prefer-to-have-length": "warn",
|
||||
"playwright/prefer-web-first-assertions": "warn",
|
||||
"playwright/require-hook": "warn",
|
||||
"playwright/require-to-throw-message": "warn",
|
||||
"playwright/require-top-level-describe": "warn",
|
||||
"playwright/valid-describe-callback": "warn",
|
||||
"playwright/valid-expect":
|
||||
[ "warn", { maxArgs: 2, minArgs: 2 } ],
|
||||
"playwright/valid-expect-in-promise": "warn",
|
||||
"playwright/valid-title": "warn",
|
||||
};
|
||||
Reference in New Issue
Block a user