()
| 21 | } |
| 22 | |
| 23 | const 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 | |
| 44 | let options = { |
| 45 | ...defaultOptions, |