Docs on linting
@@ -74,6 +74,25 @@ You can use IntelliJ IDEA (preferred) or VS Code (alternate) in the browser.
If you prefer using IntelliJ IDEA, you can setup Gitpod integration with JetBrains Gateway using the instructions on [gitpod.io](https://www.gitpod.io/docs/ides-and-editors/intellij),
which will open the workspace in IntelliJ IDEA using JetBrains Gateway.
+### Linting
+
+For linting we use a number of tools:
+
+- [checkstyle](https://checkstyle.sourceforge.io/)
+- [eslint](https://eslint.org/)
+- [prettier](https://prettier.io/)
+- [spotless](https://github.com/diffplug/spotless)
+- [stylelint](https://stylelint.io/)
+
+These are all configured to run as part of the Maven build, although they will be skipped if you are building with the `quick-build` profile.
+
+To automatically fix most issues run:
+
+```bash
+mvn spotless:apply
+mvn -pl war frontend:yarn -Dfrontend.yarn.arguments=lint:fix
+```
+
## Testing changes
Jenkins core includes unit and functional tests as a part of the repository.
@@ -186,6 +205,11 @@ Pending the merge and release of this patch, IntelliJ IDEA users should work aro
Failure to work around the problem as described above will result in a `could not open '{jenkins.addOpens}'` failure when running tests in IntelliJ IDEA.
+### Code formatting for frontend files
+
+Install the [Prettier plugin](https://www.jetbrains.com/help/idea/prettier.html).
+Follow the instructions on the above JetBrains page to configure it how you wish. 'On code reformatting' is a good option.
+
## Copyright
The Jenkins core is licensed under [MIT license](./LICENSE.txt), with a few exceptions in bundled classes.
