MCPcopy Create free account
hub / github.com/d1ll0n/stack-packer / tryGetPrettierOptions

Function tryGetPrettierOptions

src/code-gen/prettier.ts:23–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21}
22
23const tryGetPrettierOptions = () => {
24 try {
25 const dir = process.cwd();
26 const filePath = path.join(dir, '.prettierrc.js');
27 if (fs.existsSync(filePath)) {
28 const options = require(filePath);
29 if (typeof options === 'object') {
30 return options;
31 }
32 // return {
33 // ...options,
34 // ...mandatoryOptions
35 // };
36 }
37 } catch (err) {
38 return {}
39 }
40 return {}
41 return defaultOptions
42}
43
44let options = {
45 ...defaultOptions,

Callers 1

prettier.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected