Skip to content

Commit

Permalink
chore: improve interop between prettier and eslint (via #1212)
Browse files Browse the repository at this point in the history
  • Loading branch information
baev authored Jan 6, 2025
1 parent 147d8e1 commit 731f19f
Show file tree
Hide file tree
Showing 15 changed files with 4 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ module.exports = {
"@typescript-eslint/prefer-namespace-keyword": "error",
"@typescript-eslint/prefer-regexp-exec": "off",
"@typescript-eslint/prefer-promise-reject-errors": "off",
"@stylistic/quotes": ["error", "double"],
"@stylistic/quotes": ["error", "double", { avoidEscape: true }],
"@typescript-eslint/restrict-template-expressions": [
"error",
{
Expand Down
1 change: 1 addition & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ module.exports = {
importOrderSeparation: false,
importOrderSortSpecifiers: true,
importOrderParserPlugins: ["typescript", "decorators-legacy"],
quoteProps: "consistent",
};
1 change: 0 additions & 1 deletion packages/allure-codeceptjs/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const runCodeceptJsInlineTest = async (
): Promise<RunResult> => {
const testFiles = {
// package.json is used to find project root in case of absolute file paths are used
// eslint-disable-next-line @stylistic/quotes
"package.json": '{ "name": "dummy"}',
"codecept.conf.js": await readFile(resolvePath(__dirname, "./samples/codecept.conf.js"), "utf-8"),
"helper.js": await readFile(resolvePath(__dirname, "./samples/helper.js"), "utf-8"),
Expand Down
1 change: 0 additions & 1 deletion packages/allure-jasmine/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const runJasmineInlineTest = async (
const testDir = path.join(__dirname, "fixtures", randomUUID());
const testFiles = {
// package.json is used to find project root in case of absolute file paths are used
// eslint-disable-next-line @stylistic/quotes
"package.json": '{ "name": "dummy"}',
"spec/support/jasmine.json": await readFile(path.join(__dirname, "./samples/spec/support/jasmine.json"), "utf8"),
// eslint-disable-next-line @typescript-eslint/no-require-imports
Expand Down
2 changes: 1 addition & 1 deletion packages/allure-mocha/src/extraReporters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const instantiateReporters = (
...options,
reporterOptions,
// eslint-disable-next-line quote-props
reporterOption: reporterOptions,
"reporterOption": reporterOptions,
"reporter-option": reporterOptions,
};
reporters.push(new Reporter(runner, optionsForReporter));
Expand Down
1 change: 0 additions & 1 deletion packages/allure-mocha/test/spec/framework/fixtures.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint @stylistic/quotes: off */
import { beforeAll, describe, expect, it } from "vitest";
import type { Assertion } from "vitest";
import type { TestResult, TestResultContainer } from "allure-js-commons";
Expand Down
2 changes: 0 additions & 2 deletions packages/allure-mocha/test/spec/framework/retries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ describe("retries", () => {
expect(befores).toEqual(
expect.arrayContaining([
expect.objectContaining({
// eslint-disable-next-line @stylistic/quotes
name: '"before each" hook',
steps: expect.arrayContaining([
expect.objectContaining({
Expand All @@ -164,7 +163,6 @@ describe("retries", () => {
expect(afters).toEqual(
expect.arrayContaining([
expect.objectContaining({
// eslint-disable-next-line @stylistic/quotes
name: '"after each" hook',
steps: expect.arrayContaining([
expect.objectContaining({
Expand Down
8 changes: 1 addition & 7 deletions packages/newman-reporter-allure/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,13 +461,7 @@ class AllureReporter {
}

#escape(val: string) {
return (
val
.replace("\n", "")
.replace("\r", "")
// eslint-disable-next-line @stylistic/quotes
.replace('"', '"')
);
return val.replace("\n", "").replace("\r", "").replace('"', '"');
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @stylistic/quotes */
import { afterAll, afterEach, beforeAll, expect, test } from "vitest";
import { server } from "../mocks/server.js";
import { runNewmanCollection } from "../utils.js";
Expand Down
1 change: 0 additions & 1 deletion packages/newman-reporter-allure/test/spec/exec.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @stylistic/quotes */
import { afterAll, afterEach, beforeAll, expect, test } from "vitest";
import { server } from "../mocks/server.js";
import { runNewmanCollection } from "../utils.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @stylistic/quotes */
import { afterAll, afterEach, beforeAll, expect, test } from "vitest";
import { server } from "../mocks/server.js";
import { runNewmanCollection } from "../utils.js";
Expand Down
1 change: 0 additions & 1 deletion packages/newman-reporter-allure/test/spec/headers.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @stylistic/quotes */
import { afterAll, afterEach, beforeAll, expect, test } from "vitest";
import { server } from "../mocks/server.js";
import { runNewmanCollection } from "../utils.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @stylistic/quotes */
import { afterAll, afterEach, beforeAll, expect, test } from "vitest";
import { server } from "../mocks/server.js";
import { runNewmanCollection } from "../utils.js";
Expand Down
1 change: 0 additions & 1 deletion packages/newman-reporter-allure/test/spec/simple.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @stylistic/quotes */
import { afterAll, afterEach, beforeAll, expect, test } from "vitest";
import { LabelName, Stage, Status } from "allure-js-commons";
import { server } from "../mocks/server.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable @stylistic/quotes */
import { afterAll, afterEach, beforeAll, expect, test } from "vitest";
import { server } from "../mocks/server.js";
import { runNewmanCollection } from "../utils.js";
Expand Down

0 comments on commit 731f19f

Please sign in to comment.