mirror of
https://github.com/sasjs/lint.git
synced 2026-01-14 07:40:05 +00:00
fix(*): Add severity, start and end column numbers for diagnostics, change warning to message
This commit is contained in:
@@ -10,14 +10,15 @@ const defaultConfiguration = {
|
||||
}
|
||||
/**
|
||||
* Fetches the config from the .sasjslint file and creates a LintConfig object.
|
||||
* Returns the default configuration when a .sasjslint file is unavailable.
|
||||
* @returns {Promise<LintConfig>} resolves with an object representing the current lint configuration.
|
||||
*/
|
||||
export async function getLintConfig(): Promise<LintConfig> {
|
||||
const projectRoot = await getProjectRoot()
|
||||
const configuration = await readFile(
|
||||
path.join(projectRoot, '.sasjslint')
|
||||
).catch((e) => {
|
||||
console.error('Error reading .sasjslint file', e)
|
||||
).catch((_) => {
|
||||
console.warn('Unable to load .sasjslint file. Using default configuration.')
|
||||
return JSON.stringify(defaultConfiguration)
|
||||
})
|
||||
return new LintConfig(JSON.parse(configuration))
|
||||
|
||||
Reference in New Issue
Block a user