Skip to content

Commit b6ab015

Browse files
committed
fix: Only add flatconfig for ESLint for the new format of config
1 parent 4f4cfb7 commit b6ab015

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tools/eslintRunner.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ func RunEslint(repositoryToAnalyseDirectory string, eslintInstallationDirectory
1616

1717
cmd := exec.Command(nodeBinary, eslintJsPath)
1818

19-
// For Eslint compatibility with version 8.
20-
// https://eslint.org/docs/v8.x/use/configure/configuration-files-new
21-
cmd.Env = append(cmd.Env, "ESLINT_USE_FLAT_CONFIG=true")
22-
2319
// Add config file from tools-configs directory if it exists
2420
if configFile, exists := ConfigFileExists(config.Config, "eslint.config.mjs"); exists {
21+
// For Eslint compatibility with version 8.
22+
// https://eslint.org/docs/v8.x/use/configure/configuration-files-new
23+
cmd.Env = append(cmd.Env, "ESLINT_USE_FLAT_CONFIG=true")
24+
2525
cmd.Args = append(cmd.Args, "-c", configFile)
2626
}
2727

0 commit comments

Comments
 (0)