diff --git a/CHANGES.md b/CHANGES.md index e54f6f6108..70dced76f7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,9 +11,11 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( ## [Unreleased] ### Fixed +* Use latest versions of popular style guides for `eslint` tests to fix failing `useEslintXoStandardRules` test. ([#1761](https://github.com/diffplug/spotless/pull/1761), [#1756](https://github.com/diffplug/spotless/issues/1756)) * Add support for `prettier` version `3.0.0` and newer. ([#1760]https://github.com/diffplug/spotless/pull/1760), [#1751](https://github.com/diffplug/spotless/issues/1751)) * Fix npm install calls when npm cache is not up-to-date. ([#1760]https://github.com/diffplug/spotless/pull/1760), [#1750](https://github.com/diffplug/spotless/issues/1750)) ### Changes +* Bump default `eslint` version to latest `8.31.0` -> `8.45.0` ([#1761](https://github.com/diffplug/spotless/pull/1761)) * Bump default `prettier` version to latest (v2) `2.8.1` -> `2.8.8`. ([#1760](https://github.com/diffplug/spotless/pull/1760)) ## [2.40.0] - 2023-07-17 diff --git a/lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java b/lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java index a4480fe7fc..cee51b8518 100644 --- a/lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java +++ b/lib/src/main/java/com/diffplug/spotless/npm/EslintFormatterStep.java @@ -47,7 +47,7 @@ public class EslintFormatterStep { public static final String NAME = "eslint-format"; - public static final String DEFAULT_ESLINT_VERSION = "^8.31.0"; + public static final String DEFAULT_ESLINT_VERSION = "^8.45.0"; public static Map defaultDevDependenciesForTypescript() { return defaultDevDependenciesTypescriptWithEslint(DEFAULT_ESLINT_VERSION); @@ -55,9 +55,9 @@ public static Map defaultDevDependenciesForTypescript() { public static Map defaultDevDependenciesTypescriptWithEslint(String eslintVersion) { Map dependencies = new LinkedHashMap<>(); - dependencies.put("@typescript-eslint/eslint-plugin", "^5.47.0"); - dependencies.put("@typescript-eslint/parser", "^5.47.0"); - dependencies.put("typescript", "^4.9.4"); + dependencies.put("@typescript-eslint/eslint-plugin", "^6.1.0"); + dependencies.put("@typescript-eslint/parser", "^6.1.0"); + dependencies.put("typescript", "^5.1.6"); dependencies.put("eslint", Objects.requireNonNull(eslintVersion)); return dependencies; } diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index b2e3972bba..59f98c1127 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -7,6 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Add support for `prettier` version `3.0.0` and newer. ([#1760]https://github.com/diffplug/spotless/pull/1760), [#1751](https://github.com/diffplug/spotless/issues/1751)) * Fix npm install calls when npm cache is not up-to-date. ([#1760]https://github.com/diffplug/spotless/pull/1760), [#1750](https://github.com/diffplug/spotless/issues/1750)) ### Changes +* Bump default `eslint` version to latest `8.31.0` -> `8.45.0` ([#1761](https://github.com/diffplug/spotless/pull/1761)) * Bump default `prettier` version to latest (v2) `2.8.1` -> `2.8.8`. ([#1760](https://github.com/diffplug/spotless/pull/1760)) ## [6.20.0] - 2023-07-17 @@ -28,6 +29,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Bump default `ktlint` version to latest `0.49.1` -> `0.50.0`. ([#1741](https://github.com/diffplug/spotless/issues/1741)) * Dropped support for `ktlint 0.47.x` following our policy of supporting two breaking changes at a time. * Dropped support for deprecated `useExperimental` parameter in favor of the `ktlint_experimental` property. + ## [6.19.0] - 2023-05-24 ### Added * Support Rome as a formatter for JavaScript and TypeScript code. Adds a new `rome` step to `javascript` and `typescript` formatter configurations. ([#1663](https://github.com/diffplug/spotless/pull/1663)) diff --git a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/TypescriptExtensionTest.java b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/TypescriptExtensionTest.java index eaf2729296..9b4ec8372e 100644 --- a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/TypescriptExtensionTest.java +++ b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/TypescriptExtensionTest.java @@ -17,7 +17,6 @@ import java.io.IOException; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import com.diffplug.spotless.npm.EslintFormatterStep; @@ -170,7 +169,6 @@ void useEslint() throws IOException { } @Test - @Disabled("https://github.com/diffplug/spotless/issues/1756") void useEslintXoStandardRules() throws IOException { setFile(".eslintrc.js").toResource("npm/eslint/typescript/styleguide/xo/.eslintrc.js"); setFile("tsconfig.json").toResource("npm/eslint/typescript/styleguide/xo/tsconfig.json"); diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index dcccd5d2ba..9c5396e535 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -7,6 +7,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( * Add support for `prettier` version `3.0.0` and newer. ([#1760]https://github.com/diffplug/spotless/pull/1760), [#1751](https://github.com/diffplug/spotless/issues/1751)) * Fix npm install calls when npm cache is not up-to-date. ([#1760]https://github.com/diffplug/spotless/pull/1760), [#1750](https://github.com/diffplug/spotless/issues/1750)) ### Changes +* Bump default `eslint` version to latest `8.31.0` -> `8.45.0` ([#1761](https://github.com/diffplug/spotless/pull/1761)) * Bump default `prettier` version to latest (v2) `2.8.1` -> `2.8.8`. ([#1760](https://github.com/diffplug/spotless/pull/1760)) ## [2.38.0] - 2023-07-17 diff --git a/plugin-maven/src/test/java/com/diffplug/spotless/maven/typescript/TypescriptFormatStepTest.java b/plugin-maven/src/test/java/com/diffplug/spotless/maven/typescript/TypescriptFormatStepTest.java index 911cfad201..a09111d30d 100644 --- a/plugin-maven/src/test/java/com/diffplug/spotless/maven/typescript/TypescriptFormatStepTest.java +++ b/plugin-maven/src/test/java/com/diffplug/spotless/maven/typescript/TypescriptFormatStepTest.java @@ -19,7 +19,6 @@ import java.io.IOException; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import com.diffplug.spotless.ProcessRunner; @@ -211,7 +210,6 @@ void eslintStyleguideStandardWithTypescript() throws Exception { } @Test - @Disabled("https://github.com/diffplug/spotless/issues/1756") void eslintStyleguideXo() throws Exception { writePomWithTypescriptSteps( TEST_FILE_PATH, diff --git a/testlib/src/main/java/com/diffplug/spotless/npm/EslintStyleGuide.java b/testlib/src/main/java/com/diffplug/spotless/npm/EslintStyleGuide.java index 62d0b0aa00..874ae1905d 100644 --- a/testlib/src/main/java/com/diffplug/spotless/npm/EslintStyleGuide.java +++ b/testlib/src/main/java/com/diffplug/spotless/npm/EslintStyleGuide.java @@ -29,9 +29,11 @@ public enum EslintStyleGuide { @Override public @Nonnull Map devDependencies() { Map dependencies = new LinkedHashMap<>(); - dependencies.put("eslint-config-standard-with-typescript", "^24.0.0"); - dependencies.put("eslint-plugin-import", "^2.26.0"); - dependencies.put("eslint-plugin-n", "^15.6.0"); + dependencies.put("@typescript-eslint/eslint-plugin", "^5.62.0"); + dependencies.put("@typescript-eslint/parser", "^5.62.0"); + dependencies.put("eslint-config-standard-with-typescript", "^36.0.1"); + dependencies.put("eslint-plugin-import", "^2.27.5"); + dependencies.put("eslint-plugin-n", "^16.0.1"); dependencies.put("eslint-plugin-promise", "^6.1.1"); return dependencies; } @@ -41,7 +43,7 @@ public enum EslintStyleGuide { public @Nonnull Map devDependencies() { Map dependencies = new LinkedHashMap<>(); dependencies.put("eslint-config-xo", "^0.43.1"); - dependencies.put("eslint-config-xo-typescript", "^0.55.1"); + dependencies.put("eslint-config-xo-typescript", "^1.0.0"); return dependencies; } }, @@ -50,7 +52,7 @@ public enum EslintStyleGuide { public @Nonnull Map devDependencies() { Map dependencies = new LinkedHashMap<>(); dependencies.put("eslint-config-airbnb-base", "^15.0.0"); - dependencies.put("eslint-plugin-import", "^2.26.0"); + dependencies.put("eslint-plugin-import", "^2.27.5"); return dependencies; } }, @@ -66,9 +68,9 @@ public enum EslintStyleGuide { @Override public @Nonnull Map devDependencies() { Map dependencies = new LinkedHashMap<>(); - dependencies.put("eslint-config-standard", "^17.0.0"); - dependencies.put("eslint-plugin-import", "^2.26.0"); - dependencies.put("eslint-plugin-n", "^15.6.0"); + dependencies.put("eslint-config-standard", "^17.1.0"); + dependencies.put("eslint-plugin-import", "^2.27.5"); + dependencies.put("eslint-plugin-n", "^16.0.1"); dependencies.put("eslint-plugin-promise", "^6.1.1"); return dependencies; } @@ -113,8 +115,8 @@ public String asGradleMapStringMergedWith(Map devDependencies) { public String asMavenXmlStringMergedWith(Map devDependencies) { return mergedWith(devDependencies).entrySet().stream() - .map(entry -> "<" + entry.getKey() + ">" + entry.getValue() + "") - .collect(Collectors.joining("", "", "")); + .map(entry -> String.format("%s%s", entry.getKey(), entry.getValue())) + .collect(Collectors.joining("", "", "")); } }