diff --git a/src/index.ts b/src/index.ts index b7c0c5c..a45d40e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,2 +1,3 @@ export { lintText, lintFile } from './lint' export * from './types' +export * from './utils' diff --git a/src/utils/getLintConfig.ts b/src/utils/getLintConfig.ts index 435f800..be39867 100644 --- a/src/utils/getLintConfig.ts +++ b/src/utils/getLintConfig.ts @@ -3,7 +3,10 @@ import { LintConfig } from '../types/LintConfig' import { readFile } from '@sasjs/utils/file' import { getProjectRoot } from './getProjectRoot' -const defaultConfiguration = { +/** + * Default configuration that is used when a .sasjslint file is not found + */ +export const DefaultLintConfiguration = { noTrailingSpaces: true, noEncodedPasswords: true, hasDoxygenHeader: true, @@ -12,6 +15,7 @@ const defaultConfiguration = { maxLineLength: 80, noTabIndentation: true } + /** * Fetches the config from the .sasjslint file and creates a LintConfig object. * Returns the default configuration when a .sasjslint file is unavailable. @@ -23,7 +27,7 @@ export async function getLintConfig(): Promise { path.join(projectRoot, '.sasjslint') ).catch((_) => { console.warn('Unable to load .sasjslint file. Using default configuration.') - return JSON.stringify(defaultConfiguration) + return JSON.stringify(DefaultLintConfiguration) }) return new LintConfig(JSON.parse(configuration)) } diff --git a/src/utils/index.ts b/src/utils/index.ts new file mode 100644 index 0000000..4bb8061 --- /dev/null +++ b/src/utils/index.ts @@ -0,0 +1,2 @@ +export * from './getLintConfig' +export * from './getProjectRoot'