Skip to content

Commit

Permalink
fix: resolve failing useEslintXoStandardRules test by bumping eslin…
Browse files Browse the repository at this point in the history
…t and styleguide versions (#1761 fixes #1756)
  • Loading branch information
nedtwigg authored Jul 19, 2023
2 parents 46ee809 + a72b475 commit b6e30f8
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 18 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ 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<String, String> defaultDevDependenciesForTypescript() {
return defaultDevDependenciesTypescriptWithEslint(DEFAULT_ESLINT_VERSION);
}

public static Map<String, String> defaultDevDependenciesTypescriptWithEslint(String eslintVersion) {
Map<String, String> 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;
}
Expand Down
2 changes: 2 additions & 0 deletions plugin-gradle/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions plugin-maven/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ public enum EslintStyleGuide {
@Override
public @Nonnull Map<String, String> devDependencies() {
Map<String, String> 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;
}
Expand All @@ -41,7 +43,7 @@ public enum EslintStyleGuide {
public @Nonnull Map<String, String> devDependencies() {
Map<String, String> 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;
}
},
Expand All @@ -50,7 +52,7 @@ public enum EslintStyleGuide {
public @Nonnull Map<String, String> devDependencies() {
Map<String, String> 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;
}
},
Expand All @@ -66,9 +68,9 @@ public enum EslintStyleGuide {
@Override
public @Nonnull Map<String, String> devDependencies() {
Map<String, String> 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;
}
Expand Down Expand Up @@ -113,8 +115,8 @@ public String asGradleMapStringMergedWith(Map<String, String> devDependencies) {

public String asMavenXmlStringMergedWith(Map<String, String> devDependencies) {
return mergedWith(devDependencies).entrySet().stream()
.map(entry -> "<" + entry.getKey() + ">" + entry.getValue() + "</" + entry.getKey() + ">")
.collect(Collectors.joining("", "<devDependencies>", "</devDependencies>"));
.map(entry -> String.format("<property><name>%s</name><value>%s</value></property>", entry.getKey(), entry.getValue()))
.collect(Collectors.joining("", "<devDependencyProperties>", "</devDependencyProperties>"));
}

}

0 comments on commit b6e30f8

Please sign in to comment.