* Fix plugin resolution when path does not start with ./
* Minor consistency fix: use "if (resolvedPluginSearchDir) {...}" in load-plugins
* Use more appropriate quotes in plugin-resolution.js
* Try both local paths and node modules when resolving plugins manually
* Test bespoke plugin loading by node module name
* Simplify getFileInfo() as suggested by @j-f1
https://github.com/prettier/prettier/pull/4341#discussion_r187112707
24 lines
391 B
JavaScript
24 lines
391 B
JavaScript
"use strict";
|
|
|
|
const concat = require("../../../../../../src/doc").builders.concat;
|
|
|
|
module.exports = {
|
|
languages: [
|
|
{
|
|
name: "bespoke",
|
|
parsers: ["bespoke"]
|
|
}
|
|
],
|
|
parsers: {
|
|
bespoke: {
|
|
parse: text => ({ text }),
|
|
astFormat: "bespoke"
|
|
}
|
|
},
|
|
printers: {
|
|
bespoke: {
|
|
print: path => concat(["bespoke+", path.getValue().text])
|
|
}
|
|
}
|
|
};
|