Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert features for minor #11016

Merged
merged 1 commit into from Jun 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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