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:
@ -8,6 +8,7 @@ import { describe, expect, it } from "vitest";
|
||||
import { eslintRules } from "../src/rules/eslint.ts";
|
||||
import { importRules } from "../src/rules/import.js";
|
||||
import { jsdocRules } from "../src/rules/jsdoc.js";
|
||||
import { playwrightRules } from "../src/rules/playwright.ts";
|
||||
import { stylisticRules } from "../src/rules/stylistic.ts";
|
||||
import { typescriptEslintRules } from "../src/rules/typescriptEslint.js";
|
||||
import { unicornRules } from "../src/rules/unicorn.js";
|
||||
@ -44,6 +45,16 @@ describe("no rules should be turned off in", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("playwright rules", () => {
|
||||
expect.assertions(42);
|
||||
const rules = Object.entries(playwrightRules);
|
||||
for (const [ name, rule ] of rules) {
|
||||
expect(Array.isArray(rule)
|
||||
? rule.at(0)
|
||||
: rule, `${name} appears to be turned off - this project does not use any external configs, so all rules should be off by default.`).not.toBe("off");
|
||||
}
|
||||
});
|
||||
|
||||
it("stylistic rules", () => {
|
||||
expect.assertions(65);
|
||||
const rules = Object.entries(stylisticRules);
|
||||
|
21
test/playwright.spec.ts
Normal file
21
test/playwright.spec.ts
Normal file
@ -0,0 +1,21 @@
|
||||
/**
|
||||
* @copyright nhcarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { playwrightRules } from "../src/rules/playwright.ts";
|
||||
|
||||
describe("playwright configs", () => {
|
||||
it("should never be an error", () => {
|
||||
expect.assertions(42);
|
||||
const rules = Object.entries(playwrightRules);
|
||||
for (const [ name, rule ] of rules) {
|
||||
expect(Array.isArray(rule)
|
||||
? rule.at(0)
|
||||
: rule, `${name} appears to be set to an error!`).not.toBe("error");
|
||||
continue;
|
||||
}
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user