Format files in tests/integration/plugins/ (#18083)
This commit is contained in:
1 parent
3476a69e73
commit
d3da764b37
5 files changed
+9
-9
No files matched your search
@@ -6,7 +6,6 @@
|
||||
!/tests/format/**/
|
||||
!/tests/format/**/format.test.js
|
||||
/tests/integration/cli/
|
||||
/tests/integration/plugins/**/*.*
|
||||
!/tests/integration/plugins/automatic/node_modules/@prettier/plugin-foo/index.js
|
||||
!/tests/integration/plugins/automatic/node_modules/@user/prettier-plugin-foobar/index.js
|
||||
!/tests/integration/plugins/automatic/node_modules/prettier-plugin-bar/index.js
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"plugins": ["./plugin"]
|
||||
"plugins": ["./plugin"]
|
||||
}
|
||||
@@ -2,13 +2,13 @@ import path from "node:path";
|
||||
import createPlugin from "../../../config/utils/create-plugin.cjs";
|
||||
|
||||
const PARSER_NAME = "parser-name-inferred-from-language-is-supported";
|
||||
const PRINT_MARK = `formatted by '${PARSER_NAME}' parser`
|
||||
const PRINT_MARK = `formatted by '${PARSER_NAME}' parser`;
|
||||
|
||||
const languages = [
|
||||
{
|
||||
name: "language-name-does-not-matter",
|
||||
parsers: [PARSER_NAME],
|
||||
isSupported({filepath}) {
|
||||
isSupported({ filepath }) {
|
||||
// This is only true when running from CLI
|
||||
if (!path.isAbsolute(filepath)) {
|
||||
throw new Error("Unexpected non absolute path");
|
||||
@@ -22,7 +22,8 @@ const languages = [
|
||||
export default {
|
||||
...createPlugin({
|
||||
name: PARSER_NAME,
|
||||
print: (content) => `${content.replace(PRINT_MARK,"").trim()}\n${PRINT_MARK}`,
|
||||
print: (content) =>
|
||||
`${content.replace(PRINT_MARK, "").trim()}\n${PRINT_MARK}`,
|
||||
finalNewLine: false,
|
||||
}),
|
||||
languages,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"plugins": ["./plugin.cjs"],
|
||||
"fooString": "baz"
|
||||
"plugins": ["./plugin.cjs"],
|
||||
"fooString": "baz"
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"plugins": ["./plugin.cjs"],
|
||||
"fooOption": "baz"
|
||||
"plugins": ["./plugin.cjs"],
|
||||
"fooOption": "baz"
|
||||
}
|
||||
Reference in new issue
Block a user