How to use the prettier/local.getSupportInfo function in prettier

To help you get started, we’ve selected a few prettier examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github brodybits / prettierx / tests_integration / __tests__ / schema.js View on Github external
test("schema", () => {
  expect(generateSchema(prettier.getSupportInfo().options)).toMatchSnapshot();
});
github brodybits / prettierx / tests_integration / __tests__ / support-info.js View on Github external
function getCoreInfo(version) {
  const supportInfo = prettier.getSupportInfo(version);
  const languages = supportInfo.languages.reduce(
    (obj, language) =>
      Object.assign({ [language.name]: language.parsers }, obj),
    {}
  );
  const options = supportInfo.options.reduce(
    (obj, option) =>
      Object.assign(
        {
          [option.name]: Object.assign(
            {
              type: option.type,
              default: option.default
            },
            option.type === "int"
              ? { range: option.range }
github brodybits / prettierx / tests / empty / jsfmt.spec.js View on Github external
const prettier = require("prettier/local");
const parsers = prettier
  .getSupportInfo()
  .options.find(option => option.name === "parser");

run_spec(
  __dirname,
  parsers.choices
    .filter(choice => !choice.deprecated)
    .map(choice => choice.value)
);