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 );
0
6
0
GitHub: lenolee16/mock
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 {
1
2
0
GitHub: lenolee16/mock
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) {
1
2
0
GitHub: Brncnnr/totara
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);
1
0
0
prettier.format is the most popular function in prettier (372 examples)