Skip to content

Commit

Permalink
Revert features for minor (#11016)
Browse files Browse the repository at this point in the history
This reverts commit f8cb785.
  • Loading branch information
sosukesuzuki committed Jun 5, 2021
1 parent 3cd28ca commit 09d65c3
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 20 deletions.
3 changes: 0 additions & 3 deletions changelog_unreleased/cli/10924.md

This file was deleted.

4 changes: 2 additions & 2 deletions src/language-yaml/embed.js
Expand Up @@ -3,11 +3,11 @@
function embed(path, print, textToDoc, options) {
const node = path.getValue();

// Try to format `.prettierrc` and `.stylelintrc` as `json` first
// Try to format `.prettierrc` as `json` first
if (
node.type === "root" &&
options.filepath &&
/(?:[/\\]|^)\.(?:prettier|stylelint)rc$/.test(options.filepath)
/(?:[/\\]|^)\.prettierrc$/.test(options.filepath)
) {
return textToDoc(options.originalText, { ...options, parser: "json" });
}
Expand Down
1 change: 0 additions & 1 deletion src/language-yaml/index.js
Expand Up @@ -13,7 +13,6 @@ const languages = [
filenames: [
...data.filenames.filter((filename) => filename !== "yarn.lock"),
".prettierrc",
".stylelintrc",
],
})),
];
Expand Down
Expand Up @@ -742,8 +742,7 @@ exports[`CLI --support-info (stdout) 1`] = `
\\".clang-tidy\\",
\\".gemrc\\",
\\"glide.lock\\",
\\".prettierrc\\",
\\".stylelintrc\\"
\\".prettierrc\\"
],
\\"linguistLanguageId\\": 407,
\\"name\\": \\"YAML\\",
Expand Down
12 changes: 0 additions & 12 deletions tests/integration/__tests__/with-parser-inference.js
Expand Up @@ -28,18 +28,6 @@ describe("infers parser from filename", () => {
).toEqual("{}\n");
});

test("json from .stylelintrc", () => {
expect(
prettier.format(" { } ", { filepath: "x/y/.stylelintrc" })
).toEqual("{}\n");
});

test("yaml from .stylelintrc", () => {
expect(
prettier.format(" extends: '' ", { filepath: "x/y/.stylelintrc" })
).toEqual('extends: ""\n');
});

test("babel from Jakefile", () => {
expect(
prettier.format("let foo = ( x = 1 ) => x", { filepath: "x/y/Jakefile" })
Expand Down

0 comments on commit 09d65c3

Please sign in to comment.