Skip to content

Commit 685f4be

Browse files
committed
fix: Revert commit 17f30b4
This had some unexpected side effects.
1 parent 240c6bc commit 685f4be

File tree

2 files changed

+1
-39
lines changed

2 files changed

+1
-39
lines changed

src/__tests__/utils.js

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -263,34 +263,6 @@ test("eslint max-len.tabWidth value should be used for tabWidth when tabs are us
263263
});
264264
});
265265

266-
test("Turn off prettier/prettier rule if found, but still infer options from it", () => {
267-
const { eslint, prettier } = getOptionsForFormatting(
268-
{
269-
rules: {
270-
"prettier/prettier": [
271-
2,
272-
{
273-
trailingComma: "all"
274-
}
275-
]
276-
}
277-
},
278-
undefined,
279-
undefined,
280-
eslintPath
281-
);
282-
283-
expect(eslint).toMatchObject({
284-
rules: {
285-
"prettier/prettier": ["off"]
286-
}
287-
});
288-
289-
expect(prettier).toMatchObject({
290-
trailingComma: "all"
291-
});
292-
});
293-
294266
test("eslint config has only necessary properties", () => {
295267
const { eslint } = getOptionsForFormatting(
296268
{

src/utils.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -65,22 +65,12 @@ function getOptionsForFormatting(
6565
fallbackPrettierOptions = {},
6666
eslintPath
6767
) {
68-
let eslint = getRelevantESLintConfig(eslintConfig, eslintPath);
68+
const eslint = getRelevantESLintConfig(eslintConfig, eslintPath);
6969
const prettier = getPrettierOptionsFromESLintRules(
7070
eslintConfig,
7171
prettierOptions,
7272
fallbackPrettierOptions
7373
);
74-
75-
// Disable "prettier/prettier", we don't need to run prettier twice
76-
eslint = {
77-
...eslint,
78-
rules: {
79-
...eslint.rules,
80-
"prettier/prettier": ["off"]
81-
}
82-
};
83-
8474
return { eslint, prettier };
8575
}
8676

0 commit comments

Comments
 (0)