Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding ESLint as formatter step #1453

Merged
merged 39 commits into from
Jan 10, 2023
Merged

Conversation

simschla
Copy link
Contributor

@simschla simschla commented Jan 4, 2023

This adds ESLint as an npm-based formatter to spotless-gradle and spotless-maven.

ESLint is the defacto-standard for linting javascript and typescript files - and it can also be used to automatically fix lots of linting errors - hence making it suitable to be used as a formatter.

TBD: ESLint would be a very likely candidate to be used in #1097 in my opinion.

👉 At the same time default prettier version is bumped to latest version, since I've been testing and refactoring parts of the npm-based code parts.

@simschla simschla force-pushed the feature/eslint-npm branch 2 times, most recently from 603da1f to cc3047c Compare January 5, 2023 06:19
@simschla
Copy link
Contributor Author

simschla commented Jan 5, 2023

@nedtwigg I have no idea why circleci fails to run "assemble_and_test" - anything wrong on my end?

@simschla simschla force-pushed the feature/eslint-npm branch from cc3047c to 3540242 Compare January 5, 2023 08:22
@simschla
Copy link
Contributor Author

simschla commented Jan 5, 2023

@nedtwigg I have no idea why circleci fails to run "assemble_and_test" - anything wrong on my end?

Never mind, now it works...!

Copy link
Member

@nedtwigg nedtwigg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WOW! This PR is HUGE and GREAT. Just a teensy bit of discussion and I'm ready to merge!

…ure/eslint-npm

# Conflicts:
#	CHANGES.md
#	plugin-gradle/CHANGES.md
#	plugin-maven/CHANGES.md
#	plugin-maven/README.md
@simschla
Copy link
Contributor Author

@nedtwigg I'm finished with removing the styleGuide-api.
The two discussed issues have been raised as #1479 and #1480.
PR is ready to be merged from my side.

@nedtwigg nedtwigg merged commit 1f41cb2 into diffplug:main Jan 10, 2023
@simschla simschla deleted the feature/eslint-npm branch January 10, 2023 18:14
@nedtwigg
Copy link
Member

Published in plugin-gradle 6.13.0 and plugin-maven 2.30.0.

benkard added a commit to benkard/mulkcms2 that referenced this pull request Apr 2, 2023
…2.0 (mulk/mulkcms2!16)

This MR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [com.diffplug.spotless:spotless-maven-plugin](https://github.com/diffplug/spotless) | build | minor | `2.31.0` -> `2.32.0` |

---

### Release Notes

<details>
<summary>diffplug/spotless</summary>

### [`v2.32.0`](https://github.com/diffplug/spotless/blob/HEAD/CHANGES.md#&#8203;2320---2023-01-13)

##### Added

-   Add option `editorConfigFile` for `ktLint` [#&#8203;142](diffplug/spotless#142)
    -   **POTENTIALLY BREAKING** `ktlint` step now modifies license headers. Make sure to put `licenseHeader` *after* `ktlint`.
-   Added `skipLinesMatching` option to `licenseHeader` to support formats where license header cannot be immediately added to the top of the file (e.g. xml, sh). ([#&#8203;1441](diffplug/spotless#1441)).
-   Add YAML support through Jackson ([#&#8203;1478](diffplug/spotless#1478))
-   Added support for npm-based [ESLint](https://eslint.org/)-formatter for javascript and typescript ([#&#8203;1453](diffplug/spotless#1453))
-   Better suggested messages when user's default is set by JVM limitation. ([#&#8203;995](diffplug/spotless#995))

##### Fixed

-   Support `ktlint` 0.48+ new rule disabling syntax ([#&#8203;1456](diffplug/spotless#1456)) fixes ([#&#8203;1444](diffplug/spotless#1444))
-   Fix subgroups leading catch all matcher.

##### Changes

-   Bump default version for `prettier` from `2.0.5` to `2.8.1` ([#&#8203;1453](diffplug/spotless#1453))
-   Bump the dev version of Gradle from `7.5.1` to `7.6` ([#&#8203;1409](diffplug/spotless#1409))
    -   We also removed the no-longer-required dependency `org.codehaus.groovy:groovy-xml`
-   Breaking changes to Spotless' internal testing infrastructure `testlib` ([#&#8203;1443](diffplug/spotless#1443))
    -   `ResourceHarness` no longer has any duplicated functionality which was also present in `StepHarness`
    -   `StepHarness` now operates on `Formatter` rather than a `FormatterStep`
    -   `StepHarnessWithFile` now takes a `ResourceHarness` in its constructor to handle the file manipulation parts
    -   Standardized that we test exception *messages*, not types, which will ease the transition to linting later on
    -   Bump default `ktlint` version to latest `0.47.1` -> `0.48.1` ([#&#8203;1456](diffplug/spotless#1456))
-   Switch our publishing infrastructure from CircleCI to GitHub Actions ([#&#8203;1462](diffplug/spotless#1462)).
    -   Help wanted for moving our tests too ([#&#8203;1472](diffplug/spotless#1472))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC4yNC4wIiwidXBkYXRlZEluVmVyIjoiMzQuMjQuMCJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants