File tree Expand file tree Collapse file tree 2 files changed +1
-34
lines changed Expand file tree Collapse file tree 2 files changed +1
-34
lines changed Original file line number Diff line number Diff line change 1
1
import { ESLint } from "eslint"
2
2
3
3
import { defaultOptions } from "./eslintDefaultOptions"
4
- import { debug } from "./logging"
5
4
import { readCodacyrcFile } from "./fileUtils"
6
5
7
6
export async function createEslintConfig (
8
7
srcDirPath : string
9
8
) : Promise < [ ESLint . Options , string [ ] ] > {
10
- debug ( "config: creating" )
11
-
12
9
const defaultFilesToAnalyze = [
13
10
srcDirPath + "/**"
14
11
]
15
12
const options = generateEslintOptions ( srcDirPath )
16
13
17
- const codacyrc = await readCodacyrcFile ( srcDirPath + "/.codacyrc" )
14
+ const codacyrc = await readCodacyrcFile ( "/.codacyrc" )
18
15
const files = codacyrc ?. files ?. length > 0 ? codacyrc . files : defaultFilesToAnalyze
19
16
20
- debug ( "config: finished" )
21
17
return [ options , files ]
22
18
}
23
19
24
20
function generateEslintOptions (
25
21
srcDirPath : string
26
22
) : ESLint . Options {
27
- debug ( "options: creating" )
28
-
29
23
const options = defaultOptions
30
24
31
25
options . cwd = srcDirPath
32
26
options . errorOnUnmatchedPattern = false
33
27
options . resolvePluginsRelativeTo = "."
34
28
options . useEslintrc = false
35
29
36
- debug ( "options: finished" )
37
30
return options
38
31
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments