How to use the getFileInfo function from prettier

Find comprehensive JavaScript prettier.getFileInfo code examples handpicked from public code repositorys.

7
8
9
10
11
12
13
14
15
const rootPath = getCurrentWorkspaceRootFsPath();
const ignoreOptions = {
    ignorePath: path.join(rootPath, ".prettierignore"),
};

const fileInfo = prettier.getFileInfo.sync(
    document.uri.fsPath,
    ignoreOptions
);
fork icon0
star icon6
watch icon0

17
18
19
20
21
22
23
24
25
26
27


files.forEach(file => {
  const options = prettier.resolveConfig.sync(file, {
    config: prettierConfigPath,
  });
  const fileInfo = prettier.getFileInfo.sync(file);
  if (fileInfo.ignored) {
    return;
  }
  try {
fork icon1
star icon2
watch icon0

17
18
19
20
21
22
23
24
25
26
files.forEach(file => {
  Promise.all([
    prettier.resolveConfig(file, {
      config: prettierConfigPath,
    }),
    prettier.getFileInfo(file),
  ])
    .then(resolves => {
      const [options, fileInfo] = resolves;
      if (fileInfo.ignored) {
fork icon1
star icon2
watch icon0

84
85
86
87
88
89
90
91
92
93
94
95
96


  return !hasError && !hasIssues;
}


function getConfig(filePath) {
  const info = prettier.getFileInfo.sync(filePath, {
    ignorePath: path.join(rootDir, '.eslintignore'),
  });


  let config = prettier.resolveConfig.sync(filePath);
fork icon1
star icon0
watch icon0