mirror of
https://github.com/sasjs/lint.git
synced 2026-01-10 14:00:05 +00:00
chore(*): add PR template, add TSDoc comments
This commit is contained in:
@@ -3,6 +3,10 @@ import { LintConfig } from '../types/LintConfig'
|
||||
import { readFile } from '@sasjs/utils/file'
|
||||
import { getProjectRoot } from './getProjectRoot'
|
||||
|
||||
/**
|
||||
* Fetches the config from the .sasjslint file and creates a LintConfig object.
|
||||
* @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'))
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
import path from 'path'
|
||||
import { fileExists } from '@sasjs/utils/file'
|
||||
|
||||
export async function getProjectRoot() {
|
||||
/**
|
||||
* Returns the absolute path to the location of the .sasjslint file.
|
||||
* Traverses the folder tree until the .sasjslint file is found.
|
||||
* @returns {Promise<string>} the path to the folder containing the lint config.
|
||||
*/
|
||||
export async function getProjectRoot(): Promise<string> {
|
||||
let root = ''
|
||||
let rootFound = false
|
||||
let i = 1
|
||||
|
||||
Reference in New Issue
Block a user