1
0
mirror of https://github.com/sasjs/lint.git synced 2026-01-08 21:10:05 +00:00

feat(format): add the ability to format files, folders and projects

This commit is contained in:
Krishna Acondy
2021-04-19 22:13:53 +01:00
parent d28d32d441
commit bcb50b9968
11 changed files with 320 additions and 17 deletions

View File

@@ -0,0 +1,15 @@
import { getProjectRoot } from '../utils/getProjectRoot'
import { formatFolder } from './formatFolder'
/**
* Automatically formats all SAS files in the current project.
* @returns {Promise<void>} Resolves successfully when all SAS files in the current project have been formatted.
*/
export const formatProject = async () => {
const projectRoot =
(await getProjectRoot()) || process.projectDir || process.currentDir
if (!projectRoot) {
throw new Error('SASjs Project Root was not found.')
}
return await formatFolder(projectRoot)
}