Skip to content

Commit 35b2b7c

Browse files
committed
eslint: remove unneeded configuration
1 parent a2a5502 commit 35b2b7c

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,6 @@ private void setConfigToCallOptions(Map<FormatOption, Object> eslintCallOptions)
213213
if (eslintConfig.getEslintConfigJs() != null) {
214214
eslintCallOptions.put(FormatOption.ESLINT_OVERRIDE_CONFIG, eslintConfig.getEslintConfigJs());
215215
}
216-
eslintCallOptions.put(FormatOption.NODE_MODULES_DIR, nodeModulesDir.getAbsolutePath());
217-
218216
if (eslintConfig instanceof EslintTypescriptConfig) {
219217
// if we are a ts config, see if we need to use specific paths or use default projectDir
220218
File tsConfigFilePath = ((EslintTypescriptConfig) eslintConfig).getTypescriptConfigPath();

lib/src/main/java/com/diffplug/spotless/npm/EslintRestService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public String format(String fileContent, Map<FormatOption, Object> formatOptions
3535
}
3636

3737
enum FormatOption {
38-
ESLINT_OVERRIDE_CONFIG("eslint_override_config"), ESLINT_OVERRIDE_CONFIG_FILE("eslint_override_config_file"), FILE_PATH("file_path"), NODE_MODULES_DIR("node_modules_dir"), TS_CONFIG_ROOT_DIR("ts_config_root_dir");
38+
ESLINT_OVERRIDE_CONFIG("eslint_override_config"), ESLINT_OVERRIDE_CONFIG_FILE("eslint_override_config_file"), FILE_PATH("file_path"), TS_CONFIG_ROOT_DIR("ts_config_root_dir");
3939

4040
private final String backendName;
4141

testlib/src/test/java/com/diffplug/spotless/npm/EslintFormatterStepTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import com.diffplug.spotless.tag.NpmTest;
2424

2525
import org.junit.jupiter.api.Nested;
26+
import org.junit.jupiter.api.Test;
2627
import org.junit.jupiter.params.ParameterizedTest;
2728
import org.junit.jupiter.params.provider.ValueSource;
2829

@@ -33,6 +34,12 @@
3334
@NpmTest
3435
class EslintFormatterStepTest {
3536

37+
private final Map<String, String> combine(Map<String, String> m1, Map<String, String> m2) {
38+
Map<String, String> combined = new TreeMap<>(m1);
39+
combined.putAll(m2);
40+
return combined;
41+
}
42+
3643
@NpmTest
3744
@Nested
3845
class EslintTypescriptFormattingStepTest extends NpmFormatterStepCommonTests {
@@ -43,11 +50,7 @@ class EslintTypescriptFormattingStepTest extends NpmFormatterStepCommonTests {
4350
"standard_rules_xo", combine(EslintFormatterStep.defaultDevDependenciesForTypescript(), EslintFormatterStep.PopularStyleGuide.XO_TYPESCRIPT.devDependencies())
4451
);
4552

46-
private final Map<String, String> combine(Map<String, String> m1, Map<String, String> m2) {
47-
Map<String, String> combined = new TreeMap<>(m1);
48-
combined.putAll(m2);
49-
return combined;
50-
}
53+
5154

5255
@ParameterizedTest(name = "{index}: eslint can be applied using ruleset {0}")
5356
@ValueSource(strings = {"custom_rules", "standard_rules_standard_with_typescript", "standard_rules_xo"})

0 commit comments

Comments
 (0)