({ path, fix })
| 29 | } |
| 30 | |
| 31 | export const handler = async ({ path, fix }) => { |
| 32 | recordTelemetryAttributes({ |
| 33 | command: 'lint', |
| 34 | fix, |
| 35 | }) |
| 36 | |
| 37 | try { |
| 38 | const pathString = path?.join(' ') |
| 39 | const result = await execa( |
| 40 | 'yarn eslint', |
| 41 | [ |
| 42 | fix && '--fix', |
| 43 | !pathString && fs.existsSync(getPaths().web.src) && 'web/src', |
| 44 | !pathString && fs.existsSync(getPaths().web.config) && 'web/config', |
| 45 | !pathString && |
| 46 | fs.existsSync(getPaths().web.storybook) && |
| 47 | 'web/.storybook', |
| 48 | !pathString && fs.existsSync(getPaths().scripts) && 'scripts', |
| 49 | !pathString && fs.existsSync(getPaths().api.src) && 'api/src', |
| 50 | pathString, |
| 51 | ].filter(Boolean), |
| 52 | { |
| 53 | cwd: getPaths().base, |
| 54 | shell: true, |
| 55 | stdio: 'inherit', |
| 56 | }, |
| 57 | ) |
| 58 | |
| 59 | process.exitCode = result.exitCode |
| 60 | } catch (error) { |
| 61 | process.exitCode = error.exitCode ?? 1 |
| 62 | } |
| 63 | } |
nothing calls this directly
no test coverage detected