Skip to content

Commit 378fb07

Browse files
authored
Merge pull request #1004 from codacy/fix-codacyrc
fix: Read `/.codacyrc` file correctly
2 parents bbe705e + 0e757c2 commit 378fb07

File tree

2 files changed

+1
-34
lines changed

2 files changed

+1
-34
lines changed

src/configCreator.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,31 @@
11
import { ESLint } from "eslint"
22

33
import { defaultOptions } from "./eslintDefaultOptions"
4-
import { debug } from "./logging"
54
import { readCodacyrcFile } from "./fileUtils"
65

76
export async function createEslintConfig(
87
srcDirPath: string
98
): Promise<[ESLint.Options, string[]]> {
10-
debug("config: creating")
11-
129
const defaultFilesToAnalyze = [
1310
srcDirPath + "/**"
1411
]
1512
const options = generateEslintOptions(srcDirPath)
1613

17-
const codacyrc = await readCodacyrcFile(srcDirPath + "/.codacyrc")
14+
const codacyrc = await readCodacyrcFile("/.codacyrc")
1815
const files = codacyrc?.files?.length > 0 ? codacyrc.files : defaultFilesToAnalyze
1916

20-
debug("config: finished")
2117
return [options, files]
2218
}
2319

2420
function generateEslintOptions(
2521
srcDirPath: string
2622
): ESLint.Options {
27-
debug("options: creating")
28-
2923
const options = defaultOptions
3024

3125
options.cwd = srcDirPath
3226
options.errorOnUnmatchedPattern = false
3327
options.resolvePluginsRelativeTo = "."
3428
options.useEslintrc = false
3529

36-
debug("options: finished")
3730
return options
3831
}

src/logging.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)