Standalone Recipes
This doc contains recipes that are not included as part of any larger composite recipe. These recipes can be run independently and are not bundled with other recipes.
Total standalone recipes: 1006
org.openrewrite.meta:rewrite-analysis
- org.openrewrite.analysis.controlflow.ControlFlowVisualization
- Control flow visualization
- Visualize the control flow of a Java program.
- org.openrewrite.analysis.search.FindFlowBetweenMethods
- Finds flow between two methods
- Takes two patterns for the start/end methods to find flow between.
- org.openrewrite.analysis.search.FindMethods
- Find method usages
- Find method usages by pattern.
- org.openrewrite.analysis.search.UriCreatedWithHttpScheme
- URIs created with an HTTP scheme
- This is a sample recipe demonstrating a simple application of local data flow analysis.
org.openrewrite.recipe:rewrite-all
- org.openrewrite.FindCallGraph
- Find call graph
- Produces a data table where each row represents a method call.
- org.openrewrite.FindDuplicateSourceFiles
- Find duplicate source files
- Record the presence of LSTs with duplicate paths, indicating that the same file was parsed more than once.
- org.openrewrite.LanguageComposition
- Language composition report
- Counts the number of lines of the various kinds of source code and data formats parsed by OpenRewrite. Comments are not included in line counts. This recipe emits its results as two data tables, making no changes to any source file. One data table is per-file, the other is per-repository.
org.openrewrite.recipe:rewrite-apache
- org.openrewrite.apache.commons.codec.ApacheBase64ToJavaBase64
- Prefer
java.util.Base64 - Prefer the Java standard library's
java.util.Base64over third-party usage of apache'sapache.commons.codec.binary.Base64.
- Prefer
- org.openrewrite.apache.commons.io.ApacheCommonsFileUtilsRecipes
ApacheCommonsFileUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.apache.commons.io.ApacheCommonsFileUtils.
- org.openrewrite.apache.commons.io.ApacheFileUtilsToJavaFiles
- Prefer
java.nio.file.Files - Prefer the Java standard library's
java.nio.file.Filesover third-party usage of apache'sapache.commons.io.FileUtils.
- Prefer
- org.openrewrite.apache.commons.io.ApacheIOUtilsUseExplicitCharset
- Use IOUtils method that include their charset encoding
- Use
IOUtilsmethod invocations that include the charset encoding instead of using the deprecated versions that do not include a charset encoding. (e.g. convertsIOUtils.readLines(inputStream)toIOUtils.readLines(inputStream, StandardCharsets.UTF_8).
- org.openrewrite.apache.commons.lang.ApacheCommonsStringUtilsRecipes
ApacheCommonsStringUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.apache.commons.lang.ApacheCommonsStringUtils.
- org.openrewrite.apache.commons.lang.IsNotEmptyToJdk
- Replace any StringUtils#isEmpty(String) and #isNotEmpty(String)
- Replace any
StringUtils#isEmpty(String)and#isNotEmpty(String)withs == null || s.isEmpty()ands != null && !s.isEmpty().
- org.openrewrite.apache.maven.shared.MavenSharedStringUtilsRecipes
MavenSharedStringUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.apache.maven.shared.MavenSharedStringUtils.
- org.openrewrite.codehaus.plexus.AbstractLogEnabledToSlf4j
- Migrate from Plexus
AbstractLogEnabledto SLF4J - Introduce a SLF4J
Loggerfield and replace calls togetLogger()with calls to the field.
- Migrate from Plexus
- org.openrewrite.codehaus.plexus.PlexusFileUtilsRecipes
PlexusFileUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.codehaus.plexus.PlexusFileUtils.
- org.openrewrite.codehaus.plexus.PlexusStringUtilsRecipes
PlexusStringUtilsRefaster recipes- Refaster template recipes for
org.openrewrite.codehaus.plexus.PlexusStringUtils.
org.openrewrite.recipe:rewrite-codemods
- org.openrewrite.codemods.Biome
- Biome recommendations
- Run Biome recommended settings on your projects.
- org.openrewrite.codemods.Putout
- Run Putout
- Run Putout on your projects.
- org.openrewrite.codemods.ReactI18Next
- React i18next internationalization
- Automatically internationalizes React applications by extracting hardcoded strings and replacing them with react-i18next translation calls. Handles JSX text, attributes, and template literals with variables. Creates and updates a translation JSON file with extracted strings.
- org.openrewrite.codemods.UI5
- Lint UI5 projects with UI5 linter
- Runs the UI5 Linter, a static code analysis tool for UI5 projects. It checks JavaScript, TypeScript, XML, JSON, and other files in your project and reports findings.
org.openrewrite.recipe:rewrite-dropwizard
- org.openrewrite.java.dropwizard.method.RemoveUnnecessarySuperCalls
- Remove
supercalls when the class does not extend another class - Removes calls to
super(...)orsuper.someMethod(...)if the class does not have a real superclass besidesjava.lang.Object.
- Remove
org.openrewrite.recipe:rewrite-feature-flags
- org.openrewrite.featureflags.ff4j.RemoveCheck
- Remove FF4j's
checkfor feature key - Replace
check()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove FF4j's
- org.openrewrite.featureflags.ff4j.search.FindFeatureFlag
- Find a FF4j feature flag
- Find a FF4j feature flag.
- org.openrewrite.featureflags.launchdarkly.ChangeVariationDefault
- Change the default value for feature key
- Change the default value for
Variationinvocations for feature key.
- org.openrewrite.featureflags.launchdarkly.RemoveBoolVariation
- Remove LaunchDarkly's
boolVariationfor feature key - Replace
boolVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.RemoveDoubleVariation
- Remove LaunchDarkly's
doubleVariationfor feature key - Replace
doubleVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.RemoveIntVariation
- Remove LaunchDarkly's
intVariationfor feature key - Replace
intVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.RemoveStringVariation
- Remove LaunchDarkly's
stringVariationfor feature key - Replace
stringVariationinvocations for feature key with value, and simplify constant if branch execution.
- Remove LaunchDarkly's
- org.openrewrite.featureflags.launchdarkly.search.FindFeatureFlag
- Find a LaunchDarkly feature flag
- Find a LaunchDarkly feature flag.
- org.openrewrite.featureflags.openfeature.RemoveGetBooleanValue
- Remove OpenFeature's
getBooleanValuefor feature key - Replace
getBooleanValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.RemoveGetDoubleValue
- Remove OpenFeature's
getDoubleValuefor feature key - Replace
getDoubleValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.RemoveGetIntegerValue
- Remove OpenFeature's
getIntegerValuefor feature key - Replace
getIntegerValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.RemoveGetStringValue
- Remove OpenFeature's
getStringValuefor feature key - Replace
getStringValue()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove OpenFeature's
- org.openrewrite.featureflags.openfeature.search.FindFeatureFlag
- Find an OpenFeature feature flag
- Find an OpenFeature feature flag.
- org.openrewrite.featureflags.quarkus.RemoveGetInt
- Remove Quarkus feature flag's
getIntfor feature key - Replace
getInt()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Quarkus feature flag's
- org.openrewrite.featureflags.quarkus.RemoveGetString
- Remove Quarkus feature flag's
getStringfor feature key - Replace
getString()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Quarkus feature flag's
- org.openrewrite.featureflags.quarkus.RemoveIsEnabled
- Remove Quarkus feature flag's
isEnabledfor feature key - Replace
isEnabled()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Quarkus feature flag's
- org.openrewrite.featureflags.quarkus.search.FindFeatureFlag
- Find a Quarkus feature flag
- Find a Quarkus feature flag.
- org.openrewrite.featureflags.unleash.RemoveIsEnabled
- Remove Unleash's
isEnabledfor feature key - Replace
isEnabled()invocations forfeatureKeywithreplacementValue, and simplify constant if branch execution.
- Remove Unleash's
- org.openrewrite.featureflags.unleash.search.FindFeatureFlag
- Find an Unleash feature flag
- Find an Unleash feature flag.
org.openrewrite.recipe:rewrite-github-actions
- org.openrewrite.github.AddCronTrigger
- Add cron workflow trigger
- The
scheduleevent allows you to trigger a workflow at a scheduled time.
- org.openrewrite.github.AddDependabotCooldown
- Add cooldown periods to Dependabot configuration
- Adds a
cooldownsection to each update configuration in Dependabot files. Supportsdefault-days,semver-major-days,semver-minor-days,semver-patch-days,include, andexcludeoptions. This implements a security best practice where dependencies are not immediately adopted upon release, allowing time for security vendors to identify potential supply chain compromises. Cooldown applies only to version updates, not security updates. Read more about dependency cooldowns. The available configuration options for dependabot are listed on GitHub.
- org.openrewrite.github.AutoCancelInProgressWorkflow
- Cancel in-progress workflow when it is triggered again
- When a workflow is already running and would be triggered again, cancel the existing workflow. See
styfle/cancel-workflow-actionfor details.
- org.openrewrite.github.FindMissingTimeout
- Find jobs missing timeout
- Find GitHub Actions jobs missing a timeout.
- org.openrewrite.github.IsGitHubActionsWorkflow
- Is GitHub Actions Workflow
- Checks if the file is a GitHub Actions workflow file.
- org.openrewrite.github.PreferSecretsInheritWorkflow
- Use
secrets: inheritif possible - Pass all secrets to a reusable workflow using
secrets: inherit. See Simplify using secrets with reusable workflows for details.
- Use
- org.openrewrite.github.PreferTemurinDistributions
- Use
actions/setup-javatemurindistribution as they are cached in hosted runners - Host runners include Temurin by default as part of the hosted tool cache. Using Temurin speeds up builds as there is no need to download and configure the Java SDK with every build.
- Use
- org.openrewrite.github.RemoveAllCronTriggers
- Remove all cron triggers
- Removes all cron triggers from a workflow.
- org.openrewrite.github.RemoveUnusedWorkflowDispatchInputs
- Remove unused workflow dispatch inputs
- Remove workflow_dispatch inputs that are not referenced anywhere in the workflow file.
- org.openrewrite.github.RemoveWorkflowInputArgument
- Remove workflow input argument
- Remove a specific input argument from calls to a reusable workflow.
- org.openrewrite.github.ReplaceRunners
- Replace runners for a job
- Replaces the runners of a given job.
- org.openrewrite.github.SetupJavaAdoptOpenJDKToTemurin
- Use
actions/setup-javatemurindistribution - Adopt OpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from adopt to temurin to keep receiving software and security updates. See more details in the Good-bye AdoptOpenJDK post.
- Use
- org.openrewrite.github.SetupJavaAdoptOpenj9ToSemeru
- Use
actions/setup-javaIBMsemerudistribution - Adopt OpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from adopt-openj9 to IBM semeru to keep receiving software and security updates. See more details in the Good-bye AdoptOpenJDK post.
- Use
- org.openrewrite.github.SetupJavaCaching
- Setup Java dependency caching
- GitHub actions supports dependency caching on Maven and Gradle projects. See the blog post.
- org.openrewrite.github.SetupNodeUpgradeNodeVersion
- Upgrade
actions/setup-nodenode-version - Update the Node.js version used by
actions/setup-nodeif it is below the expected version number.
- Upgrade
- org.openrewrite.github.SetupPythonToUv
- Replace
actions/setup-pythonwithastral-sh/setup-uv - Replace
actions/setup-pythonaction withastral-sh/setup-uvaction for faster Python environment setup and dependency management. Benefits of UV: - Significantly faster package installation and environment setup - Built-in dependency resolution and locking - Integrated caching for improved CI performance - Drop-in replacement for pip workflows Transformations applied: -actions/setup-python@v5→astral-sh/setup-uv@v6-cache: 'pip'→enable-cache: 'true'-pip install -r requirements.txt→uv sync(configurable strategy) -python -m <module>→uv run <module>- Removes unnecessarypip install --upgrade pipsteps Sync strategies: -basic: Basic synchronization (uv sync) -locked: Use locked dependencies (uv sync --locked) -full: Install all extras and dev dependencies (uv sync --all-extras --dev) See the UV GitHub integration guide for more details.
- Replace
- org.openrewrite.github.UpgradeSlackNotificationVersion2
- Upgrade
slackapi/slack-github-action - Update the Slack GitHub Action to use version 2.0.
- Upgrade
- org.openrewrite.github.security.AnonymousJobsRecipe
- Find jobs without descriptive names
- Find jobs that lack descriptive names, making them harder to identify in workflow runs. Jobs without
nameproperties default to their job ID, which may not be descriptive. Based on zizmor's anonymous-definition audit.
org.openrewrite.recipe:rewrite-gitlab
- org.openrewrite.gitlab.AddCache
- Add cache configuration
- Add
cacheconfiguration to.gitlab-ci.ymlfor faster builds.
- org.openrewrite.gitlab.AddComponent
- Add GitLab component
- Add a GitLab component to an existing list, or add a new list where none was present.
- org.openrewrite.gitlab.AddDefaultKeyword
- Add default keyword
- Add or update a keyword in the
defaultsection of.gitlab-ci.yml.
- org.openrewrite.gitlab.AddStages
- Add GitLab stages
- Add or Update the set of stages defined in
.gitlab-ci.yml.
- org.openrewrite.gitlab.AddTemplate
- Add GitLab template
- Add a GitLab template to an existing list, or add a new list where none was present.
- org.openrewrite.gitlab.ChangeComponent
- Change GitLab Component
- Change a GitLab Component in use.
- org.openrewrite.gitlab.ChangeTemplate
- Change GitLab template
- Change a GitLab template in use.
- org.openrewrite.gitlab.RemoveTemplate
- Remove GitLab template
- Remove a GitLab template from use.
- org.openrewrite.gitlab.search.FindComponent
- Find GitLab Component
- Find a GitLab Component in use.
- org.openrewrite.gitlab.search.FindTemplate
- Find GitLab Template
- Find a GitLab Template in use.
org.openrewrite.recipe:rewrite-hibernate
- org.openrewrite.hibernate.MigrateUserType
- Migrate
UserTypeto Hibernate 6 - With Hibernate 6 the
UserTypeinterface received a type parameter making it more strictly typed. This recipe applies the changes required to adhere to this change.
- Migrate
org.openrewrite.recipe:rewrite-java-dependencies
- org.openrewrite.java.dependencies.DependencyResolutionDiagnostic
- Dependency resolution diagnostic
- Recipes which manipulate dependencies must be able to successfully access the artifact repositories and resolve dependencies from them. This recipe produces two data tables used to understand the state of dependency resolution. The Repository accessibility report lists all the artifact repositories known to the project and whether respond to network access. The network access is attempted while the recipe is run and so is representative of current conditions. The Gradle dependency configuration errors lists all the dependency configurations that failed to resolve one or more dependencies when the project was parsed. This is representative of conditions at the time the LST was parsed.
- org.openrewrite.java.dependencies.FindDependency
- Find Maven and Gradle dependencies
- Finds direct dependencies declared in Maven and Gradle build files. This does not search transitive dependencies. To detect both direct and transitive dependencies use
org.openrewrite.java.dependencies.DependencyInsightThis recipe works for both Maven and Gradle projects.
- org.openrewrite.java.dependencies.FindRepositoryOrder
- Maven repository order
- Determine the order in which dependencies will be resolved for each
pom.xmlorbuild.gradlebased on its defined repositories and effective settings.
- org.openrewrite.java.dependencies.RelocatedDependencyCheck
- Find relocated dependencies
- Find Maven and Gradle dependencies and Maven plugins that have relocated to a new
groupIdorartifactId. Relocation information comes from the oga-maven-plugin maintained by Jonathan Lermitage, Filipe Roque and others. This recipe makes no changes to any source file by default. AddchangeDependencies=trueto change dependencies, but note that you might need to run additional recipes to update imports and adopt other breaking changes.
- org.openrewrite.java.dependencies.UpgradeTransitiveDependencyVersion
- Upgrade transitive Gradle or Maven dependencies
- Upgrades the version of a transitive dependency in a Maven pom.xml or Gradle build.gradle. Leaves direct dependencies unmodified. Can be paired with the regular Upgrade Dependency Version recipe to upgrade a dependency everywhere, regardless of whether it is direct or transitive.
- org.openrewrite.java.dependencies.search.DoesNotIncludeDependency
- Does not include dependency for Gradle and Maven
- A precondition which returns false if visiting a Gradle file / Maven pom which includes the specified dependency in the classpath of some Gradle configuration / Maven scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
- org.openrewrite.java.dependencies.search.FindDuplicateClasses
- Find duplicate classes on the classpath
- Detects classes that appear in multiple dependencies on the classpath. This is similar to what the Maven duplicate-finder-maven-plugin does. Duplicate classes can cause runtime issues when different versions of the same class are loaded.
- org.openrewrite.java.dependencies.search.FindMinimumDependencyVersion
- Find the oldest matching dependency version in use
- The oldest dependency version in use is the lowest dependency version in use in any source set of any subproject of a repository. It is possible that, for example, the main source set of a project uses Jackson 2.11, but a test source set uses Jackson 2.16. In this case, the oldest Jackson version in use is Java 2.11.
- org.openrewrite.java.dependencies.search.FindMinimumJUnitVersion
- Find minimum JUnit version
- A recipe to find the minimum version of JUnit dependencies. This recipe is designed to return the minimum version of JUnit in a project. It will search for JUnit 4 and JUnit 5 dependencies in the project. If both versions are found, it will return the minimum version of JUnit 4. If a minimumVersion is provided, the recipe will search to see if the minimum version of JUnit used by the project is no lower than the minimumVersion. For example: if the minimumVersion is 4, and the project has JUnit 4.12 and JUnit 5.7, the recipe will return JUnit 4.12. If the project has only JUnit 5.7, the recipe will return JUnit 5.7. Another example: if the minimumVersion is 5, and the project has JUnit 4.12 and JUnit 5.7, the recipe will not return any results.
- org.openrewrite.java.dependencies.search.RepositoryHasDependency
- Repository has dependency
- Searches for both Gradle and Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a repository with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use a springframework dependency, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) or pom.xml file applying the plugin, use theFindDependencyrecipe instead.
org.openrewrite.recipe:rewrite-jenkins
- org.openrewrite.jenkins.AddJellyXmlDeclaration
- Add XML declaration to Jelly files
- Ensure the XML declaration
<?jelly escape-by-default='true'?>is present in all.jellyfiles.
- org.openrewrite.jenkins.CreateIndexJelly
- Create
index.jellyif it doesn't exist - Jenkins tooling requires
src/main/resources/index.jellyexists with a description.
- Create
- org.openrewrite.jenkins.IsJenkinsPlugin
- Is the project a Jenkins plugin?
- Checks if the project is a Jenkins plugin by the presence of a managed version of
jenkins-core.
- org.openrewrite.jenkins.github.AddTeamToCodeowners
- Add plugin developer team to CODEOWNERS
- Adds the
\{artifactId\}-plugin-developersteam to all files in.github/CODEOWNERSif absent.
org.openrewrite.recipe:rewrite-liberty
- org.openrewrite.java.liberty.ReplaceWSPrincipalGetCredential
- Replace
WSPrincipal.getCredential()withWSSubjectlookup - Replaces
WSCredential credential = WSPrincipal.getCredential();with anullinitializer +try/catchlookup.
- Replace
- org.openrewrite.xml.liberty.WebBeansXmlRule
- Replace beans.xml file
- This Recipe replaces OpenWebBeans schema in every beans.xml with the standard CDI schema.
org.openrewrite.recipe:rewrite-logging-frameworks
- org.openrewrite.java.logging.SystemPrintToLogging
- Use logger instead of system print statements
- Replace
System.outandSystem.errprint statements with a logger.
- org.openrewrite.java.logging.log4j.LoggingExceptionConcatenationRecipe
- Log exceptions as parameters rather than as string concatenations
- By using the exception as another parameter you get the whole stack trace.
- org.openrewrite.java.logging.log4j.PrependRandomName
- Prepend a random name to each Log4J statement
- To make finding the callsite of a logging statement easier in code search.
- org.openrewrite.java.logging.logback.ConfigureLoggerLevel
- Configure logback logger level
- Within logback.xml configuration files sets the specified log level for a particular class. Will not create a logback.xml if one does not already exist.
- org.openrewrite.java.logging.slf4j.ChangeLogLevel
- Change SLF4J log level
- Change the log level of SLF4J log statements.
org.openrewrite.recipe:rewrite-micrometer
- org.openrewrite.micrometer.dropwizard.FindDropwizardMetrics
- Find Dropwizard metrics
- Find uses of Dropwizard metrics that could be converted to a more modern metrics instrumentation library.
org.openrewrite.recipe:rewrite-micronaut
- org.openrewrite.java.micronaut.FindPropertiesConfig
- Find Micronaut properties config
- Find Micronaut properties configuration files.
- org.openrewrite.java.micronaut.FindYamlConfig
- Find Micronaut yaml config
- Find Micronaut yaml configuration files.
org.openrewrite.recipe:rewrite-migrate-java
- org.openrewrite.java.migrate.AddJDeprScanPlugin
- Add
JDeprScanMaven Plug-in - Add the
JDeprScanMaven plugin to scan class files for uses of deprecated APIs.
- Add
- org.openrewrite.java.migrate.AddSuppressionForIllegalReflectionWarningsPlugin
- Add maven jar plugin to suppress illegal reflection warnings
- Adds a maven jar plugin that's configured to suppress Illegal Reflection Warnings.
- org.openrewrite.java.migrate.DontOverfetchDto
- Replace DTO method parameters with data elements
- Replace method parameters that have DTOs with their data elements when only the specified data element is used.
- org.openrewrite.java.migrate.RemoveIllegalSemicolons
- Remove illegal semicolons
- Remove semicolons after package declarations and imports, no longer accepted in Java 21 as of JDK-8027682.
- org.openrewrite.java.migrate.ReplaceStringLiteralValue
- Replace
Stringliteral - Replace the value of a complete
Stringliteral.
- Replace
- org.openrewrite.java.migrate.UseTabsOrSpaces
- Force indentation to either tabs or spaces
- This is useful for one-off migrations of a codebase that has mixed indentation styles, while preserving all other auto-detected formatting rules.
- org.openrewrite.java.migrate.io.AddInputStreamBulkReadMethod
- Add bulk read method to
InputStreamimplementations - Adds a
read(byte[], int, int)method toInputStreamsubclasses that only override the single-byteread()method. Java's defaultInputStream.read(byte[], int, int)implementation calls the single-byteread()method in a loop, which can cause severe performance degradation (up to 350x slower) for bulk reads. This recipe detectsInputStreamimplementations that delegate to another stream and adds the missing bulk read method to delegate bulk reads as well.
- Add bulk read method to
- org.openrewrite.java.migrate.io.ReplaceFileInOrOutputStreamFinalizeWithClose
- Replace invocations of
finalize()onFileInputStreamandFileOutputStreamwithclose() - Replace invocations of the deprecated
finalize()method onFileInputStreamandFileOutputStreamwithclose().
- Replace invocations of
- org.openrewrite.java.migrate.jakarta.HasNoJakartaAnnotations
- Project has no Jakarta annotations
- Mark all source as found per
JavaProjectwhere no Jakarta annotations are found. This is useful mostly as a precondition for recipes that require Jakarta annotations to be present.
- org.openrewrite.java.migrate.javax.AddScopeToInjectedClass
- Add scope annotation to injected classes
- Finds member variables annotated with
@Inject' and applies@Dependent` scope annotation to the variable's type.
- org.openrewrite.java.migrate.lang.StringRulesRecipes
- A collection of
Stringrules - A collection of rules for refactoring methods called on
Stringinstances in Java code.
- A collection of
- org.openrewrite.java.migrate.lang.UseStringIsEmptyRecipe
- Replace
0 < s.length()with!s.isEmpty() - Replace
0 < s.length()ands.length() != 0with!s.isEmpty().
- Replace
- org.openrewrite.java.migrate.lombok.AdoptLombokGetterMethodNames
- Rename getter methods to fit Lombok
- Rename methods that are effectively getter to the name Lombok would give them. Limitations: - If two methods in a class are effectively the same getter then one's name will be corrected and the others name will be left as it is. - If the correct name for a method is already taken by another method then the name will not be corrected. - Method name swaps or circular renaming within a class cannot be performed because the names block each other. E.g.
int getFoo() \{ return ba; \} int getBa() \{ return foo; \}stays as it is.
- org.openrewrite.java.migrate.lombok.AdoptLombokSetterMethodNames
- Rename setter methods to fit Lombok
- Rename methods that are effectively setter to the name Lombok would give them. Limitations: - If two methods in a class are effectively the same setter then one's name will be corrected and the others name will be left as it is. - If the correct name for a method is already taken by another method then the name will not be corrected. - Method name swaps or circular renaming within a class cannot be performed because the names block each other. E.g.
int getFoo() \{ return ba; \} int getBa() \{ return foo; \}stays as it is.
- org.openrewrite.java.migrate.lombok.LombokValueToRecord
- Convert
@lombok.Valueclass to Record - Convert Lombok
@Valueannotated classes to standard Java Records.
- Convert
- org.openrewrite.java.migrate.maven.UpdateMavenProjectPropertyJavaVersion
- Update Maven Java project properties
- The Java version is determined by several project properties, including: *
java.version*jdk.version*javaVersion*jdkVersion*maven.compiler.source*maven.compiler.target*maven.compiler.release*release.versionIf none of these properties are in use and the maven compiler plugin is not otherwise configured, adds themaven.compiler.releaseproperty.
- org.openrewrite.java.migrate.maven.UseMavenCompilerPluginReleaseConfiguration
- Use Maven compiler plugin release configuration
- Replaces any explicit
sourceortargetconfiguration (if present) on themaven-compiler-pluginwithrelease, and updates thereleasevalue if needed. Will not downgrade the Java version if the current version is higher.
- org.openrewrite.java.migrate.metrics.SimplifyMicrometerMeterTags
- Simplify Micrometer meter tags
- Use the simplest method to add new tags.
- org.openrewrite.java.migrate.net.URLConstructorsToNewURI
- Convert
new URL(String, ..)tonew URI(String, ..).toURL() - Converts
new URL(String, ..)constructors tonew URI(String, ..).toURL().
- Convert
- org.openrewrite.java.migrate.search.AboutJavaVersion
- Find which Java version is in use
- A diagnostic for studying the distribution of Java language version levels (both source and target compatibility across files and source sets).
- org.openrewrite.java.migrate.search.FindDataUsedOnDto
- Find data used on DTOs
- Find data elements used on DTOs. This is useful to provide information where data over-fetching may be a problem.
- org.openrewrite.java.migrate.search.FindDtoOverfetching
- Find methods that only use one DTO data element
- Find methods that have 'opportunities' for improvement.
- org.openrewrite.java.migrate.search.FindInternalJavaxApis
- Find uses of internal javax APIs
- The libraries that define these APIs will have to be migrated before any of the repositories that use them.
- org.openrewrite.java.migrate.search.FindJavaVersion
- Find Java versions in use
- Finds Java versions in use.
- org.openrewrite.java.migrate.search.FindLocaleDateTimeFormats
- Find locale-sensitive date/time formatting
- Finds usages of locale-based date/time formatting APIs that may be affected by JDK 20+ CLDR locale data changes, where the space before AM/PM was changed from a regular space to a narrow no-break space (NNBSP).
- org.openrewrite.java.migrate.search.PlanJavaMigration
- Plan a Java version migration
- Study the set of Java versions and associated tools in use across many repositories.
- org.openrewrite.java.migrate.util.RemoveFinalizerFromZip
- Remove invocations of deprecated invocations from Deflater, Inflater, ZipFile
- Remove invocations of finalize() deprecated invocations from Deflater, Inflater, ZipFile.
- org.openrewrite.java.migrate.util.UseEnumSetOf
- Prefer
EnumSet of(..) - Prefer
EnumSet of(..)instead of usingSet of(..)when the arguments are enums in Java 9 or higher.
- Prefer
- org.openrewrite.java.migrate.util.UseListOf
- Prefer
List.of(..) - Prefer
List.of(..)instead of usingjava.util.List#add(..)in anonymous ArrayList initializers in Java 10 or higher. This recipe will not modify code where the List is later mutated sinceList.ofreturns an immutable list.
- Prefer
- org.openrewrite.java.migrate.util.UseSetOf
- Prefer
Set.of(..) - Prefer
Set.of(..)instead of usingjava.util.Set#add(..)in anonymous HashSet initializers in Java 10 or higher. This recipe will not modify code where the Set is later mutated sinceSet.ofreturns an immutable set.
- Prefer
org.openrewrite.recipe:rewrite-quarkus
- org.openrewrite.quarkus.Slf4jToQuarkusLogger
- Migrate SLF4J Logger injection and usage to Quarkus static
Log - Removes usage of SLF4J Logger fields, adjusts imports, and replaces logger method calls with static Quarkus Log calls, including message formatting and method renaming for parameterized logging.
- Migrate SLF4J Logger injection and usage to Quarkus static
- org.openrewrite.quarkus.search.FindQuarkusProfiles
- Search Quarkus profiles
- Search the properties for existing Quarkus profiles.
- org.openrewrite.quarkus.search.FindQuarkusProperties
- Find Quarkus property
- Finds occurrences of a Quarkus property key.
org.openrewrite.recipe:rewrite-rewrite
- org.openrewrite.java.recipes.DeclarativeSingleton
- Make declarative recipes singletons
- Adds the
org.openrewrite.Singletonprecondition to declarative YAML recipes to ensure they only execute once, even when included multiple times.
- org.openrewrite.java.recipes.FindRecipes
- Find OpenRewrite recipes
- This recipe finds all OpenRewrite recipes, primarily to produce a data table that is being used to experiment with fine-tuning a large language model to produce more recipes.
org.openrewrite.recipe:rewrite-spring
- org.openrewrite.gradle.spring.AddSpringDependencyManagementPlugin
- Add
io.spring.dependency-managementplugin, if in use - Prior to Spring Boot 2.0 the dependency management plugin was applied automatically as part of the overall spring boot plugin. Afterwards the dependency-management plugin must be applied explicitly, or Gradle's
platform()feature may be used instead. This recipe makes usage of io-spring.dependency-management explicit in anticipation of upgrade to Spring Boot 2.0 or later.
- Add
- org.openrewrite.java.spring.ExpandProperties
- Expand Spring YAML properties
- Expand YAML properties to not use the dot syntax shortcut.
- org.openrewrite.java.spring.ImplicitWebAnnotationNames
- Remove implicit web annotation names
- Removes implicit web annotation names.
- org.openrewrite.java.spring.NoHttpExchangeAnnotation
- Remove
HttpExchangeannotations - Replace method declaration
@HttpExchangeannotations with@GetExchange,@PostExchange, etc.
- Remove
- org.openrewrite.java.spring.RenameBean
- Rename bean
- Renames a Spring bean, both declaration and references.
- org.openrewrite.java.spring.UpdateApiManifest
- Update the API manifest
- Keep a consolidated manifest of the API endpoints that this application exposes up-to-date.
- org.openrewrite.java.spring.boot2.search.IntegrationSchedulerPoolRecipe
- Integration scheduler pool size
- Spring Integration now reuses an available
TaskSchedulerrather than configuring its own. In a typical application setup relying on the auto-configuration, this means that Spring Integration uses the auto-configured task scheduler that has a pool size of 1. To restore Spring Integration’s default of 10 threads, use thespring.task.scheduling.pool.sizeproperty.
- org.openrewrite.java.spring.boot3.AddRouteTrailingSlash
- Add trailing slash to Spring routes
- This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is to add declaration of additional route explicitly on the controller handler (like@GetMapping("/some/greeting", "/some/greeting/").
- org.openrewrite.java.spring.boot3.AddSetUseTrailingSlashMatch
- Add
SetUseTrailingSlashMatch()in configuration - This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is change the default with the global Spring MVC or Webflux configuration.
- Add
- org.openrewrite.java.spring.boot3.MaintainTrailingSlashURLMappings
- Maintain trailing slash URL mappings
- This is part of Spring MVC and WebFlux URL Matching Changes, as of Spring Framework 6.0, the trailing slash matching configuration option has been deprecated and its default value set to false. This means that previously, a controller
@GetMapping("/some/greeting")would match bothGET /some/greetingandGET /some/greeting/, but it doesn't matchGET /some/greeting/anymore by default and will result in an HTTP 404 error. This recipe is to maintain trailing slash in all HTTP url mappings.
- org.openrewrite.java.spring.search.FindApiCalls
- Find HTTP API calls via
RestTemplate - Find outbound HTTP API calls made via Spring's
RestTemplateclass.
- Find HTTP API calls via
- org.openrewrite.java.spring.search.FindApiEndpoints
- Find Spring API endpoints
- Find all HTTP API endpoints exposed by Spring applications. More specifically, this marks method declarations annotated with
@RequestMapping,@GetMapping,@PostMapping,@PutMapping,@DeleteMapping, and@PatchMappingas search results.
- org.openrewrite.java.spring.search.FindConfigurationProperties
- Find Spring
@ConfigurationProperties - Find all classes annotated with
@ConfigurationPropertiesand extract their prefix values. This is useful for discovering all externalized configuration properties in Spring Boot applications.
- Find Spring
- org.openrewrite.java.spring.search.FindSpringComponents
- Find Spring components
- Find Spring components, including controllers, services, repositories, return types of
@Beanannotated methods, etc.
- org.openrewrite.java.spring.security6.RemoveOauth2LoginConfig
- Remove unneeded
oauth2Loginconfig when upgrading to Spring Security 6 oauth2Login()is a Spring Security feature that allows users to authenticate with an OAuth2 or OpenID Connect 1.0 provider. When a user is authenticated using this feature, they are granted a set of authorities that determines what actions they are allowed to perform within the application. In Spring Security 5, the default authority given to a user authenticated with an OAuth2 or OpenID Connect 1.0 provider viaoauth2Login()isROLE_USER. This means that the user is allowed to access the application's resources as a regular user. However, in Spring Security 6, the default authority given to a user authenticated with an OAuth2 provider isOAUTH2_USER, and the default authority given to a user authenticated with an OpenID Connect 1.0 provider isOIDC_USER. These authorities are more specific and allow for better customization of the user's permissions within the application. If you are upgrading to Spring Security 6 and you have previously configured aGrantedAuthoritiesMapperto handle the authorities of users authenticated viaoauth2Login(), you can remove it completely as the new default authorities should be sufficient.
- Remove unneeded
- org.openrewrite.maven.spring.UpgradeExplicitSpringBootDependencies
- Upgrade Spring dependencies
- Upgrades dependencies according to the specified version of spring boot. Spring boot has many direct and transitive dependencies. When a module has an explicit dependency on one of these it may also need to be upgraded to match the version used by spring boot.
org.openrewrite.recipe:rewrite-static-analysis
- org.openrewrite.staticanalysis.AddSerialVersionUidToSerializable
- Add
serialVersionUIDto aSerializableclass when missing - A
serialVersionUIDfield is strongly recommended in allSerializableclasses. If this is not defined on aSerializableclass, the compiler will generate this value. If a change is later made to the class, the generated value will change and attempts to deserialize the class will fail.
- Add
- org.openrewrite.staticanalysis.AvoidBoxedBooleanExpressions
- Avoid boxed boolean expressions
- Under certain conditions the
java.lang.Booleantype is used as an expression, and it may throw aNullPointerExceptionif the value is null.
- org.openrewrite.staticanalysis.CombineSemanticallyEqualCatchBlocks
- Combine semantically equal catch blocks
- Combine catches in a try that contain semantically equivalent blocks. No change will be made when a caught exception exists if combining catches may change application behavior or type attribution is missing.
- org.openrewrite.staticanalysis.ControlFlowIndentation
- Control flow statement indentation
- Program flow control statements like
if,while, andforcan omit curly braces when they apply to only a single statement. This recipe ensures that any statements which follow that statement are correctly indented to show they are not part of the flow control statement.
- org.openrewrite.staticanalysis.EqualsToContentEquals
- Use
String.contentEquals(CharSequence)instead ofString.equals(CharSequence.toString()) - Use
String.contentEquals(CharSequence)instead ofString.equals(CharSequence.toString()).
- Use
- org.openrewrite.staticanalysis.ExplicitCharsetOnStringGetBytes
- Set charset encoding explicitly when calling
String#getBytes - This makes the behavior of the code platform neutral. It will not override any existing explicit encodings, even if they don't match the default encoding option.
- Set charset encoding explicitly when calling
- org.openrewrite.staticanalysis.ExplicitLambdaArgumentTypes
- Use explicit types on lambda arguments
- Adds explicit types on lambda arguments, which are otherwise optional. This can make the code clearer and easier to read. This does not add explicit types on arguments when the lambda has one or two parameters and does not have a block body, as things are considered more readable in those cases. For example,
stream.map((a, b) -> a.length);will not have explicit types added.
- org.openrewrite.staticanalysis.FinalizeLocalVariables
- Finalize local variables
- Adds the
finalmodifier keyword to local variables which are not reassigned.
- org.openrewrite.staticanalysis.FinalizeMethodArguments
- Finalize method arguments
- Adds the
finalmodifier keyword to method parameters.
- org.openrewrite.staticanalysis.HiddenField
- Hidden field
- Refactor local variables or parameters which shadow a field defined in the same class.
- org.openrewrite.staticanalysis.LowercasePackage
- Rename packages to lowercase
- By convention all Java package names should contain only lowercase letters, numbers, and dashes. This recipe converts any uppercase letters in package names to be lowercase.
- org.openrewrite.staticanalysis.MaskCreditCardNumbers
- Mask credit card numbers
- When encountering string literals which appear to be credit card numbers, mask the last eight digits with the letter 'X'.
- org.openrewrite.staticanalysis.MoveConditionsToWhile
- Convert
while (true)with initialifbreak to loop condition - Simplifies
while (true)loops where the first statement is anifstatement that only contains abreak. The condition is inverted and moved to the loop condition for better readability.
- Convert
- org.openrewrite.staticanalysis.NoFinalizedLocalVariables
- Don't use final on local variables
- Remove the
finalmodifier keyword from local variables regardless of whether they are used within a local class or an anonymous class.
- org.openrewrite.staticanalysis.OnlyCatchDeclaredExceptions
- Replace
catch(Exception)with specific declared exceptions thrown in the try block - Replaces
catch(Exception e)blocks with a multi-catch block (catch (SpecificException1 | SpecificException2 e)) containing only the exceptions declared thrown by method or constructor invocations within thetryblock that are not already caught by more specificcatchclauses.
- Replace
- org.openrewrite.staticanalysis.PreferEqualityComparisonOverDifferenceCheck
- Prefer direct comparison of numbers
- Replace
a - b == 0witha == b,a - b != 0witha != b,a - b < 0witha < b, and similar transformations for all comparison operators to improve readability and avoid overflow issues.
- org.openrewrite.staticanalysis.PreferIncrementOperator
- Prefer increment/decrement and compound assignment operators
- Prefer the use of increment and decrement operators (
++,--,+=,-=) over their more verbose equivalents.
- org.openrewrite.staticanalysis.ReferentialEqualityToObjectEquals
- Replace referential equality operators with Object equals method invocations when the operands both override
Object.equals(Object obj) - Using
==or!=compares object references, not the equality of two objects. This modifies code where both sides of a binary operation (==or!=) overrideObject.equals(Object obj)except when the comparison is within an overriddenObject.equals(Object obj)method declaration itself. The resulting transformation must be carefully reviewed since any modifications change the program's semantics.
- Replace referential equality operators with Object equals method invocations when the operands both override
- org.openrewrite.staticanalysis.RemoveCallsToObjectFinalize
- Remove
Object.finalize()invocations - Remove calls to
Object.finalize(). This method is called during garbage collection and calling it manually is misleading.
- Remove
- org.openrewrite.staticanalysis.RemoveCallsToSystemGc
- Remove garbage collection invocations
- Removes calls to
System.gc()andRuntime.gc(). When to invoke garbage collection is best left to the JVM.
- org.openrewrite.staticanalysis.RemoveEmptyJavaDocParameters
- Remove JavaDoc
@param,@return, and@throwswith no description - Removes
@param,@return, and@throwswith no description from JavaDocs.
- Remove JavaDoc
- org.openrewrite.staticanalysis.RemoveHashCodeCallsFromArrayInstances
hashCode()should not be called on array instances- Replace
hashCode()calls on arrays withArrays.hashCode()because the results fromhashCode()are not helpful.
- org.openrewrite.staticanalysis.RemoveInstanceOfPatternMatch
- Removes from code Java 14's
instanceofpattern matching - Adds an explicit variable declaration at the beginning of
ifstatement instead ofinstanceofpattern matching.
- Removes from code Java 14's
- org.openrewrite.staticanalysis.RemoveJavaDocAuthorTag
- Remove author tags from JavaDocs
- Removes author tags from JavaDocs to reduce code maintenance.
- org.openrewrite.staticanalysis.RemoveRedundantTypeCast
- Remove redundant casts
- Removes unnecessary type casts. Does not currently check casts in lambdas and class constructors.
- org.openrewrite.staticanalysis.RemoveToStringCallsFromArrayInstances
- Remove
toString()calls on arrays - The result from
toString()calls on arrays is largely useless. The output does not actually reflect the contents of the array.Arrays.toString(array)should be used instead as it gives the contents of the array.
- Remove
- org.openrewrite.staticanalysis.RemoveTrailingWhitespace
- Remove trailing whitespace
- Remove trailing whitespace from the end of each line. Trailing whitespace is simply useless and should not stay in code. It may generate noise when comparing different versions of the same file.
- org.openrewrite.staticanalysis.RemoveUnneededAssertion
- Remove unneeded assertions
- Remove unneeded assertions like
assert true,assertTrue(true), orassertFalse(false).
- org.openrewrite.staticanalysis.RemoveUnneededBlock
- Remove unneeded block
- Flatten blocks into inline statements when possible.
- org.openrewrite.staticanalysis.RenameExceptionInEmptyCatch
- Rename caught exceptions in empty catch blocks to
ignored - Renames caught exceptions in empty catch blocks to
ignored.ignoredwill be incremented by 1 if a namespace conflict exists.
- Rename caught exceptions in empty catch blocks to
- org.openrewrite.staticanalysis.RenameLocalVariablesToCamelCase
- Reformat local variable names to camelCase
- Reformat local variable and method parameter names to camelCase to comply with Java naming convention. The recipe will not rename variables declared in for loop controls or catches with a single character. The first character is set to lower case and existing capital letters are preserved. Special characters that are allowed in java field names
$and_are removed (unless the name starts with one). If a special character is removed the next valid alphanumeric will be capitalized. Currently, does not support renaming members of classes. The recipe will not rename a variable if the result already exists in the class, conflicts with a java reserved keyword, or the result is blank.
- org.openrewrite.staticanalysis.RenamePrivateFieldsToCamelCase
- Reformat private field names to camelCase
- Reformat private field names to camelCase to comply with Java naming convention. The recipe will not rename fields with default, protected or public access modifiers. The recipe will not rename private constants. The first character is set to lower case and existing capital letters are preserved. Special characters that are allowed in java field names
$and_are removed. If a special character is removed the next valid alphanumeric will be capitalized. The recipe will not rename a field if the result already exists in the class, conflicts with a java reserved keyword, or the result is blank.
- org.openrewrite.staticanalysis.ReorderAnnotationAttributes
- Reorder annotation attributes alphabetically
- Reorder annotation attributes to be alphabetical. Positional arguments (those without explicit attribute names) are left in their original position.
- org.openrewrite.staticanalysis.ReplaceCollectionToArrayArgWithEmptyArray
- Use Empty Array for
Collection.toArray() - Changes new array creation with
Collection#toArray(T[])to use an empty array argument, which is better for performance. According to theCollection#toArray(T[])documentation: > If the collection fits in the specified array, it is returned therein. However, although it's not intuitive, allocating a right-sized array ahead of time to pass to the API appears to be generally worse for performance according to benchmarking and JVM developers due to a number of implementation details in both Java and the virtual machine. H2 achieved significant performance gains by switching to empty arrays instead pre-sized ones.
- Use Empty Array for
- org.openrewrite.staticanalysis.ReplaceDuplicateStringLiterals
- Replace duplicate
Stringliterals - Replaces
Stringliterals with a length of 5 or greater repeated a minimum of 3 times. QualifiedStringliterals include final Strings, method invocations, and new class invocations. Adds a newprivate static final Stringor uses an existing equivalent class field. A new variable name will be generated based on the literal value if an existing field does not exist. The generated name will append a numeric value to the variable name if a name already exists in the compilation unit.
- Replace duplicate
- org.openrewrite.staticanalysis.ReplaceOptionalIsPresentWithIfPresent
- Replace
Optional#isPresent()withOptional#ifPresent() - Replace
Optional#isPresent()withOptional#ifPresent(). Please note that this recipe is only suitable for if-blocks that lack an Else-block and have a single condition applied.
- Replace
- org.openrewrite.staticanalysis.ReplaceRedundantFormatWithPrintf
- Replace redundant String format invocations that are wrapped with PrintStream operations
- Replaces
PrintStream.print(String.format(format, ...args))withPrintStream.printf(format, ...args)(and forprintln, appends a newline to the format string).
- org.openrewrite.staticanalysis.ReplaceStackWithDeque
- Replace
java.util.Stackwithjava.util.Deque - From the Javadoc of
Stack: > A more complete and consistent set of LIFO stack operations is provided by the Deque interface and its implementations, which should be used in preference to this class.
- Replace
- org.openrewrite.staticanalysis.ReplaceTextBlockWithString
- Replace text block with regular string
- Replace text block with a regular multi-line string.
- org.openrewrite.staticanalysis.ReplaceWeekYearWithYear
- Week Year (YYYY) should not be used for date formatting
- For most dates Week Year (YYYY) and Year (yyyy) yield the same results. However, on the last week of December and the first week of January, Week Year could produce unexpected results.
- org.openrewrite.staticanalysis.SimplifyBooleanExpressionWithDeMorgan
- Simplify boolean expressions using De Morgan's laws
- Applies De Morgan's laws to simplify boolean expressions with negation. Transforms
!(a && b)to!a || !band!(a || b)to!a && !b.
- org.openrewrite.staticanalysis.SimplifyCompoundStatement
- Simplify compound statement
- Fixes or removes useless compound statements. For example, removing
b &= true, and replacingb &= falsewithb = false.
- org.openrewrite.staticanalysis.SimplifyConsecutiveAssignments
- Simplify consecutive assignments
- Combine consecutive assignments into a single statement where possible.
- org.openrewrite.staticanalysis.SimplifyDurationCreationUnits
- Simplify
java.time.Durationunits - Simplifies
java.time.Durationunits to be more human-readable.
- Simplify
- org.openrewrite.staticanalysis.SimplifyElseBranch
- Simplify
elsebranch if it only has a singleif - Simplify
elsebranch if it only has a singleif.
- Simplify
- org.openrewrite.staticanalysis.SimplifyForLoopBoundaryComparison
- Simplify for loop boundary comparisons
- Replace
<=with<in for loop conditions by adjusting the comparison operands. For example,i <= n - 1simplifies toi < n, andi <= nbecomesi < n + 1.
- org.openrewrite.staticanalysis.SimplifyTernaryRecipes
- Simplify ternary expressions
- Simplifies various types of ternary expressions to improve code readability.
- org.openrewrite.staticanalysis.SortedSetStreamToLinkedHashSet
- Sorted set stream should be collected to LinkedHashSet
- Converts
set.stream().sorted().collect(Collectors.toSet())toset.stream().sorted().collect(LinkedHashSet::new).
- org.openrewrite.staticanalysis.TernaryOperatorsShouldNotBeNested
- Ternary operators should not be nested
- Nested ternary operators can be hard to read quickly. Prefer simpler constructs for improved readability. If supported, this recipe will try to replace nested ternaries with switch expressions.
- org.openrewrite.staticanalysis.URLEqualsHashCodeRecipes
- URL Equals and Hash Code
- Uses of
equals()andhashCode()causejava.net.URLto make blocking internet connections. Instead, usejava.net.URI.
- org.openrewrite.staticanalysis.UnwrapRepeatableAnnotations
- Unwrap
@Repeatableannotations - Java 8 introduced the concept of
@Repeatableannotations, making the wrapper annotation unnecessary.
- Unwrap
- org.openrewrite.staticanalysis.UseAsBuilder
- Chain calls to builder methods
- Chain calls to builder methods that are on separate lines into one chain of builder calls.
- org.openrewrite.staticanalysis.UseCollectionInterfaces
- Use
Collectioninterfaces - Use
Deque,List,Map,ConcurrentMap,Queue, andSetinstead of implemented collections. Replaces the return type of public method declarations and the variable type public variable declarations.
- Use
- org.openrewrite.staticanalysis.UseForEachRemoveInsteadOfSetRemoveAll
- Replace
java.util.Set#removeAll(java.util.Collection)withjava.util.Collection#forEach(Set::remove) - Using
java.util.Collection#forEach(Set::remove)rather thanjava.util.Set#removeAll(java.util.Collection)may improve performance due to a possible O(n^2) complexity.
- Replace
- org.openrewrite.staticanalysis.UseLambdaForFunctionalInterface
- Use lambda expressions instead of anonymous classes
- Instead of anonymous class declarations, use a lambda where possible. Using lambdas to replace anonymous classes can lead to more expressive and maintainable code, improve code readability, reduce code duplication, and achieve better performance in some cases.
- org.openrewrite.staticanalysis.UseListSort
- Replace invocations of
Collections#sort(List, Comparator)withList#sort(Comparator) - The
java.util.Collections#sort(..)implementation defers to thejava.util.List#sort(Comparator), replaced it with thejava.util.List#sort(Comparator)implementation for better readability.
- Replace invocations of
- org.openrewrite.staticanalysis.UseObjectNotifyAll
- Replaces
Object.notify()withObject.notifyAll() Object.notifyAll()andObject.notify()both wake up sleeping threads, butObject.notify()only rouses one whileObject.notifyAll()rouses all of them. SinceObject.notify()might not wake up the right thread,Object.notifyAll()should be used instead. See this for more information.
- Replaces
- org.openrewrite.staticanalysis.UseStandardCharset
- Use
StandardCharsetconstants - Replaces
Charset.forName(java.lang.String)with the equivalentStandardCharsetconstant.
- Use
- org.openrewrite.staticanalysis.UseStringReplace
- Use
String::replace()when first parameter is not a real regular expression - When
String::replaceAllis used, the first argument should be a real regular expression. If it’s not the case,String::replacedoes exactly the same thing asString::replaceAllwithout the performance drawback of the regex.
- Use
- org.openrewrite.staticanalysis.UseSystemLineSeparator
- Use
System.lineSeparator() - Replace calls to
System.getProperty("line.separator")withSystem.lineSeparator().
- Use
- org.openrewrite.staticanalysis.maven.MavenJavadocNonAsciiRecipe
- Remove non-ASCII characters from Javadoc
- Maven's javadoc-plugin configuration does not support non-ASCII characters. What makes it tricky is the error is very ambiguous and doesn't help in any way. This recipe removes those non-ASCII characters.
org.openrewrite.recipe:rewrite-testing-frameworks
- org.openrewrite.java.testing.cleanup.RemoveEmptyTests
- Remove empty tests without comments
- Removes empty methods with a
@Testannotation if the body does not have comments.
- org.openrewrite.java.testing.mockito.AnyStringToNullable
- Replace Mockito 1.x
anyString()withnullable(String.class) - Since Mockito 2.10
anyString()no longer matches null values. Usenullable(Class)instead.
- Replace Mockito 1.x
- org.openrewrite.java.testing.mockito.CloseUnclosedStaticMocks
- Close unclosed static mocks
- Ensures that all
mockStaticcalls are properly closed. IfmockStaticis in lifecycle methods like@BeforeEachor@BeforeAll, creates a class variable and closes it in@AfterEachor@AfterAll. IfmockStaticis inside a test method, wraps it in a try-with-resources block.
- org.openrewrite.java.testing.mockito.MockitoJUnitRunnerSilentToExtension
- JUnit 4 MockitoJUnitRunner.Silent to JUnit Jupiter MockitoExtension with LENIENT settings
- Replace
@RunWith(MockitoJUnitRunner.Silent.class)with@ExtendWith(MockitoExtension.class)and@MockitoSettings(strictness = Strictness.LENIENT).
org.openrewrite.recipe:rewrite-third-party
- com.oracle.weblogic.rewrite.CheckAndCommentOutDeprecations1511
- Report types deprecated or removed in WebLogic version 15.1.1
- This recipe will report Java types that have been deprecated or removed in WebLogic version 15.1.1. This is an alias to prevent breaking existing recipes.
- com.oracle.weblogic.rewrite.JakartaEE9_1
- Migrate to Jakarta EE 9.1
- These recipes help with Migration to Jakarta EE 9.1, flagging and updating deprecated methods.
- com.oracle.weblogic.rewrite.UpgradeJPATo31HibernateTo66
- Upgrade Jakarta JPA to 3.1 and Hibernate 6.6
- This recipe upgrades Jakarta JPA to 3.1 and Hibernate to 6.6 (compatible with Jakarta EE 10).
- com.oracle.weblogic.rewrite.UpgradeTo1411
- Migrate to WebLogic 14.1.1
- This recipe will apply changes required for migrating to WebLogic 14.1.1
- com.oracle.weblogic.rewrite.UpgradeTo1412
- Migrate to WebLogic 14.1.2
- This recipe will apply changes required for migrating to WebLogic 14.1.2
- com.oracle.weblogic.rewrite.UpgradeTo1511
- Migrate to WebLogic 15.1.1
- This recipe will apply changes required for migrating to WebLogic 15.1.1 and Jakarta EE 9.1
- com.oracle.weblogic.rewrite.WebLogicXmlCreateIfNotExists1511
- Create
weblogic.xmlif it does not exist - This recipe will create a
weblogic.xmlfile with the WebLogic 15.1.1 namespace if it does not already exist.
- Create
- com.oracle.weblogic.rewrite.WebLogicXmlPreferApplicationPackagesJPA
- Add
prefer-application-packagesfor JPA inweblogic.xml - This recipe will add a
prefer-application-packagesentry for Jakarta Persistence inweblogic.xmlif it does not already exist.
- Add
- com.oracle.weblogic.rewrite.WebLogicXmlPreferApplicationPackagesSlf4j
- Add
prefer-application-packagesfor SLF4J inweblogic.xml - This recipe will add a
prefer-application-packagesentry for SLF4J inweblogic.xmlif it does not already exist.
- Add
- com.oracle.weblogic.rewrite.examples.spring.MigratedPetClinicExtrasFor1511
- Add WebLogic 15.1.1 PetClinic extras
- Run migration extras for migrated Spring Framework PetClinic example run on WebLogic 15.1.1.
- com.oracle.weblogic.rewrite.examples.spring.SetupSpringFrameworkPetClinicFor1412
- Setup Spring Framework 5.3.x PetClinic for WebLogic 14.1.2
- Setup Spring Framework 5.3.x PetClinic for WebLogic 14.1.2.
- com.oracle.weblogic.rewrite.hibernate.MigrateHibernateToJakartaEE9
- Migrate to Hibernate for Jakarta EE 9
- Upgrade hibernate libraries to Jakarta EE9 versions.
- com.oracle.weblogic.rewrite.jakarta.UpdateJakartaPersistenceTo32
- Update Jakarta Persistence to 3.2
- Update Jakarta Persistence to 3.2.
- com.oracle.weblogic.rewrite.spring.framework.UpgradeToSpringFramework_6_2
- Migrate to Spring Framework 6.2 for WebLogic 15.1.1
- Migrate applications to the Spring Framework 6.2 release and compatibility with WebLogic 15.1.1.
- org.apache.camel.upgrade.Camel410LTSMigrationRecipe
- Migrate to 4.10.6
- Migrates Apache Camel application to 4.10.6.
- org.apache.camel.upgrade.CamelMigrationRecipe
- Migrate to 4.18.0
- Migrates Apache Camel application to 4.18.0.
org.openrewrite:rewrite-cobol
- org.openrewrite.cobol.cleanup.RemoveWithDebuggingMode
- Remove with debugging mode
- Remove debugging mode from SOURCE-COMPUTER paragraphs.
- org.openrewrite.cobol.search.FindCopybook
- Find copybook usage
- Find all copy statements with the copybook name.
- org.openrewrite.cobol.search.FindIndicators
- Find indicators
- Find matching indicators. Currently, this recipe will not mark indicators on copybook code.
- org.openrewrite.cobol.search.FindReference
- Find matching identifiers in COBOL, copybooks, and JCL
- Finds an identifier by an exact match or regex pattern in COBOL, copybooks, and/or JCL.
- org.openrewrite.cobol.search.FindRelationships
- Find COBOL relationships
- Build a list of relationships for diagramming and exploration.
- org.openrewrite.cobol.search.FindWord
- Find matching words in the source code
- Search for COBOL words based on a search term.
org.openrewrite:rewrite-core
- org.openrewrite.AddToGitignore
- Add entries to
.gitignore - Adds entries to the project's
.gitignorefile. If no.gitignorefile exists, one will be created. Existing entries that match will not be duplicated.
- Add entries to
- org.openrewrite.ExcludeFileFromGitignore
- Remove ignoral of files or directories from .gitignore
- This recipe will remove a file or directory from the .gitignore file. If the file or directory is already in the .gitignore file, it will be removed or negated. If the file or directory is not in the .gitignore file, no action will be taken.
- org.openrewrite.FindCollidingSourceFiles
- Find colliding source files
- Finds source files which share a path with another source file. There should always be exactly one source file per path within a repository. This is a diagnostic for finding problems in OpenRewrite parsers/build plugins.
- org.openrewrite.FindDeserializationErrors
- Find deserialization errors
- Produces a data table collecting all deserialization errors of serialized LSTs.
- org.openrewrite.FindGitProvenance
- Show Git source control metadata
- List out the contents of each unique
GitProvenancemarker in the set of source files. When everything is working correctly, exactly one such marker should be printed as all source files are expected to come from the same repository / branch / commit hash.
- org.openrewrite.FindLstProvenance
- Find LST provenance
- Produces a data table showing what versions of OpenRewrite/Moderne tooling was used to produce a given LST.
- org.openrewrite.FindParseFailures
- Find source files with
ParseExceptionResultmarkers - This recipe explores parse failures after an LST is produced for classifying the types of failures that can occur and prioritizing fixes according to the most common problems.
- Find source files with
- org.openrewrite.FindQuarks
- Find instances of type
Quark Quarksource files are pointers to the existence of a file without capturing any of the contents of the file.
- Find instances of type
- org.openrewrite.IsInRepository
- Is in repository
- A search recipe which marks files that are in a repository with one of the supplied names. Intended for use as a precondition for other recipes being run over many different repositories.
- org.openrewrite.ListRuntimeClasspath
- List runtime classpath
- A diagnostic utility which emits the runtime classpath to a data table.
- org.openrewrite.MoveFile
- Move a file
- Move a file to a different directory. The file name will remain the same.
- org.openrewrite.SetFilePermissions
- Set file permission attributes
- Set a file's read, write and executable permission attributes.
- org.openrewrite.Singleton
- Singleton
- Used as a precondition to ensure that a recipe attempts to make changes only once. Accidentally including multiple copies/instances of the same large composite recipes is a common mistake. If those recipes are marked with this precondition the performance penalty is limited. This recipe does nothing useful run on its own. ## Usage in YAML recipes Add
org.openrewrite.Singletonas a precondition:yaml --- type: specs.openrewrite.org/v1beta/recipe name: com.example.Append displayName: My recipe preconditions: - org.openrewrite.Singleton recipeList: - org.openrewrite.text.AppendToTextFile: relativeFileName: report.txt content: 'Recipe executed'## Usage in Java recipes Wrap visitors withSingleton.singleton(this, visitor)to ensure only the first equivalent recipe instance makes changes:java @Override public TreeVisitor<?, ExecutionContext> getVisitor(Accumulator acc) \{ return singleton(this, new TreeVisitor<Tree, ExecutionContext>() \{ @Override public Tree visit(@Nullable Tree tree, ExecutionContext ctx) \{ // Your transformation logic return tree; \} \}); \} @Override public Collection<SourceFile> generate(Accumulator acc, ExecutionContext ctx) \{ if (!isSingleton(this, ctx)) \{ return Collections.emptyList(); \} // Generate new sources return results; \} @Override public TreeVisitor<?, ExecutionContext> getVisitor(Accumulator acc) \{ return singleton(this, new TreeVisitor<Tree, ExecutionContext>() \{ // Visitor logic \}); \}Note: Singleton status is determined by the recipe'sequals()andhashCode()methods. If equivalent instances of a recipe are not considered singletons, ensure your recipe class correctly implements these methods. The easiest way is to use Lombok's@Valueannotation on your recipe class, which automatically generates correctequals()andhashCode()implementations based on all fields.
- org.openrewrite.search.FindBuildMetadata
- Find build metadata
- Find source files with matching build metadata.
- org.openrewrite.search.FindParseToPrintInequality
- Find parse to print inequality
- OpenRewrite
Parserimplementations should produceSourceFileobjects whoseprintAll()method should be byte-for-byte equivalent with the original source file. When this isn't true, recipes can still run on theSourceFileand even produce diffs, but the diffs would fail to apply as a patch to the original source file. MostParseruseParser#requirePrintEqualsInputto produce aParseErrorwhen they fail to produce aSourceFilethat is print idempotent.
- org.openrewrite.search.RepositoryContainsFile
- Repository contains file
- Intended to be used primarily as a precondition for other recipes, this recipe checks if a repository contains a specific file or files matching a pattern. If present all files in the repository are marked with a
SearchResultmarker. If you want to get only the matching file as a search result, useFindSourceFilesinstead.
- org.openrewrite.text.AppendToTextFile
- Append to text file
- Appends or replaces content of an existing plain text file, or creates a new one if it doesn't already exist. Please note that this recipes requires existing plain text files' format to be successfully parsable by OpenRewrite. If a file is left unchanged, it might be parsed as a
Quarkrather than plain text. In such case, use theplainTextMaskoption. See the Gradle or Maven plugin configuration page.
- org.openrewrite.text.ChangeText
- Change text
- Completely replaces the contents of the text file with other text. Use together with a
FindSourceFilesprecondition to limit which files are changed.
- org.openrewrite.text.EndOfLineAtEndOfFile
- End of Line @ End of File (EOL @ EOF)
- Ensure that the file ends with the newline character. Note: If this recipe modifies a file, it converts the file into plain text. As such, this recipe should be run after any recipe that modifies the language-specific LST.
- org.openrewrite.text.FindMultiselect
- Experimental find text with multiselect
- Search for text, treating all textual sources as plain text. This version of the recipe exists to experiment with multiselect recipe options.
- org.openrewrite.text.RemoveByteOrderMark
- Remove byte order mark (BOM)
- Removes UTF-8 byte order marks from the beginning of files. The BOM character (U+FEFF) is generally unnecessary in UTF-8 files and can cause issues with some tools.
org.openrewrite:rewrite-docker
- org.openrewrite.docker.AddOciLabels
- Add OCI image labels
- Adds standard OCI (Open Container Initiative) image labels to a Dockerfile. These labels provide metadata about the image such as title, version, source, and license information. See https://github.com/opencontainers/image-spec/blob/main/annotations.md for the specification.
- org.openrewrite.docker.AddOrUpdateLabel
- Add Docker LABEL instruction
- Adds or updates a LABEL instruction in a Dockerfile. By default, adds to the final stage only.
- org.openrewrite.docker.ChangeFrom
- Change Docker FROM
- Change the base image in a Dockerfile FROM instruction.
- org.openrewrite.docker.search.FindBaseImages
- Find Docker base images
- Find all base images (
FROMinstructions) in Dockerfiles.
- org.openrewrite.docker.search.FindExposedPorts
- Find exposed ports
- Find all
EXPOSEinstructions in Dockerfiles and report the exposed ports.
org.openrewrite:rewrite-gradle
- org.openrewrite.gradle.AddPlatformDependency
- Add Gradle platform dependency
- Add a gradle platform dependency to a
build.gradlefile in the correct configuration based on where it is used.
- org.openrewrite.gradle.ChangeDependency
- Change Gradle dependency
- Change a Gradle dependency coordinates. The
newGroupIdornewArtifactIdMUST be different from before.
- org.openrewrite.gradle.ChangeDependencyExtension
- Change a Gradle dependency extension
- Changes extension of an existing dependency declared in
build.gradlefiles.
- org.openrewrite.gradle.ChangeExtraProperty
- Change Extra Property
- Gradle's ExtraPropertiesExtension is a commonly used mechanism for setting arbitrary key/value pairs on a project. This recipe will change the value of a property with the given key name if that key can be found. It assumes that the value being set is a String literal. Does not add the value if it does not already exist.
- org.openrewrite.gradle.ChangeManagedDependency
- Change Gradle managed dependency
- Change a Gradle managed dependency coordinates. The
newGroupIdornewArtifactIdMUST be different from before. For now, only Spring Dependency Management Plugin entries are supported and no other forms of managed dependencies (yet).
- org.openrewrite.gradle.DependencyConstraintToRule
- Dependency constraint to resolution rule
- Gradle dependency constraints are useful for managing the versions of transitive dependencies. Some plugins, such as the Spring Dependency Management plugin, do not respect these constraints. This recipe converts constraints into resolution rules, which can achieve similar effects to constraints but are harder for plugins to ignore.
- org.openrewrite.gradle.DependencyUseMapNotation
- Use
Mapnotation for Gradle dependency declarations - In Gradle, dependencies can be expressed as a
Stringlike"groupId:artifactId:version", or equivalently as aMaplikegroup: 'groupId', name: 'artifactId', version: 'version'(groovy) orgroup = "groupId", name = "artifactId", version = "version"(kotlin). This recipe replaces dependencies represented asStringswith an equivalent dependency represented as aMap.
- Use
- org.openrewrite.gradle.EnableDevelocityBuildCache
- Enable Develocity build cache
- Adds
buildCacheconfiguration todevelocitywhere not yet present.
- org.openrewrite.gradle.MigrateDependenciesToVersionCatalog
- Migrate Gradle project dependencies to version catalog
- Migrates Gradle project dependencies to use the version catalog feature. Supports migrating dependency declarations of various forms: *
Stringnotation:"group:artifact:version"*Mapnotation:group: 'group', name: 'artifact', version: 'version'* Property references:"group:artifact:$version"or"group:artifact:$\{version\}"The recipe will: * Create agradle/libs.versions.tomlfile with version declarations * Replace dependency declarations with catalog references (e.g.,libs.springCore) * Migrate version properties fromgradle.propertiesto the version catalog * Preserve project dependencies unchanged Note: If a version catalog already exists, the recipe will not modify it.
- org.openrewrite.gradle.RemoveRedundantDependencyVersions
- Remove redundant explicit dependencies and versions
- Remove explicitly-specified dependency versions that are managed by a Gradle
platform,enforcedPlatformor theio.spring.dependency-managementplugin. Also removes redundant direct dependencies and dependency constraints that are already satisfied by transitive dependencies.
- org.openrewrite.gradle.RemoveRedundantSecurityResolutionRules
- Remove redundant security resolution rules
- Remove
resolutionStrategy.eachDependencyrules that pin dependencies to versions that are already being managed by a platform/BOM to equal or newer versions. Only removes rules that have a security advisory identifier (CVE or GHSA) in thebecauseclause, unless a custom pattern is specified.
- org.openrewrite.gradle.RemoveRepository
- Remove repository
- Removes a repository from Gradle build scripts. Named repositories include "jcenter", "mavenCentral", "mavenLocal", and "google".
- org.openrewrite.gradle.UpgradeTransitiveDependencyVersion
- Upgrade transitive Gradle dependencies
- Upgrades the version of a transitive dependency in a Gradle build file. There are many ways to do this in Gradle, so the mechanism for upgrading a transitive dependency must be considered carefully depending on your style of dependency management.
- org.openrewrite.gradle.plugins.AddDevelocityGradlePlugin
- Add the Develocity Gradle plugin
- Add the Develocity Gradle plugin to settings.gradle files.
- org.openrewrite.gradle.plugins.AddSettingsPlugin
- Add Gradle settings plugin
- Add plugin to Gradle settings file
pluginsblock by id.
- org.openrewrite.gradle.plugins.AddSettingsPluginRepository
- Add a Gradle settings repository
- Add a Gradle settings repository to
settings.gradle(.kts).
- org.openrewrite.gradle.plugins.ChangePlugin
- Change a Gradle plugin
- Changes the selected Gradle plugin to the new plugin.
- org.openrewrite.gradle.plugins.MigrateGradleEnterpriseToDevelocity
- Migrate from Gradle Enterprise to Develocity
- Migrate from the Gradle Enterprise Gradle plugin to the Develocity Gradle plugin.
- org.openrewrite.gradle.search.DoesNotIncludeDependency
- Does not include Gradle dependency
- A precondition which returns false if visiting a Gradle file which includes the specified dependency in the classpath of some scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
- org.openrewrite.gradle.search.EffectiveGradlePluginRepositories
- List effective Gradle plugin repositories
- Lists the Gradle plugin repositories that would be used for plugin resolution, in order of precedence. This includes Maven repositories defined in the settings.gradle pluginManagement section and build.gradle buildscript repositories as determined when the LST was produced.
- org.openrewrite.gradle.search.EffectiveGradleRepositories
- List effective Gradle project repositories
- Lists the Gradle project repositories that would be used for dependency resolution, in order of precedence. This includes Maven repositories defined in the Gradle build files and settings as determined when the LST was produced.
- org.openrewrite.gradle.search.FindDependency
- Find Gradle dependency
- Finds dependencies declared in gradle build files. See the reference on Gradle configurations or the diagram below for a description of what configuration to use. A project's compile and runtime classpath is based on these configurations. <img alt="Gradle compile classpath" src="https://docs.gradle.org/current/userguide/img/java-library-ignore-deprecated-main.png" width="200px"/> A project's test classpath is based on these configurations. <img alt="Gradle test classpath" src="https://docs.gradle.org/current/userguide/img/java-library-ignore-deprecated-test.png" width="200px"/>.
- org.openrewrite.gradle.search.FindDependencyHandler
- Find Gradle
dependenciesblocks - Find the dependency handler containing any number of dependency definitions.
- Find Gradle
- org.openrewrite.gradle.search.FindGradleProject
- Find Gradle projects
- Gradle projects are those with
build.gradleorbuild.gradle.ktsfiles.
- org.openrewrite.gradle.search.FindGradleWrapper
- Find Gradle wrappers
- Find Gradle wrappers.
- org.openrewrite.gradle.search.FindJVMTestSuites
- Find Gradle JVMTestSuite plugin configuration
- Find Gradle JVMTestSuite plugin configurations and produce a data table.
- org.openrewrite.gradle.search.FindPlugins
- Find Gradle plugin
- Find a Gradle plugin by id and/or class name. For best results both should be specified, as one cannot automatically be used to infer the other.
- org.openrewrite.gradle.search.FindRepository
- Find Gradle repository
- Find a Gradle repository by url.
- org.openrewrite.gradle.search.FindRepositoryOrder
- Gradle repository order
- Determine the order in which dependencies will be resolved for each
build.gradlebased on its defined repositories as determined when the LST was produced.
- org.openrewrite.gradle.search.ModuleHasDependency
- Module has dependency
- Searches for Gradle Projects (modules) that have a dependency matching the specified id or implementing class. Places a
SearchResultmarker on all sources within a project with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use spring-boot-starter, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file that use the dependency, use theFindDependencyrecipe instead.
- org.openrewrite.gradle.search.ModuleHasPlugin
- Module has plugin
- Searches for Gradle Projects (modules) that have a plugin matching the specified id or implementing class. Places a
SearchResultmarker on all sources within a project with a matching plugin. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that apply the spring dependency management plugin, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindPluginsrecipe instead.
- org.openrewrite.gradle.security.UseHttpsForRepositories
- Use HTTPS for repositories
- Use HTTPS for repository URLs.
org.openrewrite:rewrite-groovy
- org.openrewrite.groovy.format.AutoFormat
- Format Groovy code
- Format Groovy code using a standard comprehensive set of Groovy formatting recipes.
- org.openrewrite.groovy.format.GStringCurlyBraces
- Groovy GString curly braces
- In Groovy GStrings, curly braces are optional for single variable expressions. This recipe adds them, so that the expression is always surrounded by curly braces.
- org.openrewrite.groovy.format.OmitParenthesesForLastArgumentLambda
- Move a closure which is the last argument of a method invocation out of parentheses
- Groovy allows a shorthand syntax that allows a closure to be placed outside of parentheses.
- org.openrewrite.groovy.format.OmitParenthesesFormat
- Stylize Groovy code to omit parentheses
- Omit parentheses for last argument lambdas in Groovy code.
org.openrewrite:rewrite-hcl
- org.openrewrite.hcl.DeleteContent
- Delete content
- Delete HCL content by path.
- org.openrewrite.hcl.MoveContentToFile
- Move content to another file
- Move content to another HCL file, deleting it in the original file.
- org.openrewrite.hcl.format.AutoFormat
- Format HCL code
- Format HCL code using a standard comprehensive set of HCL formatting recipes.
- org.openrewrite.hcl.format.BlankLines
- Blank lines
- Add and/or remove blank lines.
- org.openrewrite.hcl.format.NormalizeFormat
- Normalize format
- Move whitespace to the outermost LST element possible.
- org.openrewrite.hcl.format.RemoveTrailingWhitespace
- Remove trailing whitespace
- Remove any extra trailing whitespace from the end of each line.
- org.openrewrite.hcl.format.Spaces
- Spaces
- Format whitespace in HCL code.
- org.openrewrite.hcl.format.TabsAndIndents
- Tabs and indents
- Format tabs and indents in HCL code.
- org.openrewrite.hcl.search.FindAndReplaceLiteral
- Find and replace literals in HCL files
- Find and replace literal values in HCL files. This recipe parses the source files on which it runs as HCL, meaning you can execute HCL language-specific recipes before and after this recipe in a single recipe run.
- org.openrewrite.hcl.search.FindContent
- Find content
- Find HCL content by path.
org.openrewrite:rewrite-java
- org.openrewrite.java.ChangeMethodTargetToVariable
- Change method target to variable
- Change method invocations to method calls on a variable.
- org.openrewrite.java.ChangeTypeInStringLiteral
- Change type in String literals
- Change a given type to another when used in a String literal.
- org.openrewrite.java.CreateEmptyJavaClass
- Create Java class
- Create a new, empty Java class.
- org.openrewrite.java.NoStaticImport
- Remove static import
- Removes static imports and replaces them with qualified references. For example,
emptyList()becomesCollections.emptyList().
- org.openrewrite.java.RandomizeId
- Randomize tree IDs
- Scramble the IDs. This was intended as a utility to test en masse different techniques for UUID generation and compare their relative performance outside a microbenchmark.
- org.openrewrite.java.RecipeMarkupDemonstration
- Demonstrate rendering of
Markupmarkers - Tooling may decide to elide or display differently markup of different levels.
- Demonstrate rendering of
- org.openrewrite.java.RemoveImplements
- Remove interface implementations
- Removes
implementsclauses from classes implementing the specified interface. Removes@Overridesannotations from methods which no longer override anything.
- org.openrewrite.java.RemoveObjectsIsNull
- Transform calls to
Objects.isNull(..)andObjects.nonNull(..) - Replace calls to
Objects.isNull(..)andObjects.nonNull(..)with a simple null check. Using these methods outside of stream predicates is not idiomatic.
- Transform calls to
- org.openrewrite.java.ReplaceConstant
- Replace constant with literal value
- Replace a named constant with a literal value when you wish to remove the old constant. A
Stringliteral must include escaped quotes.
- org.openrewrite.java.UpdateSourcePositions
- Update source positions
- Calculate start position and length for every LST element.
- org.openrewrite.java.ai.ClassDefinitionLength
- Calculate token length of classes
- Locates class definitions and predicts the number of token in each.
- org.openrewrite.java.ai.MethodDefinitionLength
- Calculate token length of method definitions
- Locates method definitions and predicts the number of token in each.
- org.openrewrite.java.format.AutoFormat
- Format Java code
- Format Java code using a standard comprehensive set of Java formatting recipes.
- org.openrewrite.java.format.BlankLines
- Blank lines
- Add and/or remove blank lines.
- org.openrewrite.java.format.NormalizeFormat
- Normalize format
- Move whitespace to the outermost LST element possible.
- org.openrewrite.java.format.NormalizeLineBreaks
- Normalize line breaks
- Consistently use either Windows style (CRLF) or Linux style (LF) line breaks. If no
GeneralFormatStyleis specified this will use whichever style of line endings are more common.
- org.openrewrite.java.format.NormalizeTabsOrSpaces
- Normalize to tabs or spaces
- Consistently use either tabs or spaces in indentation.
- org.openrewrite.java.format.SingleLineComments
- Single line comments begin with a whitespace
- Write
// hiinstead of//hi.
- org.openrewrite.java.format.Spaces
- Spaces
- Format whitespace in Java code.
- org.openrewrite.java.format.TabsAndIndents
- Tabs and indents
- Format tabs and indents in Java code.
- org.openrewrite.java.format.TypecastParenPad
- Typecast parentheses padding
- Fixes whitespace padding between a typecast type identifier and the enclosing left and right parenthesis. For example, when configured to remove spacing,
( int ) 0L;becomes(int) 0L;.
- org.openrewrite.java.format.WrappingAndBraces
- Wrapping and braces
- Format line wraps and braces in Java code.
- org.openrewrite.java.search.ClasspathTypeCounts
- Study the size of the classpath by source set
- Emit one data table row per source set in a project, with the number of types in the source set.
- org.openrewrite.java.search.DoesNotUseType
- Check whether a type is not in use
- Useful as a precondition to skip over compilation units using the argument type.
- org.openrewrite.java.search.FindClassHierarchy
- Find class hierarchy
- Discovers all class declarations within a project, recording which files they appear in, their superclasses, and interfaces. That information is then recorded in a data table.
- org.openrewrite.java.search.FindCompileErrors
- Find compile errors
- Compile errors result in a particular LST structure that can be searched for.
- org.openrewrite.java.search.FindDistinctMethods
- Find distinct methods in use
- A sample of every distinct method in use in a repository. The code sample in the method calls data table will be a representative use of the method, though there may be many other such uses of the method.
- org.openrewrite.java.search.FindEmptyClasses
- Find empty classes
- Find empty classes without annotations that do not implement an interface or extend a class.
- org.openrewrite.java.search.FindEmptyMethods
- Find methods with empty bodies
- Find methods with empty bodies and single public no arg constructors.
- org.openrewrite.java.search.FindFields
- Find fields
- Find uses of a field.
- org.openrewrite.java.search.FindFieldsOfType
- Find fields of type
- Finds declared fields matching a particular class name.
- org.openrewrite.java.search.FindImports
- Find source files with imports
- Locates source files that have imports matching the given type pattern, regardless of whether that import is used in the code.
- org.openrewrite.java.search.FindLiterals
- Find literals
- Find literals matching a pattern.
- org.openrewrite.java.search.FindMethodDeclaration
- Find method declaration
- Locates the declaration of a method.
- org.openrewrite.java.search.FindMissingTypes
- Find missing type information on Java LSTs
- This is a diagnostic recipe to highlight where LSTs are missing type attribution information.
- org.openrewrite.java.search.FindRepeatableAnnotations
- Find uses of
@Repeatableannotations - Java 8 introduced the concept of
@Repeatableannotations.
- Find uses of
- org.openrewrite.java.search.FindSymbols
- Find symbols
- Lists all symbols (classes, methods, fields, etc.) declared in the codebase. Results are emitted into a data table with symbol kind, name, parent type, signature, and visibility.
- org.openrewrite.java.search.FindTypeMappings
- Find type mappings
- Study the frequency of
Jtypes and theirJavaTypetype attribution.
- org.openrewrite.java.search.HasBuildToolVersion
- Find files with a particular build tool version
- Finds Java source files built with a particular build tool. This is useful especially as a precondition for other recipes.
- org.openrewrite.java.search.HasJavaVersion
- Find files compiled at a specific Java version
- Finds Java source files matching a particular language level. This is useful especially as a precondition for other recipes.
- org.openrewrite.java.search.HasMethod
- Find files that have at least one use of a method
- Marks files that have at least one occurrence of a method matching a pattern.
- org.openrewrite.java.search.HasMinimumJavaVersion
- Find the oldest Java version in use
- The oldest Java version in use is the lowest Java version in use in any source set of any subproject of a repository. It is possible that, for example, the main source set of a project uses Java 8, but a test source set uses Java 17. In this case, the oldest Java version in use is Java 8.
- org.openrewrite.java.search.HasSourceSet
- Find files in a source set
- Source sets are a way to organize your source code into logical groups. For example, Java projects commonly have a
mainsource set for application code and atestsource set for test code. This recipe will find all files in a given source set.
- org.openrewrite.java.search.HasType
- Find files that have at least one use of a type
- Marks files that have at least one occurrence of a type, even if the name of that type doesn't appear in the source code.
- org.openrewrite.java.search.IsLikelyNotTest
- Find files that are likely not tests
- Sources that do not contain indicators of being, or being exclusively for the use in tests. This recipe is simply a negation of the
org.openrewrite.java.search.IsLikelyTestrecipe.
- org.openrewrite.java.search.IsLikelyTest
- Find sources that are likely tests
- Sources that contain indicators of being, or being exclusively for the use in tests. This recipe is not exhaustive, but is intended to be a good starting point for finding test sources. Looks at the source set name, and types in use; for example looks for uses of JUnit & TestNG annotations/assertions.
- org.openrewrite.java.search.ResultOfMethodCallIgnored
- Result of method call ignored
- Find locations where the result of the method call is being ignored.
org.openrewrite:rewrite-json
- org.openrewrite.json.AddKeyValue
- Add value to JSON Object
- Adds a
valueat the specifiedkeyPathwith the specifiedkey, if the key doesn't already exist.
- org.openrewrite.json.ChangeKey
- Change key
- Change a JSON mapping entry key, while leaving the value intact.
- org.openrewrite.json.ChangeValue
- Change value
- Change a JSON mapping entry value leaving the key intact.
- org.openrewrite.json.CopyValue
- Copy JSON value
- Copies a JSON value from one key to another. The existing key/value pair remains unaffected by this change. Attempts to create the new key if it does not exist.
- org.openrewrite.json.CreateJsonFile
- Create JSON file
- Create a new JSON file.
- org.openrewrite.json.DeleteKey
- Delete key
- Delete a JSON mapping entry key.
- org.openrewrite.json.format.AutoFormat
- Format JSON
- Format JSON code using a standard comprehensive set of JSON formatting recipes.
- org.openrewrite.json.format.Indents
- JSON indent
- Format tabs and indents in JSON.
- org.openrewrite.json.format.WrappingAndBraces
- JSON new lines
- Split members into separate lines in JSON.
- org.openrewrite.json.search.FindKey
- Find JSON object members
- Find JSON object members by JsonPath expression.
org.openrewrite:rewrite-kotlin
- org.openrewrite.kotlin.FindKotlinSources
- Find Kotlin sources and collect data metrics
- Use data table to collect source files types and counts of files with extensions
.kt.
- org.openrewrite.kotlin.OrderImports
- Order Kotlin imports
- Groups and orders import statements. If a style has been defined, this recipe will order the imports according to that style. If no style is detected, this recipe will default to ordering imports in the same way that IntelliJ IDEA does.
- org.openrewrite.kotlin.RenameTypeAlias
- Rename type alias
- Change the name of a given type alias.
- org.openrewrite.kotlin.cleanup.RemoveLambdaArgumentParentheses
- Remove method invocation parentheses around single lambda argument
- For example, convert
1.let(\{ it + 1 \})to1.let \{ it + 1 \}.
- org.openrewrite.kotlin.cleanup.RemoveTrailingComma
- Remove trailing comma in Kotlin
- Remove trailing commas in variable, parameter, and class property lists.
- org.openrewrite.kotlin.cleanup.RemoveTrailingSemicolon
- Remove unnecessary trailing semicolon
- Some Java programmers may mistakenly add semicolons at the end when writing Kotlin code, but in reality, they are not necessary.
- org.openrewrite.kotlin.cleanup.UnnecessaryTypeParentheses
- Remove unnecessary parentheses on Kotlin types
- In Kotlin, it's possible to add redundant nested parentheses in type definitions. This recipe is designed to remove those unnecessary parentheses.
- org.openrewrite.kotlin.format.AutoFormat
- Format Kotlin code
- Format Kotlin code using a standard comprehensive set of Kotlin formatting recipes.
org.openrewrite:rewrite-maven
- org.openrewrite.maven.AddCommentToMavenDependency
- Add a comment to a
Mavendependency or plugin - Adds a comment as the first element in a
Mavendependency or plugin.
- Add a comment to a
- org.openrewrite.maven.AddDevelocityMavenExtension
- Add the Develocity Maven extension
- To integrate the Develocity Maven extension into Maven projects, ensure that the
develocity-maven-extensionis added to the.mvn/extensions.xmlfile if not already present. Additionally, configure the extension by adding the.mvn/develocity.xmlconfiguration file.
- org.openrewrite.maven.AddManagedPlugin
- Add Managed Maven plugin
- Add the specified Maven plugin to the Plugin Managed of the pom.xml.
- org.openrewrite.maven.AddParentPom
- Add Maven parent
- Add a parent pom to a Maven pom.xml. Does nothing if a parent pom is already present.
- org.openrewrite.maven.AddRepository
- Add repository
- Adds a new Maven Repository or updates a matching repository.
- org.openrewrite.maven.AddRuntimeConfig
- Add a configuration option for the Maven runtime
- Add a new configuration option for the Maven runtime if not already present.
- org.openrewrite.maven.ChangeExclusion
- Change Maven dependency exclusion
- Modify Maven dependency exclusions, changing the group ID, artifact Id, or both. Useful when an excluded dependency has been renamed and references to it must be updated.
- org.openrewrite.maven.ChangePluginConfiguration
- Change Maven plugin configuration
- Apply the specified configuration to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
- org.openrewrite.maven.ChangePluginDependencies
- Change Maven plugin dependencies
- Applies the specified dependencies to a Maven plugin. Will not add the plugin if it does not already exist in the pom.
- org.openrewrite.maven.ChangeProjectVersion
- Change Maven Project Version
- Change the project version of a Maven pom.xml. Identifies the project to be changed by its groupId and artifactId. If the version is defined as a property, this recipe will only change the property value if the property exists within the same pom.
- org.openrewrite.maven.EnableDevelocityBuildCache
- Enable Develocity build cache
- Add Develocity build cache configuration to any
.mvn/Develocity configuration file that lack existing configuration.
- org.openrewrite.maven.IncrementProjectVersion
- Increment Maven project version
- Increase Maven project version by incrementing either the major, minor, or patch version as defined by semver. Other versioning schemes are not supported.
- org.openrewrite.maven.ManageDependencies
- Manage dependencies
- Make existing dependencies managed by moving their version to be specified in the dependencyManagement section of the POM.
- org.openrewrite.maven.ManagedToRuntimeDependencies
- Convert managed dependencies to runtime dependencies
- This recipe processes Maven POMs, converting all
<dependencyManagement>entries into runtime scoped<dependencies>entries. Import scoped BOMs (like jackson-bom) are left unmodified in<dependencyManagement>. Some style guidelines prefer that<dependencyManagement>be used only for BOMs. This maintain that style while avoiding introducing new symbols onto the compile classpath unintentionally.
- org.openrewrite.maven.ModernizeObsoletePoms
- Modernize obsolete Maven poms
- Very old Maven poms are no longer supported by current versions of Maven. This recipe updates poms with
<pomVersion>3</pomVersion>to<modelVersion>4.0.0</modelVersion>of the Maven pom schema. This does not attempt to upgrade old dependencies or plugins and is best regarded as the starting point of a migration rather than an end-point.
- org.openrewrite.maven.RemoveRepository
- Remove repository
- Removes a matching Maven repository.
- org.openrewrite.maven.RemoveUnusedProperties
- Remove unused properties
- Detect and remove Maven property declarations which do not have any usage within the project.
- org.openrewrite.maven.UpdateMavenWrapper
- Update Maven wrapper
- Update the version of Maven used in an existing Maven wrapper.
- org.openrewrite.maven.UpgradeTransitiveDependencyVersion
- Upgrade transitive Maven dependencies
- Upgrades the version of a transitive dependency in a Maven pom file. Leaves direct dependencies unmodified. Can be paired with the regular Upgrade Dependency Version recipe to upgrade a dependency everywhere, regardless of whether it is direct or transitive.
- org.openrewrite.maven.cleanup.DependencyManagementDependencyRequiresVersion
- Dependency management dependencies should have a version
- If they don't have a version, they can't possibly affect dependency resolution anywhere, and can be safely removed.
- org.openrewrite.maven.search.DoesNotIncludeDependency
- Does not include Maven dependency
- A precondition which returns false if visiting a Maven pom which includes the specified dependency in the classpath of some scope. For compatibility with multimodule projects, this should most often be applied as a precondition.
- org.openrewrite.maven.search.EffectiveDependencies
- Effective dependencies
- Emit the data of binary dependency relationships.
- org.openrewrite.maven.search.EffectiveManagedDependencies
- Effective managed dependencies
- Emit the data of binary dependency relationships.
- org.openrewrite.maven.search.EffectiveMavenRepositories
- List effective Maven repositories
- Lists the Maven repositories that would be used for dependency resolution, in order of precedence. This includes Maven repositories defined in the Maven settings file (and those contributed by active profiles) as determined when the LST was produced.
- org.openrewrite.maven.search.FindManagedDependency
- Find Maven dependency management entry
- Finds first-order dependency management entries, i.e. dependencies that are defined directly in a project.
- org.openrewrite.maven.search.FindMavenProject
- Find Maven projects
- Maven projects are
pom.xmlfiles with aMavenResolutionResultmarker.
- org.openrewrite.maven.search.FindMavenSettings
- Find effective maven settings
- List the effective maven settings file for the current project.
- org.openrewrite.maven.search.FindPlugin
- Find Maven plugin
- Finds a Maven plugin within a pom.xml.
- org.openrewrite.maven.search.FindProperties
- Find Maven project properties
- Finds the specified Maven project properties within a pom.xml.
- org.openrewrite.maven.search.FindRepositoryOrder
- Maven repository order
- Determine the order in which dependencies will be resolved for each
pom.xmlbased on its defined repositories and effectivesettings.xml.
- org.openrewrite.maven.search.FindScm
- Find SCM tag
- Finds any
<scm>tag directly inside the<project>root of a Maven pom.xml file.
- org.openrewrite.maven.search.ModuleHasDependency
- Module has dependency
- Searches for Maven modules that have a dependency matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a module with a matching dependency. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that use spring-boot-starter, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindDependencyrecipe instead.
- org.openrewrite.maven.search.ModuleHasPlugin
- Module has plugin
- Searches for Maven modules that have a plugin matching the specified groupId and artifactId. Places a
SearchResultmarker on all sources within a module with a matching plugin. This recipe is intended to be used as a precondition for other recipes. For example this could be used to limit the application of a spring boot migration to only projects that apply the spring boot plugin, limiting unnecessary upgrading. If the search result you want is instead just the build.gradle(.kts) file applying the plugin, use theFindPluginsrecipe instead.
- org.openrewrite.maven.search.ParentPomInsight
- Maven parent insight
- Find Maven parents matching a
groupIdandartifactId.
- org.openrewrite.maven.utilities.PrintMavenAsDot
- Print Maven dependency hierarchy in DOT format
- The DOT language format is specified here.
org.openrewrite:rewrite-properties
- org.openrewrite.properties.AddPropertyComment
- Add comment before property key
- Add a new comment before a property key if not already present, optionally commenting out the property.
org.openrewrite:rewrite-toml
- org.openrewrite.toml.ChangeKey
- Change TOML key
- Change a TOML key, while leaving the value intact.
- org.openrewrite.toml.ChangeTableRowValue
- Change TOML table row value
- Change a value in a TOML table row when the identifying property matches the specified matcher.
- org.openrewrite.toml.ChangeValue
- Change TOML value
- Change the value of a TOML key.
- org.openrewrite.toml.CreateTomlFile
- Create TOML file
- Create a new TOML file.
- org.openrewrite.toml.DeleteKey
- Delete TOML key
- Delete a TOML key-value pair.
- org.openrewrite.toml.DeleteTable
- Delete TOML table
- Delete a TOML table.
- org.openrewrite.toml.DeleteTableRow
- Delete TOML table row
- Delete a TOML table row when one of its values matches the specified matcher.
- org.openrewrite.toml.FindKey
- Find TOML keys
- Find TOML keys matching a path expression.
- org.openrewrite.toml.MergeTableRow
- Merge TOML table row
- Merge a TOML row into an array table. If a row with the same identifying property exists, merge the values. Otherwise, insert a new row.
- org.openrewrite.toml.ReplaceTableRow
- Replace TOML table row
- Replace a TOML table row with new content. If a row with the same identifying property exists, replace it entirely.
org.openrewrite:rewrite-xml
- org.openrewrite.xml.AddTagAttribute
- Add new XML attribute for an Element
- Add new XML attribute with value on a specified element.
- org.openrewrite.xml.RemoveEmptyXmlTags
- Remove empty XML Tag
- Removes XML tags that do not have attributes or children, including self closing tags.
- org.openrewrite.xml.RemoveTrailingWhitespace
- Remove trailing whitespace
- Remove any extra trailing whitespace from the end of each line.
- org.openrewrite.xml.XsltTransformation
- XSLT transformation
- Apply the specified XSLT transformation on matching files. Note that there are no format matching guarantees when running this recipe.
- org.openrewrite.xml.format.AutoFormat
- Format XML
- Indents XML using the most common indentation size and tabs or space choice in use in the file.
- org.openrewrite.xml.format.LineBreaks
- Blank lines
- Add line breaks at appropriate places between XML syntax elements.
- org.openrewrite.xml.format.NormalizeFormat
- Normalize format
- Move whitespace to the outermost LST element possible.
- org.openrewrite.xml.format.NormalizeLineBreaks
- Normalize line breaks
- Consistently use either Windows style (CRLF) or Linux style (LF) line breaks. If no
GeneralFormatStyleis specified this will use whichever style of line endings are more common.
- org.openrewrite.xml.format.NormalizeTabsOrSpaces
- Normalize to tabs or spaces
- Consistently use either tabs or spaces in indentation.
- org.openrewrite.xml.format.TabsAndIndents
- Tabs and indents
- Format tabs and indents in XML code.
- org.openrewrite.xml.search.DoesNotUseNamespaceUri
- Find files without Namespace URI
- Find XML root elements that do not have a specific Namespace URI, optionally restricting the search by an XPath expression.
- org.openrewrite.xml.search.FindNamespacePrefix
- Find XML namespace prefixes
- Find XML namespace prefixes, optionally restricting the search by a XPath expression.
- org.openrewrite.xml.search.FindTags
- Find XML tags
- Find XML tags by XPath expression.
- org.openrewrite.xml.search.HasNamespaceUri
- Find XML namespace URIs
- Find XML namespace URIs, optionally restricting the search by a XPath expression.
- org.openrewrite.xml.security.AddOwaspDateBoundSuppressions
- Add date bounds to OWASP suppressions
- Adds an expiration date to all OWASP suppressions in order to ensure that they are periodically reviewed. For use with the OWASP
dependency-checktool. More details: https://jeremylong.github.io/DependencyCheck/general/suppression.html.
- org.openrewrite.xml.security.IsOwaspSuppressionsFile
- Find OWASP vulnerability suppression XML files
- These files are used to suppress false positives in OWASP Dependency Check.
- org.openrewrite.xml.security.RemoveOwaspSuppressions
- Remove out-of-date OWASP suppressions
- Remove all OWASP suppressions with a suppression end date in the past, as these are no longer valid. For use with the OWASP
dependency-checktool. More details on OWASP suppression files can be found here.
- org.openrewrite.xml.security.UpdateOwaspSuppressionDate
- Update OWASP suppression date bounds
- Updates the expiration date for OWASP suppressions having a matching cve tag. For use with the OWASP
dependency-checktool. More details: https://jeremylong.github.io/DependencyCheck/general/suppression.html.
- org.openrewrite.xml.style.AutodetectDebug
- XML style Auto-detection debug
- Runs XML Autodetect and records the results in data tables and search markers. A debugging tool for figuring out why XML documents get styled the way they do.
org.openrewrite:rewrite-yaml
- org.openrewrite.yaml.AddCommentToProperty
- Add comment to a YAML property
- Add a comment to a YAML property. The comment will be added on the line before the property.
- org.openrewrite.yaml.AppendToSequence
- Append to sequence
- Append item to YAML sequence.
- org.openrewrite.yaml.ChangePropertyValue
- Change YAML property
- Change a YAML property. Expects dot notation for nested YAML mappings, similar to how Spring Boot interprets
application.ymlfiles.
- org.openrewrite.yaml.CoalesceProperties
- Coalesce YAML properties
- Simplify nested map hierarchies into their simplest dot separated property form, similar to how Spring Boot interprets
application.ymlfiles.
- org.openrewrite.yaml.CommentOutProperty
- Comment out property
- Comment out a YAML property and add a comment in front.
- org.openrewrite.yaml.CreateYamlFile
- Create YAML file
- Create a new YAML file.
- org.openrewrite.yaml.DeleteProperty
- Delete property
- Delete a YAML property. Nested YAML mappings are interpreted as dot separated property names, i.e. as Spring Boot interprets application.yml files like
a.b.c.dora.b.c:d.
- org.openrewrite.yaml.UnfoldProperties
- Unfold YAML properties
- Transforms dot-separated property keys in YAML files into nested map hierarchies to enhance clarity and readability, or for compatibility with tools expecting structured YAML.
- org.openrewrite.yaml.format.Indents
- YAML indent
- Format tabs and indents in YAML.
other
- ai.timefold.solver.migration.ToLatest
- Upgrade to the latest Timefold Solver
- Replace all your calls to deleted/deprecated types and methods of Timefold Solver with their proper alternatives.
- io.moderne.devcenter.ApacheDevCenter
- DevCenter for Apache
- A DevCenter that tracks the latest Apache Maven parent POM versions and applies best practices.
- io.moderne.devcenter.ApacheMavenDevCenter
- DevCenter for Apache Maven
- A DevCenter that tracks the latest Apache Maven parent POM versions and applies best practices. This DevCenter includes recipes to upgrade the parent POMs of Apache Maven, as well as a collection of best practices for Maven POMs.
- io.moderne.devcenter.BuildToolStarter
- DevCenter for Gradle and Maven
- Track and automate upgrades for Gradle, Maven, and Java versions.
- io.moderne.devcenter.DevCenterStarter
- DevCenter
- This is a default DevCenter configuration that can be used as a starting point for your own DevCenter configuration. It includes a combination of upgrades, migrations, and security fixes. You can customize this configuration to suit your needs. For more information on how to customize your DevCenter configuration, see the DevCenter documentation.
- io.moderne.devcenter.QuarkusDevCenter
- DevCenter for Quarkus
- A DevCenter that tracks the latest Quarkus framework versions and applies best practices. This DevCenter includes recipes to upgrade Quarkus versions, migrate from deprecated APIs, and ensure compatibility with the latest Java versions and testing frameworks.
- io.moderne.devcenter.UpgradeApacheParent
- Upgrade Apache Parent POM
- Upgrades the Apache parent POM to the latest version.
- io.moderne.devcenter.UpgradeMavenParent
- Upgrade Apache Maven Parent
- Upgrades the Apache Maven parent POM to the latest version.
- io.moderne.devcenter.UpgradeMavenPluginsParent
- Upgrade Maven Plugins Parent
- Upgrades the Apache Maven parent POM to the latest version.
- io.moderne.devcenter.UpgradeMavenSharedParent
- Upgrade Maven Shared Parent
- Upgrades the Apache Maven parent POM to the latest version.
- io.moderne.devcenter.UpgradeQuarkus3_x
- Upgrade to Quarkus 3.26
- Upgrades Quarkus dependencies to version 3.26.x, including core, extensions, and tooling.
- io.moderne.devcenter.UpgradeQuarkusUniverseBom
- Upgrade Quarkus Universe BOM
- Upgrades the Quarkus Universe BOM parent to the latest version.
- io.moderne.devcenter.VulnerabilitiesDevCenter
- DevCenter for Vulnerability Management
- Recipes to analyze and manage dependency vulnerabilities using Moderne DevCenter.
- org.apache.wicket.BestPractices
- Wicket best practices
- Applies Wicket best practices such as minimizing anonymous inner classes and upgrading to the latest version.
- org.axonframework.migration.UpgradeAxonFramework_4_Jakarta
- Upgrade to Axonframework 4.x Jakarta
- Migration file to upgrade from an Axon Framework Javax-specific project to Jakarta.
- org.axonframework.migration.UpgradeAxonFramework_4_Javax
- Upgrade to Axonframework 4.x Javax
- Migration file to upgrade an Axon Framework Javax-specific project and remain on Javax.
- org.openrewrite.apache.commons.collections.UpgradeApacheCommonsCollections_3_4
- Migrates to Apache Commons Collections 4.x
- Migrate applications to the latest Apache Commons Collections 4.x release. This recipe modifies application's build files, make changes to deprecated/preferred APIs, and migrates configuration settings that have changes between versions.
- org.openrewrite.apache.commons.io.RelocateApacheCommonsIo
- Relocate
org.apache.commons:commons-iotocommons-io:commons-io - The deployment of
org.apache.commons:commons-iowas a publishing mistake around 2012 which was corrected by changing the deployment GAV to be located undercommons-io:commons-io.
- Relocate
- org.openrewrite.apache.commons.io.UseStandardCharsets
- Prefer
java.nio.charset.StandardCharsets - Prefer the Java standard library's
java.nio.charset.StandardCharsetsover third-party usage of apache'sorg.apache.commons.io.Charsets.
- Prefer
- org.openrewrite.apache.commons.io.UseSystemLineSeparator
- Prefer
System.lineSeparator() - Prefer the Java standard library's
System.lineSeparator()over third-party usage of apache'sIOUtils.LINE_SEPARATOR.
- Prefer
- org.openrewrite.apache.commons.math.UpgradeApacheCommonsMath_2_3
- Migrates to Apache Commons Math 3.x
- Migrate applications to the latest Apache Commons Math 3.x release. This recipe modifies application's build files, make changes to deprecated/preferred APIs, and migrates configuration settings that have changes between versions.
- org.openrewrite.apache.poi.UpgradeApachePoi_5
- Migrates to Apache POI 5.x
- Migrates to the latest Apache POI 5.x release. This recipe modifies build files to account for artifact renames and upgrades dependency versions. It also chains the 4.1 recipe to handle all prior API migrations.
- org.openrewrite.codemods.cleanup.javascript.ArrowBodyStyle
- Require braces around arrow function bodies
- Require braces around arrow function bodies See rule details.
- org.openrewrite.codemods.cleanup.javascript.BetterRegex
- Improve regexes by making them shorter, consistent, and safer
- Improve regexes by making them shorter, consistent, and safer. See rule details.
- org.openrewrite.codemods.cleanup.javascript.CapitalizedComments
- Enforce or disallow capitalization of the first letter of a comment
- Enforce or disallow capitalization of the first letter of a comment See rule details.
- org.openrewrite.codemods.cleanup.javascript.CatchErrorName
- Enforce a specific parameter name in catch clauses
- Enforce a specific parameter name in catch clauses. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ConsistentDestructuring
- Use destructured variables over properties
- Use destructured variables over properties. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ConsistentTypeSpecifierStyle
- Enforce or ban the use of inline type-only markers for named imports
- Enforce or ban the use of inline type-only markers for named imports See rule details for import/consistent-type-specifier-style.
- org.openrewrite.codemods.cleanup.javascript.Curly
- Enforce consistent brace style for all control statements
- Enforce consistent brace style for all control statements See rule details.
- org.openrewrite.codemods.cleanup.javascript.CustomErrorDefinition
- Enforce correct
Errorsubclassing - Enforce correct
Errorsubclassing. See rule details.
- Enforce correct
- org.openrewrite.codemods.cleanup.javascript.DotNotation
- Enforce dot notation whenever possible
- Enforce dot notation whenever possible See rule details.
- org.openrewrite.codemods.cleanup.javascript.EmptyBraceSpaces
- Enforce no spaces between braces
- Enforce no spaces between braces. See rule details.
- org.openrewrite.codemods.cleanup.javascript.Eqeqeq
- Require the use of
===and!== - Require the use of
===and!==See rule details.
- Require the use of
- org.openrewrite.codemods.cleanup.javascript.EscapeCase
- Require escape sequences to use uppercase values
- Require escape sequences to use uppercase values. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ExplicitLengthCheck
- Enforce explicitly comparing the length or size property of a value
- Enforce explicitly comparing the length or size property of a value. See rule details.
- org.openrewrite.codemods.cleanup.javascript.First
- Ensure all imports appear before other statements
- Ensure all imports appear before other statements See rule details for import/first.
- org.openrewrite.codemods.cleanup.javascript.LogicalAssignmentOperators
- Require or disallow logical assignment operator shorthand
- Require or disallow logical assignment operator shorthand See rule details.
- org.openrewrite.codemods.cleanup.javascript.MultilineCommentStyle
- Enforce a particular style for multiline comments
- Enforce a particular style for multiline comments See rule details.
- org.openrewrite.codemods.cleanup.javascript.NewForBuiltins
- Enforce the use of
newfor all builtins, exceptString,Number,Boolean,Symbol, andBigInt - Enforce the use of
newfor all builtins, exceptString,Number,Boolean,Symbol, andBigInt. See rule details.
- Enforce the use of
- org.openrewrite.codemods.cleanup.javascript.NewlineAfterImport
- Enforce a newline after import statements
- Enforce a newline after import statements See rule details for import/newline-after-import.
- org.openrewrite.codemods.cleanup.javascript.NoAbsolutePath
- Forbid import of modules using absolute paths
- Forbid import of modules using absolute paths See rule details for import/no-absolute-path.
- org.openrewrite.codemods.cleanup.javascript.NoArrayForEach
- Prefer
for…ofover theforEachmethod - Prefer
for…ofover theforEachmethod. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.NoArrayMethodThisArgument
- Disallow using the
thisargument in array methods - Disallow using the
thisargument in array methods. See rule details.
- Disallow using the
- org.openrewrite.codemods.cleanup.javascript.NoArrayPushPush
- Enforce combining multiple
Array#push()into one call - Enforce combining multiple
Array#push()into one call. See rule details.
- Enforce combining multiple
- org.openrewrite.codemods.cleanup.javascript.NoAwaitExpressionMember
- Disallow member access from
awaitexpression - Disallow member access from
awaitexpression. See rule details.
- Disallow member access from
- org.openrewrite.codemods.cleanup.javascript.NoConsoleSpaces
- Do not use leading/trailing space between
console.logparameters - Do not use leading/trailing space between
console.logparameters. See rule details.
- Do not use leading/trailing space between
- org.openrewrite.codemods.cleanup.javascript.NoDivRegex
- Disallow equal signs explicitly at the beginning of regular expressions
- Disallow equal signs explicitly at the beginning of regular expressions See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoDuplicates
- Forbid repeated import of the same module in multiple places
- Forbid repeated import of the same module in multiple places See rule details for import/no-duplicates.
- org.openrewrite.codemods.cleanup.javascript.NoElseReturn
- Disallow else blocks after return statements in if statements
- Disallow else blocks after return statements in if statements See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoEmptyNamedBlocks
- Forbid empty named import
- Forbid empty named import See rule details for import/no-empty-named-blocks.
- org.openrewrite.codemods.cleanup.javascript.NoExtraBind
- Disallow unnecessary calls to
.bind() - Disallow unnecessary calls to
.bind()See rule details.
- Disallow unnecessary calls to
- org.openrewrite.codemods.cleanup.javascript.NoExtraLabel
- Disallow unnecessary labels
- Disallow unnecessary labels See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoForLoop
- Do not use a
forloop that can be replaced with afor-ofloop - Do not use a
forloop that can be replaced with afor-ofloop. See rule details.
- Do not use a
- org.openrewrite.codemods.cleanup.javascript.NoHexEscape
- Enforce the use of Unicode escapes instead of hexadecimal escapes
- Enforce the use of Unicode escapes instead of hexadecimal escapes. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoImplicitCoercion
- Disallow shorthand type conversions
- Disallow shorthand type conversions See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoImportModuleExports
- Forbid import statements with CommonJS module.exports
- Forbid import statements with CommonJS module.exports See rule details for import/no-import-module-exports.
- org.openrewrite.codemods.cleanup.javascript.NoInstanceofArray
- Require
Array.isArray()instead ofinstanceof Array - Require
Array.isArray()instead ofinstanceof Array. See rule details.
- Require
- org.openrewrite.codemods.cleanup.javascript.NoLonelyIf
- Disallow if statements as the only statement in else blocks
- Disallow if statements as the only statement in else blocks See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoNamespace
- Forbid namespace (a.k.a. "wildcard"
*) imports - Forbid namespace (a.k.a. "wildcard"
*) imports. See rule details for import/no-namespace.
- Forbid namespace (a.k.a. "wildcard"
- org.openrewrite.codemods.cleanup.javascript.NoNegatedCondition
- Disallow negated conditions
- Disallow negated conditions. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoNestedTernary
- Disallow nested ternary expressions
- Disallow nested ternary expressions. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoNewArray
- Disallow
new Array() - Disallow
new Array(). See rule details.
- Disallow
- org.openrewrite.codemods.cleanup.javascript.NoNewBuffer
- Enforce the use of
Buffer.from()andBuffer.alloc()instead of the deprecatednew Buffer() - Enforce the use of
Buffer.from()andBuffer.alloc()instead of the deprecatednew Buffer(). See rule details.
- Enforce the use of
- org.openrewrite.codemods.cleanup.javascript.NoNull
- Disallow the use of the
nullliteral - Disallow the use of the
nullliteral. See rule details.
- Disallow the use of the
- org.openrewrite.codemods.cleanup.javascript.NoRelativePackages
- Forbid importing packages through relative paths
- Forbid importing packages through relative paths See rule details for import/no-relative-packages.
- org.openrewrite.codemods.cleanup.javascript.NoStaticOnlyClass
- Disallow classes that only have static members
- Disallow classes that only have static members. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoTypeofUndefined
- Disallow comparing
undefinedusingtypeof - Disallow comparing
undefinedusingtypeof. See rule details.
- Disallow comparing
- org.openrewrite.codemods.cleanup.javascript.NoUndefInit
- Disallow initializing variables to undefined
- Disallow initializing variables to undefined See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUnnecessaryAwait
- Disallow awaiting non-promise values
- Disallow awaiting non-promise values. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUnneededTernary
- Disallow ternary operators when simpler alternatives exist
- Disallow ternary operators when simpler alternatives exist See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUnreadableArrayDestructuring
- Disallow unreadable array destructuring
- Disallow unreadable array destructuring. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessComputedKey
- Disallow unnecessary computed property keys in objects and classes
- Disallow unnecessary computed property keys in objects and classes See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessFallbackInSpread
- Disallow useless fallback when spreading in object literals
- Disallow useless fallback when spreading in object literals. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessLengthCheck
- Disallow useless array
lengthcheck - Disallow useless array
lengthcheck. See rule details.
- Disallow useless array
- org.openrewrite.codemods.cleanup.javascript.NoUselessPathSegments
- Forbid unnecessary path segments in import and require statements
- Forbid unnecessary path segments in import and require statements See rule details for import/no-useless-path-segments.
- org.openrewrite.codemods.cleanup.javascript.NoUselessPromiseResolveReject
- Disallow returning/yielding
Promise.resolve()/reject()inasyncfunctions or promise callbacks - Disallow returning/yielding
Promise.resolve()/reject()inasyncfunctions or promise callbacks. See rule details.
- Disallow returning/yielding
- org.openrewrite.codemods.cleanup.javascript.NoUselessRename
- Disallow renaming import, export, and destructured assignments to the same name
- Disallow renaming import, export, and destructured assignments to the same name See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessReturn
- Disallow redundant return statements
- Disallow redundant return statements See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessSpread
- Disallow unnecessary spread
- Disallow unnecessary spread. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NoUselessUndefined
- Disallow useless
undefined - Disallow useless
undefined. See rule details.
- Disallow useless
- org.openrewrite.codemods.cleanup.javascript.NoVar
- Require
letorconstinstead ofvar - Require
letorconstinstead ofvarSee rule details.
- Require
- org.openrewrite.codemods.cleanup.javascript.NoZeroFractions
- Disallow number literals with zero fractions or dangling dots
- Disallow number literals with zero fractions or dangling dots. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NumberLiteralCase
- Enforce proper case for numeric literals
- Enforce proper case for numeric literals. See rule details.
- org.openrewrite.codemods.cleanup.javascript.NumericSeparatorsStyle
- Enforce the style of numeric separators by correctly grouping digits
- Enforce the style of numeric separators by correctly grouping digits. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ObjectShorthand
- Require or disallow method and property shorthand syntax for object literals
- Require or disallow method and property shorthand syntax for object literals See rule details.
- org.openrewrite.codemods.cleanup.javascript.OneVar
- Enforce variables to be declared either together or separately in functions
- Enforce variables to be declared either together or separately in functions See rule details.
- org.openrewrite.codemods.cleanup.javascript.OperatorAssignment
- Require or disallow assignment operator shorthand where possible
- Require or disallow assignment operator shorthand where possible See rule details.
- org.openrewrite.codemods.cleanup.javascript.Order
- Enforce a convention in module import order
- Enforce a convention in module import order See rule details for import/order.
- org.openrewrite.codemods.cleanup.javascript.PreferAddEventListener
- Prefer
.addEventListener()and.removeEventListener()over on-functions - Prefer
.addEventListener()and.removeEventListener()over on-functions. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayFind
- Prefer
.find()and.findLast()over the first or last element from.filter() - Prefer
.find()and.findLast()over the first or last element from.filter(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayFlat
- Prefer
Array#flat()over legacy techniques to flatten arrays - Prefer
Array#flat()over legacy techniques to flatten arrays. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayFlatMap
- Prefer
.flatMap()over.map().flat() - Prefer
.flatMap()over.map().flat(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrayIndexOf
- Prefer
Array#\{indexOf,lastIndexOf\}()overArray#\{findIndex,findLastIndex\}()when looking for the index of an item - Prefer
Array#\{indexOf,lastIndexOf\}()overArray#\{findIndex,findLastIndex\}()when looking for the index of an item. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArraySome
- Prefer
.some()over.filter().lengthcheck and.\{find,findLast\}() - Prefer
.some()over.filter().lengthcheck and.\{find,findLast\}(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferArrowCallback
- Require using arrow functions for callbacks
- Require using arrow functions for callbacks See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferAt
- Prefer
.at()method for index access andString#charAt() - Prefer
.at()method for index access andString#charAt(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferConst
- Require const declarations for variables that are never reassigned after declared
- Require const declarations for variables that are never reassigned after declared See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferDateNow
- Prefer
Date.now()to get the number of milliseconds since the Unix Epoch - Prefer
Date.now()to get the number of milliseconds since the Unix Epoch. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferDefaultParameters
- Prefer default parameters over reassignment
- Prefer default parameters over reassignment. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferDestructuring
- Require destructuring from arrays and/or objects
- Require destructuring from arrays and/or objects See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferDomNodeAppend
- Prefer
Node#append()overNode#appendChild() - Prefer
Node#append()overNode#appendChild(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferDomNodeDataset
- Prefer using
.dataseton DOM elements over calling attribute methods - Prefer using
.dataseton DOM elements over calling attribute methods. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferDomNodeRemove
- Prefer
childNode.remove()overparentNode.removeChild(childNode) - Prefer
childNode.remove()overparentNode.removeChild(childNode). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferExponentiationOperator
- Disallow the use of
Math.powin favor of the ** operator - Disallow the use of
Math.powin favor of the ** operator See rule details.
- Disallow the use of
- org.openrewrite.codemods.cleanup.javascript.PreferExportFrom
- Prefer
export…fromwhen re-exporting - Prefer
export…fromwhen re-exporting. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferIncludes
- Prefer
.includes()over.indexOf()andArray#some()when checking for existence or non-existence - Prefer
.includes()over.indexOf()andArray#some()when checking for existence or non-existence. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferJsonParseBuffer
- Prefer reading a JSON file as a buffer
- Prefer reading a JSON file as a buffer. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferKeyboardEventKey
- Prefer
KeyboardEvent#keyoverKeyboardEvent#keyCode - Prefer
KeyboardEvent#keyoverKeyboardEvent#keyCode. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferMathTrunc
- Enforce the use of
Math.trunc()instead of bitwise operators - Enforce the use of
Math.trunc()instead of bitwise operators. See rule details.
- Enforce the use of
- org.openrewrite.codemods.cleanup.javascript.PreferModernDomApis
- Prefer
.before()over.insertBefore(),.replaceWith()over.replaceChild(), prefer one of.before(),.after(),.append()or.prepend()overinsertAdjacentText()andinsertAdjacentElement() - Prefer
.before()over.insertBefore(),.replaceWith()over.replaceChild(), prefer one of.before(),.after(),.append()or.prepend()overinsertAdjacentText()andinsertAdjacentElement(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferModernMathApis
- Prefer modern Math APIs over legacy patterns
- Prefer modern Math APIs over legacy patterns. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferModule
- Prefer JavaScript modules (ESM) over CommonJS
- Prefer JavaScript modules (ESM) over CommonJS. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferNativeCoercionFunctions
- Prefer using
String,Number,BigInt,Boolean, andSymboldirectly - Prefer using
String,Number,BigInt,Boolean, andSymboldirectly. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferNegativeIndex
- Prefer negative index over
.length - indexwhen possible - Prefer negative index over
.length - indexwhen possible. See rule details.
- Prefer negative index over
- org.openrewrite.codemods.cleanup.javascript.PreferNodeProtocol
- Prefer using the
node:protocol when importing Node.js builtin modules - Prefer using the
node:protocol when importing Node.js builtin modules. See rule details.
- Prefer using the
- org.openrewrite.codemods.cleanup.javascript.PreferNumberProperties
- Prefer
Numberstatic properties over global ones - Prefer
Numberstatic properties over global ones. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferNumericLiterals
- Disallow
parseInt()andNumber.parseInt()in favor of binary, octal, and hexadecimal literals - Disallow
parseInt()andNumber.parseInt()in favor of binary, octal, and hexadecimal literals See rule details.
- Disallow
- org.openrewrite.codemods.cleanup.javascript.PreferObjectFromEntries
- Prefer using
Object.fromEntries()to transform a list of key-value pairs into an object - Prefer using
Object.fromEntries()to transform a list of key-value pairs into an object. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferObjectHasOwn
- Disallow use of
Object.prototype.hasOwnProperty.call()and prefer use ofObject.hasOwn() - Disallow use of
Object.prototype.hasOwnProperty.call()and prefer use ofObject.hasOwn() See rule details.
- Disallow use of
- org.openrewrite.codemods.cleanup.javascript.PreferObjectSpread
- Disallow using
Object.assignwith an object literal as the first argument and prefer the use of object spread instead - Disallow using
Object.assignwith an object literal as the first argument and prefer the use of object spread instead See rule details.
- Disallow using
- org.openrewrite.codemods.cleanup.javascript.PreferOptionalCatchBinding
- Prefer omitting the catch binding parameter
- Prefer omitting the catch binding parameter. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferPrototypeMethods
- Prefer borrowing methods from the prototype instead of the instance
- Prefer borrowing methods from the prototype instead of the instance. See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferQuerySelector
- Prefer
.querySelector()over.getElementById(),.querySelectorAll()over.getElementsByClassName()and.getElementsByTagName() - Prefer
.querySelector()over.getElementById(),.querySelectorAll()over.getElementsByClassName()and.getElementsByTagName(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferReflectApply
- Prefer
Reflect.apply()overFunction#apply() - Prefer
Reflect.apply()overFunction#apply(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferRegexpTest
- Prefer
RegExp#test()overString#match()andRegExp#exec() - Prefer
RegExp#test()overString#match()andRegExp#exec(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferSetHas
- Prefer
Set#has()overArray#includes()when checking for existence or non-existence - Prefer
Set#has()overArray#includes()when checking for existence or non-existence. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferSetSize
- Prefer using
Set#sizeinstead ofArray#length - Prefer using
Set#sizeinstead ofArray#length. See rule details.
- Prefer using
- org.openrewrite.codemods.cleanup.javascript.PreferSpread
- Prefer the spread operator over
Array.from(),Array#concat(),Array#\{slice,toSpliced\}()andString#split('') - Prefer the spread operator over
Array.from(),Array#concat(),Array#\{slice,toSpliced\}()andString#split(''). See rule details.
- Prefer the spread operator over
- org.openrewrite.codemods.cleanup.javascript.PreferStringReplaceAll
- Prefer
String#replaceAll()over regex searches with the global flag - Prefer
String#replaceAll()over regex searches with the global flag. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferStringSlice
- Prefer
String#slice()overString#substr()andString#substring() - Prefer
String#slice()overString#substr()andString#substring(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferStringStartsEndsWith
- Prefer
String#startsWith()&String#endsWith()overRegExp#test() - Prefer
String#startsWith()&String#endsWith()overRegExp#test(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferStringTrimStartEnd
- Prefer
String#trimStart()/String#trimEnd()overString#trimLeft()/String#trimRight() - Prefer
String#trimStart()/String#trimEnd()overString#trimLeft()/String#trimRight(). See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferSwitch
- Prefer
switchover multipleelse-if - Prefer
switchover multipleelse-if. See rule details.
- Prefer
- org.openrewrite.codemods.cleanup.javascript.PreferTemplate
- Require template literals instead of string concatenation
- Require template literals instead of string concatenation See rule details.
- org.openrewrite.codemods.cleanup.javascript.PreferTernary
- Prefer ternary expressions over simple
if-elsestatements - Prefer ternary expressions over simple
if-elsestatements. See rule details.
- Prefer ternary expressions over simple
- org.openrewrite.codemods.cleanup.javascript.PreferTypeError
- Enforce throwing
TypeErrorin type checking conditions - Enforce throwing
TypeErrorin type checking conditions. See rule details.
- Enforce throwing
- org.openrewrite.codemods.cleanup.javascript.PreventAbbreviations
- Prevent abbreviations
- Prevent abbreviations. See rule details.
- org.openrewrite.codemods.cleanup.javascript.RelativeUrlStyle
- Enforce consistent relative URL style
- Enforce consistent relative URL style. See rule details.
- org.openrewrite.codemods.cleanup.javascript.RequireArrayJoinSeparator
- Enforce using the separator argument with
Array#join() - Enforce using the separator argument with
Array#join(). See rule details.
- Enforce using the separator argument with
- org.openrewrite.codemods.cleanup.javascript.RequireNumberToFixedDigitsArgument
- Enforce using the digits argument with
Number#toFixed() - Enforce using the digits argument with
Number#toFixed(). See rule details.
- Enforce using the digits argument with
- org.openrewrite.codemods.cleanup.javascript.SortImports
- Enforce sorted import declarations within modules
- Enforce sorted import declarations within modules See rule details.
- org.openrewrite.codemods.cleanup.javascript.SortVars
- Require variables within the same declaration block to be sorted
- Require variables within the same declaration block to be sorted See rule details.
- org.openrewrite.codemods.cleanup.javascript.Strict
- Require or disallow strict mode directives
- Require or disallow strict mode directives See rule details.
- org.openrewrite.codemods.cleanup.javascript.StringContent
- Enforce better string content
- Enforce better string content. See rule details.
- org.openrewrite.codemods.cleanup.javascript.SwitchCaseBraces
- Enforce consistent brace style for case clauses
- Enforce consistent brace style for case clauses. See rule details.
- org.openrewrite.codemods.cleanup.javascript.TemplateIndent
- Fix whitespace-insensitive template indentation
- Fix whitespace-insensitive template indentation. See rule details.
- org.openrewrite.codemods.cleanup.javascript.TextEncodingIdentifierCase
- Enforce consistent case for text encoding identifiers
- Enforce consistent case for text encoding identifiers. See rule details.
- org.openrewrite.codemods.cleanup.javascript.ThrowNewError
- Require
newwhen throwing an error - Require
newwhen throwing an error. See rule details.
- Require
- org.openrewrite.codemods.cleanup.javascript.UnicodeBom
- Require or disallow Unicode byte order mark (BOM)
- Require or disallow Unicode byte order mark (BOM) See rule details.
- org.openrewrite.codemods.cleanup.javascript.Yoda
- Require or disallow "Yoda" conditions
- Require or disallow "Yoda" conditions See rule details.
- org.openrewrite.codemods.cleanup.jest.ConsistentTestIt
- Enforce test and it usage conventions
- Enforce test and it usage conventions See rule details for jest/consistent-test-it.
- org.openrewrite.codemods.cleanup.jest.NoAliasMethods
- Disallow alias methods
- Disallow alias methods See rule details for jest/no-alias-methods.
- org.openrewrite.codemods.cleanup.jest.NoDeprecatedFunctions27
- Disallow use of deprecated functions from before version 27
- Disallow use of deprecated functions from before version 27 See rule details for jest/no-deprecated-functions.
- org.openrewrite.codemods.cleanup.jest.NoJasmineGlobals
- Disallow Jasmine globals
- Disallow Jasmine globals See rule details for jest/no-jasmine-globals.
- org.openrewrite.codemods.cleanup.jest.NoTestPrefixes
- Require using .only and .skip over f and x
- Require using .only and .skip over f and x See rule details for jest/no-test-prefixes.
- org.openrewrite.codemods.cleanup.jest.NoUntypedMockFactory
- Disallow using jest.mock() factories without an explicit type parameter
- Disallow using jest.mock() factories without an explicit type parameter See rule details for jest/no-untyped-mock-factory.
- org.openrewrite.codemods.cleanup.jest.PreferComparisonMatcher
- Suggest using the built-in comparison matchers
- Suggest using the built-in comparison matchers See rule details for jest/prefer-comparison-matcher.
- org.openrewrite.codemods.cleanup.jest.PreferExpectResolves
- Prefer await expect(...).resolves over expect(await ...) syntax
- Prefer await expect(...).resolves over expect(await ...) syntax See rule details for jest/prefer-expect-resolves.
- org.openrewrite.codemods.cleanup.jest.PreferLowercaseTitle
- Enforce lowercase test names
- Enforce lowercase test names See rule details for jest/prefer-lowercase-title.
- org.openrewrite.codemods.cleanup.jest.PreferMockPromiseShorthand
- Prefer mock resolved/rejected shorthands for promises
- Prefer mock resolved/rejected shorthands for promises See rule details for jest/prefer-mock-promise-shorthand.
- org.openrewrite.codemods.cleanup.jest.PreferSpyOn
- Suggest using jest.spyOn()
- Suggest using jest.spyOn() See rule details for jest/prefer-spy-on.
- org.openrewrite.codemods.cleanup.jest.PreferToBe
- Suggest using toBe() for primitive literals
- Suggest using toBe() for primitive literals See rule details for jest/prefer-to-be.
- org.openrewrite.codemods.cleanup.jest.PreferToContain
- Suggest using toContain()
- Suggest using toContain() See rule details for jest/prefer-to-contain.
- org.openrewrite.codemods.cleanup.jest.PreferToHaveLength
- Suggest using toHaveLength()
- Suggest using toHaveLength() See rule details for jest/prefer-to-have-length.
- org.openrewrite.codemods.cleanup.jest.PreferTodo
- Suggest using test.todo
- Suggest using test.todo See rule details for jest/prefer-todo.
- org.openrewrite.codemods.cleanup.jest.RecommendedJestCodeCleanup
- Recommended Jest code cleanup
- Collection of cleanup ESLint rules that are recommended by eslint-plugin-jest.
- org.openrewrite.codemods.cleanup.jest.ValidTitle
- Enforce valid titles
- Enforce valid titles See rule details for jest/valid-title.
- org.openrewrite.codemods.cleanup.react.DestructuringAssignment
- Enforce consistent usage of destructuring assignment of props, state, and context
- Enforce consistent usage of destructuring assignment of props, state, and context See rule details for react/destructuring-assignment.
- org.openrewrite.codemods.cleanup.react.FunctionComponentDefinition
- Enforce a specific function type for function components
- Enforce a specific function type for function components See rule details for react/function-component-definition.
- org.openrewrite.codemods.cleanup.react.JsxBooleanValue
- Enforce boolean attributes notation in JSX
- Enforce boolean attributes notation in JSX See rule details for react/jsx-boolean-value.
- org.openrewrite.codemods.cleanup.react.JsxClosingBracketLocation
- Enforce closing bracket location in JSX
- Enforce closing bracket location in JSX See rule details for react/jsx-closing-bracket-location.
- org.openrewrite.codemods.cleanup.react.JsxClosingTagLocation
- Enforce closing tag location for multiline JSX
- Enforce closing tag location for multiline JSX See rule details for react/jsx-closing-tag-location.
- org.openrewrite.codemods.cleanup.react.JsxCurlyBracePresence
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes See rule details for react/jsx-curly-brace-presence.
- org.openrewrite.codemods.cleanup.react.JsxCurlyNewline
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions See rule details for react/jsx-curly-newline.
- org.openrewrite.codemods.cleanup.react.JsxCurlySpacing
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions See rule details for react/jsx-curly-spacing.
- org.openrewrite.codemods.cleanup.react.JsxEqualsSpacing
- Enforce or disallow spaces around equal signs in JSX attributes
- Enforce or disallow spaces around equal signs in JSX attributes See rule details for react/jsx-equals-spacing.
- org.openrewrite.codemods.cleanup.react.JsxFirstPropNewLine
- Enforce proper position of the first property in JSX
- Enforce proper position of the first property in JSX See rule details for react/jsx-first-prop-new-line.
- org.openrewrite.codemods.cleanup.react.JsxFragments
- Enforce shorthand or standard form for React fragments
- Enforce shorthand or standard form for React fragments See rule details for react/jsx-fragments.
- org.openrewrite.codemods.cleanup.react.JsxIndent
- Enforce JSX indentation
- Enforce JSX indentation See rule details for react/jsx-indent.
- org.openrewrite.codemods.cleanup.react.JsxIndentProps
- Enforce props indentation in JSX
- Enforce props indentation in JSX See rule details for react/jsx-indent-props.
- org.openrewrite.codemods.cleanup.react.JsxMaxPropsPerLine
- Enforce maximum of props on a single line in JSX
- Enforce maximum of props on a single line in JSX See rule details for react/jsx-max-props-per-line.
- org.openrewrite.codemods.cleanup.react.JsxNewline
- Require or prevent a new line after jsx elements and expressions
- Require or prevent a new line after jsx elements and expressions See rule details for react/jsx-newline.
- org.openrewrite.codemods.cleanup.react.JsxNoLeakedRender
- Disallow problematic leaked values from being rendered
- Disallow problematic leaked values from being rendered See rule details for react/jsx-no-leaked-render.
- org.openrewrite.codemods.cleanup.react.JsxNoTargetBlank
- Disallow target="_blank" attribute without rel="noreferrer"
- Disallow target="_blank" attribute without rel="noreferrer" See rule details for react/jsx-no-target-blank.
- org.openrewrite.codemods.cleanup.react.JsxNoUselessFragment
- Disallow unnecessary fragments
- Disallow unnecessary fragments See rule details for react/jsx-no-useless-fragment.
- org.openrewrite.codemods.cleanup.react.JsxOneExpressionPerLine
- Require one JSX element per line
- Require one JSX element per line See rule details for react/jsx-one-expression-per-line.
- org.openrewrite.codemods.cleanup.react.JsxPropsNoMultiSpaces
- Disallow multiple spaces between inline JSX props
- Disallow multiple spaces between inline JSX props See rule details for react/jsx-props-no-multi-spaces.
- org.openrewrite.codemods.cleanup.react.JsxSortProps
- Enforce props alphabetical sorting
- Enforce props alphabetical sorting See rule details for react/jsx-sort-props.
- org.openrewrite.codemods.cleanup.react.JsxSpaceBeforeClosing
- Enforce spacing before closing bracket in JSX
- Enforce spacing before closing bracket in JSX See rule details for react/jsx-space-before-closing.
- org.openrewrite.codemods.cleanup.react.JsxTagSpacing
- Enforce whitespace in and around the JSX opening and closing brackets
- Enforce whitespace in and around the JSX opening and closing brackets See rule details for react/jsx-tag-spacing.
- org.openrewrite.codemods.cleanup.react.JsxWrapMultilines
- Disallow missing parentheses around multiline JSX
- Disallow missing parentheses around multiline JSX See rule details for react/jsx-wrap-multilines.
- org.openrewrite.codemods.cleanup.react.NoArrowFunctionLifecycle
- Lifecycle methods should be methods on the prototype, not class fields
- Lifecycle methods should be methods on the prototype, not class fields See rule details for react/no-arrow-function-lifecycle.
- org.openrewrite.codemods.cleanup.react.NoUnknownProperty
- Disallow usage of unknown DOM property
- Disallow usage of unknown DOM property See rule details for react/no-unknown-property.
- org.openrewrite.codemods.cleanup.react.PreferReadOnlyProps
- Enforce that props are read-only
- Enforce that props are read-only See rule details for react/prefer-read-only-props.
- org.openrewrite.codemods.cleanup.react.SelfClosingComp
- Disallow extra closing tags for components without children
- Disallow extra closing tags for components without children See rule details for react/self-closing-comp.
- org.openrewrite.codemods.cleanup.react.SortPropTypes
- Enforce propTypes declarations alphabetical sorting
- Enforce propTypes declarations alphabetical sorting See rule details for react/sort-prop-types.
- org.openrewrite.codemods.cleanup.storybook.AwaitInteractions
- Interactions should be awaited
- Interactions should be awaited See rule details for storybook/await-interactions.
- org.openrewrite.codemods.cleanup.storybook.DefaultExports
- Story files should have a default export
- Story files should have a default export See rule details for storybook/default-exports.
- org.openrewrite.codemods.cleanup.storybook.HierarchySeparator
- Deprecated hierarchy separator in title property
- Deprecated hierarchy separator in title property See rule details for storybook/hierarchy-separator.
- org.openrewrite.codemods.cleanup.storybook.NoRedundantStoryName
- A story should not have a redundant name property
- A story should not have a redundant name property See rule details for storybook/no-redundant-story-name.
- org.openrewrite.codemods.cleanup.storybook.NoTitlePropertyInMeta
- Do not define a title in meta
- Do not define a title in meta See rule details for storybook/no-title-property-in-meta.
- org.openrewrite.codemods.cleanup.storybook.PreferPascalCase
- Stories should use PascalCase
- Stories should use PascalCase See rule details for storybook/prefer-pascal-case.
- org.openrewrite.codemods.cleanup.storybook.RecommendedStorybookCodeCleanup
- Recommended Storybook code cleanup
- Collection of cleanup ESLint rules from eslint-plugin-storybook.
- org.openrewrite.codemods.cleanup.storybook.UseStorybookExpect
- Use expect from @storybook/jest
- Use expect from @storybook/jest See rule details for storybook/use-storybook-expect.
- org.openrewrite.codemods.cleanup.storybook.UseStorybookTestingLibrary
- Do not use testing-library directly on stories
- Do not use testing-library directly on stories See rule details for storybook/use-storybook-testing-library.
- org.openrewrite.codemods.cleanup.svelte.FirstAttributeLinebreak
- Enforce the location of first attribute
- Enforce the location of first attribute See rule details for svelte/first-attribute-linebreak.
- org.openrewrite.codemods.cleanup.svelte.HtmlClosingBracketSpacing
- Require or disallow a space before tag's closing brackets
- Require or disallow a space before tag's closing brackets See rule details for svelte/html-closing-bracket-spacing.
- org.openrewrite.codemods.cleanup.svelte.HtmlQuotes
- Enforce quotes style of HTML attributes
- Enforce quotes style of HTML attributes See rule details for svelte/html-quotes.
- org.openrewrite.codemods.cleanup.svelte.HtmlSelfClosing
- Enforce self-closing style
- Enforce self-closing style See rule details for svelte/html-self-closing.
- org.openrewrite.codemods.cleanup.svelte.Indent
- Enforce consistent indentation
- Enforce consistent indentation See rule details for svelte/indent.
- org.openrewrite.codemods.cleanup.svelte.MaxAttributesPerLine
- Enforce the maximum number of attributes per line
- Enforce the maximum number of attributes per line See rule details for svelte/max-attributes-per-line.
- org.openrewrite.codemods.cleanup.svelte.MustacheSpacing
- Enforce unified spacing in mustache
- Enforce unified spacing in mustache See rule details for svelte/mustache-spacing.
- org.openrewrite.codemods.cleanup.svelte.NoDynamicSlotName
- Disallow dynamic slot name
- Disallow dynamic slot name See rule details for svelte/no-dynamic-slot-name.
- org.openrewrite.codemods.cleanup.svelte.NoSpacesAroundEqualSignsInAttribute
- Disallow spaces around equal signs in attribute
- Disallow spaces around equal signs in attribute See rule details for svelte/no-spaces-around-equal-signs-in-attribute.
- org.openrewrite.codemods.cleanup.svelte.NoUselessMustaches
- Disallow unnecessary mustache interpolations
- Disallow unnecessary mustache interpolations See rule details for svelte/no-useless-mustaches.
- org.openrewrite.codemods.cleanup.svelte.PreferClassDirective
- Require class directives instead of ternary expressions
- Require class directives instead of ternary expressions See rule details for svelte/prefer-class-directive.
- org.openrewrite.codemods.cleanup.svelte.PreferStyleDirective
- Require style directives instead of style attribute
- Require style directives instead of style attribute See rule details for svelte/prefer-style-directive.
- org.openrewrite.codemods.cleanup.svelte.RecommendedsvelteCodeCleanup
- Recommended svelte code cleanup
- Collection of cleanup ESLint rules from eslint-plugin-svelte.
- org.openrewrite.codemods.cleanup.svelte.RequireStoreReactiveAccess
- Disallow to use of the store itself as an operand. Need to use $ prefix or get function
- Disallow to use of the store itself as an operand. Need to use $ prefix or get function. See rule details for svelte/require-store-reactive-access.
- org.openrewrite.codemods.cleanup.svelte.ShorthandAttribute
- Enforce use of shorthand syntax in attribute
- Enforce use of shorthand syntax in attribute See rule details for svelte/shorthand-attribute.
- org.openrewrite.codemods.cleanup.svelte.ShorthandDirective
- Enforce use of shorthand syntax in directives
- Enforce use of shorthand syntax in directives See rule details for svelte/shorthand-directive.
- org.openrewrite.codemods.cleanup.svelte.SortAttributes
- Enforce order of attributes
- Enforce order of attributes See rule details for svelte/sort-attributes.
- org.openrewrite.codemods.cleanup.svelte.SpacedHtmlComment
- Enforce consistent spacing after the <!-- and before the --> in a HTML comment
- Enforce consistent spacing after the <!-- and before the --> in a HTML comment See rule details for svelte/spaced-html-comment.
- org.openrewrite.codemods.cleanup.vue.ArrayBracketNewline
- Enforce linebreaks after opening and before closing array brackets in
<template> - Enforce linebreaks after opening and before closing array brackets in
<template>See rule details for vue/array-bracket-newline.
- Enforce linebreaks after opening and before closing array brackets in
- org.openrewrite.codemods.cleanup.vue.ArrayBracketSpacing
- Enforce consistent spacing inside array brackets in
<template> - Enforce consistent spacing inside array brackets in
<template>See rule details for vue/array-bracket-spacing.
- Enforce consistent spacing inside array brackets in
- org.openrewrite.codemods.cleanup.vue.ArrayElementNewline
- Enforce line breaks after each array element in
<template> - Enforce line breaks after each array element in
<template>See rule details for vue/array-element-newline.
- Enforce line breaks after each array element in
- org.openrewrite.codemods.cleanup.vue.ArrowSpacing
- Enforce consistent spacing before and after the arrow in arrow functions in
<template> - Enforce consistent spacing before and after the arrow in arrow functions in
<template>See rule details for vue/arrow-spacing.
- Enforce consistent spacing before and after the arrow in arrow functions in
- org.openrewrite.codemods.cleanup.vue.AttributesOrder
- Enforce order of attributes
- Enforce order of attributes See rule details for vue/attributes-order.
- org.openrewrite.codemods.cleanup.vue.BlockOrder
- Enforce order of component top-level elements
- Enforce order of component top-level elements See rule details for vue/block-order.
- org.openrewrite.codemods.cleanup.vue.BlockSpacing
- Disallow or enforce spaces inside of blocks after opening block and before closing block in
<template> - Disallow or enforce spaces inside of blocks after opening block and before closing block in
<template>See rule details for vue/block-spacing.
- Disallow or enforce spaces inside of blocks after opening block and before closing block in
- org.openrewrite.codemods.cleanup.vue.BlockTagNewline
- Enforce line breaks after opening and before closing block-level tags
- Enforce line breaks after opening and before closing block-level tags See rule details for vue/block-tag-newline.
- org.openrewrite.codemods.cleanup.vue.BraceStyle
- Enforce consistent brace style for blocks in
<template> - Enforce consistent brace style for blocks in
<template>See rule details for vue/brace-style.
- Enforce consistent brace style for blocks in
- org.openrewrite.codemods.cleanup.vue.CommaDangle
- Require or disallow trailing commas in
<template> - Require or disallow trailing commas in
<template>See rule details for vue/comma-dangle.
- Require or disallow trailing commas in
- org.openrewrite.codemods.cleanup.vue.CommaSpacing
- Enforce consistent spacing before and after commas in
<template> - Enforce consistent spacing before and after commas in
<template>See rule details for vue/comma-spacing.
- Enforce consistent spacing before and after commas in
- org.openrewrite.codemods.cleanup.vue.CommaStyle
- Enforce consistent comma style in
<template> - Enforce consistent comma style in
<template>See rule details for vue/comma-style.
- Enforce consistent comma style in
- org.openrewrite.codemods.cleanup.vue.ComponentNameInTemplateCasing
- Enforce specific casing for the component naming style in template
- Enforce specific casing for the component naming style in template See rule details for vue/component-name-in-template-casing.
- org.openrewrite.codemods.cleanup.vue.ComponentOptionsNameCasing
- Enforce the casing of component name in components options
- Enforce the casing of component name in components options See rule details for vue/component-options-name-casing.
- org.openrewrite.codemods.cleanup.vue.ComponentTagsOrder
- Enforce order of component top-level elements
- Enforce order of component top-level elements See rule details for vue/component-tags-order.
- org.openrewrite.codemods.cleanup.vue.DefineMacrosOrder
- Enforce order of defineEmits and defineProps compiler macros
- Enforce order of defineEmits and defineProps compiler macros See rule details for vue/define-macros-order.
- org.openrewrite.codemods.cleanup.vue.DotLocation
- Enforce consistent newlines before and after dots in
<template> - Enforce consistent newlines before and after dots in
<template>See rule details for vue/dot-location.
- Enforce consistent newlines before and after dots in
- org.openrewrite.codemods.cleanup.vue.DotNotation
- Enforce dot notation whenever possible in
<template> - Enforce dot notation whenever possible in
<template>See rule details for vue/dot-notation.
- Enforce dot notation whenever possible in
- org.openrewrite.codemods.cleanup.vue.Eqeqeq
- Require the use of === and !== in
<template> - Require the use of === and !== in
<template>See rule details for vue/eqeqeq.
- Require the use of === and !== in
- org.openrewrite.codemods.cleanup.vue.FuncCallSpacing
- Require or disallow spacing between function identifiers and their invocations in
<template> - Require or disallow spacing between function identifiers and their invocations in
<template>See rule details for vue/func-call-spacing.
- Require or disallow spacing between function identifiers and their invocations in
- org.openrewrite.codemods.cleanup.vue.HtmlCommentContentNewline
- Enforce unified line brake in HTML comments
- Enforce unified line brake in HTML comments See rule details for vue/html-comment-content-newline.
- org.openrewrite.codemods.cleanup.vue.HtmlCommentContentSpacing
- Enforce unified spacing in HTML comments
- Enforce unified spacing in HTML comments See rule details for vue/html-comment-content-spacing.
- org.openrewrite.codemods.cleanup.vue.HtmlCommentIndent
- Enforce consistent indentation in HTML comments
- Enforce consistent indentation in HTML comments See rule details for vue/html-comment-indent.
- org.openrewrite.codemods.cleanup.vue.KeySpacing
- Enforce consistent spacing between keys and values in object literal properties in
<template> - Enforce consistent spacing between keys and values in object literal properties in
<template>See rule details for vue/key-spacing.
- Enforce consistent spacing between keys and values in object literal properties in
- org.openrewrite.codemods.cleanup.vue.KeywordSpacing
- Enforce consistent spacing before and after keywords in
<template> - Enforce consistent spacing before and after keywords in
<template>See rule details for vue/keyword-spacing.
- Enforce consistent spacing before and after keywords in
- org.openrewrite.codemods.cleanup.vue.MultilineTernary
- Enforce newlines between operands of ternary expressions in
<template> - Enforce newlines between operands of ternary expressions in
<template>See rule details for vue/multiline-ternary.
- Enforce newlines between operands of ternary expressions in
- org.openrewrite.codemods.cleanup.vue.NewLineBetweenMultiLineProperty
- Enforce new lines between multi-line properties in Vue components
- Enforce new lines between multi-line properties in Vue components See rule details for vue/new-line-between-multi-line-property.
- org.openrewrite.codemods.cleanup.vue.NextTickStyle
- Enforce Promise or callback style in nextTick
- Enforce Promise or callback style in nextTick See rule details for vue/next-tick-style.
- org.openrewrite.codemods.cleanup.vue.NoExtraParens
- Disallow unnecessary parentheses in
<template> - Disallow unnecessary parentheses in
<template>See rule details for vue/no-extra-parens.
- Disallow unnecessary parentheses in
- org.openrewrite.codemods.cleanup.vue.NoRequiredPropWithDefault
- Enforce props with default values to be optional
- Enforce props with default values to be optional See rule details for vue/no-required-prop-with-default.
- org.openrewrite.codemods.cleanup.vue.NoUnsupportedFeatures
- Disallow unsupported Vue.js syntax on the specified version
- Disallow unsupported Vue.js syntax on the specified version See rule details for vue/no-unsupported-features.
- org.openrewrite.codemods.cleanup.vue.NoUselessMustaches
- Disallow unnecessary mustache interpolations
- Disallow unnecessary mustache interpolations See rule details for vue/no-useless-mustaches.
- org.openrewrite.codemods.cleanup.vue.NoUselessVBind
- Disallow unnecessary v-bind directives
- Disallow unnecessary v-bind directives See rule details for vue/no-useless-v-bind.
- org.openrewrite.codemods.cleanup.vue.ObjectCurlyNewline
- Enforce consistent line breaks after opening and before closing braces in
<template> - Enforce consistent line breaks after opening and before closing braces in
<template>See rule details for vue/object-curly-newline.
- Enforce consistent line breaks after opening and before closing braces in
- org.openrewrite.codemods.cleanup.vue.ObjectCurlySpacing
- Enforce consistent spacing inside braces in
<template> - Enforce consistent spacing inside braces in
<template>See rule details for vue/object-curly-spacing.
- Enforce consistent spacing inside braces in
- org.openrewrite.codemods.cleanup.vue.ObjectPropertyNewline
- Enforce placing object properties on separate lines in
<template> - Enforce placing object properties on separate lines in
<template>See rule details for vue/object-property-newline.
- Enforce placing object properties on separate lines in
- org.openrewrite.codemods.cleanup.vue.ObjectShorthand
- Require or disallow method and property shorthand syntax for object literals in
<template> - Require or disallow method and property shorthand syntax for object literals in
<template>See rule details for vue/object-shorthand.
- Require or disallow method and property shorthand syntax for object literals in
- org.openrewrite.codemods.cleanup.vue.OperatorLinebreak
- Enforce consistent linebreak style for operators in
<template> - Enforce consistent linebreak style for operators in
<template>See rule details for vue/operator-linebreak.
- Enforce consistent linebreak style for operators in
- org.openrewrite.codemods.cleanup.vue.OrderInComponents
- Enforce order of properties in components
- Enforce order of properties in components See rule details for vue/order-in-components.
- org.openrewrite.codemods.cleanup.vue.PaddingLineBetweenBlocks
- Require or disallow padding lines between blocks
- Require or disallow padding lines between blocks See rule details for vue/padding-line-between-blocks.
- org.openrewrite.codemods.cleanup.vue.PaddingLineBetweenTags
- Require or disallow newlines between sibling tags in template
- Require or disallow newlines between sibling tags in template See rule details for vue/padding-line-between-tags.
- org.openrewrite.codemods.cleanup.vue.PaddingLinesInComponentDefinition
- Require or disallow padding lines in component definition
- Require or disallow padding lines in component definition See rule details for vue/padding-lines-in-component-definition.
- org.openrewrite.codemods.cleanup.vue.PreferDefineOptions
- Enforce use of defineOptions instead of default export
- Enforce use of defineOptions instead of default export. See rule details for vue/prefer-define-options.
- org.openrewrite.codemods.cleanup.vue.PreferSeparateStaticClass
- Require static class names in template to be in a separate class attribute
- Require static class names in template to be in a separate class attribute See rule details for vue/prefer-separate-static-class.
- org.openrewrite.codemods.cleanup.vue.PreferTemplate
- Require template literals instead of string concatenation in
<template> - Require template literals instead of string concatenation in
<template>See rule details for vue/prefer-template.
- Require template literals instead of string concatenation in
- org.openrewrite.codemods.cleanup.vue.QuoteProps
- Require quotes around object literal property names in
<template> - Require quotes around object literal property names in
<template>See rule details for vue/quote-props.
- Require quotes around object literal property names in
- org.openrewrite.codemods.cleanup.vue.RecommendedVueCodeCleanup
- Recommended vue code cleanup
- Collection of cleanup ESLint rules from eslint-plugin-vue.
- org.openrewrite.codemods.cleanup.vue.ScriptIndent
- Enforce consistent indentation in
<script> - Enforce consistent indentation in
<script>See rule details for vue/script-indent.
- Enforce consistent indentation in
- org.openrewrite.codemods.cleanup.vue.SpaceInParens
- Enforce consistent spacing inside parentheses in
<template> - Enforce consistent spacing inside parentheses in
<template>See rule details for vue/space-in-parens.
- Enforce consistent spacing inside parentheses in
- org.openrewrite.codemods.cleanup.vue.SpaceInfixOps
- Require spacing around infix operators in
<template> - Require spacing around infix operators in
<template>See rule details for vue/space-infix-ops.
- Require spacing around infix operators in
- org.openrewrite.codemods.cleanup.vue.SpaceUnaryOps
- Enforce consistent spacing before or after unary operators in
<template> - Enforce consistent spacing before or after unary operators in
<template>See rule details for vue/space-unary-ops.
- Enforce consistent spacing before or after unary operators in
- org.openrewrite.codemods.cleanup.vue.StaticClassNamesOrder
- Enforce static class names order
- Enforce static class names order See rule details for vue/static-class-names-order.
- org.openrewrite.codemods.cleanup.vue.TemplateCurlySpacing
- Require or disallow spacing around embedded expressions of template strings in
<template> - Require or disallow spacing around embedded expressions of template strings in
<template>See rule details for vue/template-curly-spacing.
- Require or disallow spacing around embedded expressions of template strings in
- org.openrewrite.codemods.cleanup.vue.ThisInTemplate
- Disallow usage of this in template
- Disallow usage of this in template See rule details for vue/this-in-template.
- org.openrewrite.codemods.cleanup.vue.VForDelimiterStyle
- Enforce v-for directive's delimiter style
- Enforce v-for directive's delimiter style See rule details for vue/v-for-delimiter-style.
- org.openrewrite.codemods.cleanup.vue.VIfElseKey
- Require key attribute for conditionally rendered repeated components
- Require key attribute for conditionally rendered repeated components See rule details for vue/v-if-else-key.
- org.openrewrite.codemods.cleanup.vue.VOnHandlerStyle
- Enforce writing style for handlers in v-on directives
- Enforce writing style for handlers in v-on directives See rule details for vue/v-on-handler-style.
- org.openrewrite.codemods.ecmascript.5to6.ECMAScript6BestPractices
- Upgrade ECMAScript 5 to ECMAScript 6
- A collection of common ECMAScript 5 to ECMAScript 6 updates.
- org.openrewrite.codemods.ecmascript.ESLintTypeScriptDefaults
- Lint TypeScript code using ESLint
- The default config includes the
@typescript-eslintplugin and the correspondingplugin:@typescript-eslint/recommendedextend.
- org.openrewrite.codemods.ecmascript.ESLintTypeScriptPrettier
- Format TypeScript using ESLint Prettier plugin
- Formats all TypeScript source code using the ESLint Prettier plugin.
- org.openrewrite.codemods.format.ArrayBracketNewline
- Enforce linebreaks after opening and before closing array brackets
- Enforce linebreaks after opening and before closing array brackets See rule details.
- org.openrewrite.codemods.format.ArrayBracketSpacing
- Enforce consistent spacing inside array brackets
- Enforce consistent spacing inside array brackets See rule details.
- org.openrewrite.codemods.format.ArrayElementNewline
- Enforce line breaks after each array element
- Enforce line breaks after each array element See rule details.
- org.openrewrite.codemods.format.ArrowParens
- Require parentheses around arrow function arguments
- Require parentheses around arrow function arguments See rule details.
- org.openrewrite.codemods.format.ArrowSpacing
- Enforce consistent spacing before and after the arrow in arrow functions
- Enforce consistent spacing before and after the arrow in arrow functions See rule details.
- org.openrewrite.codemods.format.BlockSpacing
- Disallow or enforce spaces inside of blocks after opening block and before closing block
- Disallow or enforce spaces inside of blocks after opening block and before closing block See rule details.
- org.openrewrite.codemods.format.BraceStyle
- Enforce consistent brace style for blocks
- Enforce consistent brace style for blocks See rule details.
- org.openrewrite.codemods.format.CommaDangle
- Require or disallow trailing commas
- Require or disallow trailing commas See rule details.
- org.openrewrite.codemods.format.CommaSpacing
- Enforce consistent spacing before and after commas
- Enforce consistent spacing before and after commas See rule details.
- org.openrewrite.codemods.format.CommaStyle
- Enforce consistent comma style
- Enforce consistent comma style See rule details.
- org.openrewrite.codemods.format.ComputedPropertySpacing
- Enforce consistent spacing inside computed property brackets
- Enforce consistent spacing inside computed property brackets See rule details.
- org.openrewrite.codemods.format.DotLocation
- Enforce consistent newlines before and after dots
- Enforce consistent newlines before and after dots See rule details.
- org.openrewrite.codemods.format.EolLast
- Require or disallow newline at the end of files
- Require or disallow newline at the end of files See rule details.
- org.openrewrite.codemods.format.FuncCallSpacing
- Require or disallow spacing between function identifiers and their invocations. Alias of `function-call-spacing`
- Require or disallow spacing between function identifiers and their invocations. Alias of `function-call-spacing`. See rule details.
- org.openrewrite.codemods.format.FunctionCallArgumentNewline
- Enforce line breaks between arguments of a function call
- Enforce line breaks between arguments of a function call See rule details.
- org.openrewrite.codemods.format.FunctionCallSpacing
- Require or disallow spacing between function identifiers and their invocations
- Require or disallow spacing between function identifiers and their invocations See rule details.
- org.openrewrite.codemods.format.FunctionParenNewline
- Enforce consistent line breaks inside function parentheses
- Enforce consistent line breaks inside function parentheses See rule details.
- org.openrewrite.codemods.format.GeneratorStarSpacing
- Enforce consistent spacing around `*` operators in generator functions
- Enforce consistent spacing around `*` operators in generator functions See rule details.
- org.openrewrite.codemods.format.ImplicitArrowLinebreak
- Enforce the location of arrow function bodies
- Enforce the location of arrow function bodies See rule details.
- org.openrewrite.codemods.format.Indent
- Enforce consistent indentation
- Enforce consistent indentation See rule details.
- org.openrewrite.codemods.format.IndentBinaryOps
- Indentation for binary operators
- Indentation for binary operators See rule details.
- org.openrewrite.codemods.format.JsxClosingBracketLocation
- Enforce closing bracket location in JSX
- Enforce closing bracket location in JSX See rule details.
- org.openrewrite.codemods.format.JsxClosingTagLocation
- Enforce closing tag location for multiline JSX
- Enforce closing tag location for multiline JSX See rule details.
- org.openrewrite.codemods.format.JsxCurlyBracePresence
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes
- Disallow unnecessary JSX expressions when literals alone are sufficient or enforce JSX expressions on literals in JSX children or attributes See rule details.
- org.openrewrite.codemods.format.JsxCurlyNewline
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions
- Enforce consistent linebreaks in curly braces in JSX attributes and expressions See rule details.
- org.openrewrite.codemods.format.JsxCurlySpacing
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions
- Enforce or disallow spaces inside of curly braces in JSX attributes and expressions See rule details.
- org.openrewrite.codemods.format.JsxEqualsSpacing
- Enforce or disallow spaces around equal signs in JSX attributes
- Enforce or disallow spaces around equal signs in JSX attributes See rule details.
- org.openrewrite.codemods.format.JsxFirstPropNewLine
- Enforce proper position of the first property in JSX
- Enforce proper position of the first property in JSX See rule details.
- org.openrewrite.codemods.format.JsxIndent
- Enforce JSX indentation
- Enforce JSX indentation See rule details.
- org.openrewrite.codemods.format.JsxIndentProps
- Enforce props indentation in JSX
- Enforce props indentation in JSX See rule details.
- org.openrewrite.codemods.format.JsxMaxPropsPerLine
- Enforce maximum of props on a single line in JSX
- Enforce maximum of props on a single line in JSX See rule details.
- org.openrewrite.codemods.format.JsxNewline
- Require or prevent a new line after jsx elements and expressions
- Require or prevent a new line after jsx elements and expressions. See rule details.
- org.openrewrite.codemods.format.JsxOneExpressionPerLine
- Require one JSX element per line
- Require one JSX element per line See rule details.
- org.openrewrite.codemods.format.JsxPascalCase
- Enforce PascalCase for user-defined JSX components
- Enforce PascalCase for user-defined JSX components See rule details.
- org.openrewrite.codemods.format.JsxPropsNoMultiSpaces
- Disallow multiple spaces between inline JSX props
- Disallow multiple spaces between inline JSX props See rule details.
- org.openrewrite.codemods.format.JsxQuotes
- Enforce the consistent use of either double or single quotes in JSX attributes
- Enforce the consistent use of either double or single quotes in JSX attributes See rule details.
- org.openrewrite.codemods.format.JsxSelfClosingComp
- Disallow extra closing tags for components without children
- Disallow extra closing tags for components without children See rule details.
- org.openrewrite.codemods.format.JsxSortProps
- Enforce props alphabetical sorting
- Enforce props alphabetical sorting See rule details.
- org.openrewrite.codemods.format.JsxTagSpacing
- Enforce whitespace in and around the JSX opening and closing brackets
- Enforce whitespace in and around the JSX opening and closing brackets See rule details.
- org.openrewrite.codemods.format.JsxWrapMultilines
- Disallow missing parentheses around multiline JSX
- Disallow missing parentheses around multiline JSX See rule details.
- org.openrewrite.codemods.format.KeySpacing
- Enforce consistent spacing between keys and values in object literal properties
- Enforce consistent spacing between keys and values in object literal properties See rule details.
- org.openrewrite.codemods.format.KeywordSpacing
- Enforce consistent spacing before and after keywords
- Enforce consistent spacing before and after keywords See rule details.
- org.openrewrite.codemods.format.LinebreakStyle
- Enforce consistent linebreak style
- Enforce consistent linebreak style See rule details.
- org.openrewrite.codemods.format.LinesAroundComment
- Require empty lines around comments
- Require empty lines around comments See rule details.
- org.openrewrite.codemods.format.LinesBetweenClassMembers
- Require or disallow an empty line between class members
- Require or disallow an empty line between class members See rule details.
- org.openrewrite.codemods.format.MemberDelimiterStyle
- Require a specific member delimiter style for interfaces and type literals
- Require a specific member delimiter style for interfaces and type literals See rule details.
- org.openrewrite.codemods.format.MultilineTernary
- Enforce newlines between operands of ternary expressions
- Enforce newlines between operands of ternary expressions See rule details.
- org.openrewrite.codemods.format.NewParens
- Enforce or disallow parentheses when invoking a constructor with no arguments
- Enforce or disallow parentheses when invoking a constructor with no arguments See rule details.
- org.openrewrite.codemods.format.NewlinePerChainedCall
- Require a newline after each call in a method chain
- Require a newline after each call in a method chain See rule details.
- org.openrewrite.codemods.format.NoConfusingArrow
- Disallow arrow functions where they could be confused with comparisons
- Disallow arrow functions where they could be confused with comparisons See rule details.
- org.openrewrite.codemods.format.NoExtraParens
- Disallow unnecessary parentheses
- Disallow unnecessary parentheses See rule details.
- org.openrewrite.codemods.format.NoExtraSemi
- Disallow unnecessary semicolons
- Disallow unnecessary semicolons See rule details.
- org.openrewrite.codemods.format.NoFloatingDecimal
- Disallow leading or trailing decimal points in numeric literals
- Disallow leading or trailing decimal points in numeric literals See rule details.
- org.openrewrite.codemods.format.NoMultiSpaces
- Disallow multiple spaces
- Disallow multiple spaces See rule details.
- org.openrewrite.codemods.format.NoMultipleEmptyLines
- Disallow multiple empty lines
- Disallow multiple empty lines See rule details.
- org.openrewrite.codemods.format.NoTrailingSpaces
- Disallow trailing whitespace at the end of lines
- Disallow trailing whitespace at the end of lines See rule details.
- org.openrewrite.codemods.format.NoWhitespaceBeforeProperty
- Disallow whitespace before properties
- Disallow whitespace before properties See rule details.
- org.openrewrite.codemods.format.NonblockStatementBodyPosition
- Enforce the location of single-line statements
- Enforce the location of single-line statements See rule details.
- org.openrewrite.codemods.format.ObjectCurlyNewline
- Enforce consistent line breaks after opening and before closing braces
- Enforce consistent line breaks after opening and before closing braces See rule details.
- org.openrewrite.codemods.format.ObjectCurlySpacing
- Enforce consistent spacing inside braces
- Enforce consistent spacing inside braces See rule details.
- org.openrewrite.codemods.format.ObjectPropertyNewline
- Enforce placing object properties on separate lines
- Enforce placing object properties on separate lines See rule details.
- org.openrewrite.codemods.format.OneVarDeclarationPerLine
- Require or disallow newlines around variable declarations
- Require or disallow newlines around variable declarations See rule details.
- org.openrewrite.codemods.format.OperatorLinebreak
- Enforce consistent linebreak style for operators
- Enforce consistent linebreak style for operators See rule details.
- org.openrewrite.codemods.format.PaddedBlocks
- Require or disallow padding within blocks
- Require or disallow padding within blocks See rule details.
- org.openrewrite.codemods.format.PaddingLineBetweenStatements
- Require or disallow padding lines between statements
- Require or disallow padding lines between statements See rule details.
- org.openrewrite.codemods.format.QuoteProps
- Require quotes around object literal property names
- Require quotes around object literal property names See rule details.
- org.openrewrite.codemods.format.Quotes
- Enforce the consistent use of either backticks, double, or single quotes
- Enforce the consistent use of either backticks, double, or single quotes See rule details.
- org.openrewrite.codemods.format.RecommendedESLintStyling
- Recommended ESLint Styling
- Collection of stylistic ESLint rules that are recommended by the ESLint Style..
- org.openrewrite.codemods.format.RestSpreadSpacing
- Enforce spacing between rest and spread operators and their expressions
- Enforce spacing between rest and spread operators and their expressions See rule details.
- org.openrewrite.codemods.format.Semi
- Require or disallow semicolons instead of ASI
- Require or disallow semicolons instead of ASI See rule details.
- org.openrewrite.codemods.format.SemiSpacing
- Enforce consistent spacing before and after semicolons
- Enforce consistent spacing before and after semicolons See rule details.
- org.openrewrite.codemods.format.SemiStyle
- Enforce location of semicolons
- Enforce location of semicolons See rule details.
- org.openrewrite.codemods.format.SpaceBeforeBlocks
- Enforce consistent spacing before blocks
- Enforce consistent spacing before blocks See rule details.
- org.openrewrite.codemods.format.SpaceBeforeFunctionParen
- Enforce consistent spacing before `function` definition opening parenthesis
- Enforce consistent spacing before `function` definition opening parenthesis See rule details.
- org.openrewrite.codemods.format.SpaceInParens
- Enforce consistent spacing inside parentheses
- Enforce consistent spacing inside parentheses See rule details.
- org.openrewrite.codemods.format.SpaceInfixOps
- Require spacing around infix operators
- Require spacing around infix operators See rule details.
- org.openrewrite.codemods.format.SpaceUnaryOps
- Enforce consistent spacing before or after unary operators
- Enforce consistent spacing before or after unary operators See rule details.
- org.openrewrite.codemods.format.SpacedComment
- Enforce consistent spacing after the `//` or `/*` in a comment
- Enforce consistent spacing after the `//` or `/*` in a comment See rule details.
- org.openrewrite.codemods.format.SwitchColonSpacing
- Enforce spacing around colons of switch statements
- Enforce spacing around colons of switch statements See rule details.
- org.openrewrite.codemods.format.TemplateCurlySpacing
- Require or disallow spacing around embedded expressions of template strings
- Require or disallow spacing around embedded expressions of template strings See rule details.
- org.openrewrite.codemods.format.TemplateTagSpacing
- Require or disallow spacing between template tags and their literals
- Require or disallow spacing between template tags and their literals See rule details.
- org.openrewrite.codemods.format.TypeAnnotationSpacing
- Require consistent spacing around type annotations
- Require consistent spacing around type annotations See rule details.
- org.openrewrite.codemods.format.TypeGenericSpacing
- Enforces consistent spacing inside TypeScript type generics
- Enforces consistent spacing inside TypeScript type generics See rule details.
- org.openrewrite.codemods.format.TypeNamedTupleSpacing
- Expect space before the type declaration in the named tuple
- Expect space before the type declaration in the named tuple See rule details.
- org.openrewrite.codemods.format.WrapIife
- Require parentheses around immediate `function` invocations
- Require parentheses around immediate `function` invocations See rule details.
- org.openrewrite.codemods.format.WrapRegex
- Require parenthesis around regex literals
- Require parenthesis around regex literals See rule details.
- org.openrewrite.codemods.format.YieldStarSpacing
- Require or disallow spacing around the `` in `yield` expressions
- Require or disallow spacing around the `` in `yield` expressions See rule details.
- org.openrewrite.codemods.migrate.lodash.LodashUnderscoreArray
- Replace lodash and underscore array functions with native JavaScript
-
_.head(x)->x[0]-_.head(x, n)->x.slice(n)-_.first(alias for_.head) -_.tail(x)->x.slice(1)-_.tail(x, n)->x.slice(n)-_.rest(alias for_.tail) -_.last(x)->x[x.length - 1]-_.last(x, n)->x.slice(x.length - n).
- org.openrewrite.codemods.migrate.lodash.LodashUnderscoreFunction
- Replace lodash and underscore function functions with native JavaScript
-
_.bind(fn, obj, ...x)->fn.bind(obj, ...x)-_.partial(fn, a, b);->(...args) => fn(a, b, ...args).
- org.openrewrite.codemods.migrate.lodash.LodashUnderscoreObjects
- Replace lodash and underscore object functions with native JavaScript
-
_.clone(x)->\{ ...x \}-_.extend(\{\}, x, y)->\{ ...x, ...y \}-_.extend(obj, x, y)->Object.assign(obj, x, y)-_.keys(x)->Object.keys(x)-_.pairs(x)->Object.entries(x)-_.values(x)->Object.values(x).
- org.openrewrite.codemods.migrate.lodash.LodashUnderscoreUtil
- Replace lodash and underscore utility functions with native JavaScript
-
_.isArray(x)->Array.isArray(x)-_.isBoolean(x)->typeof(x) === 'boolean'-_.isFinite(x)->Number.isFinite(x)-_.isFunction(x)->typeof(x) === 'function'-_.isNull(x)->x === null-_.isString(x)->typeof(x) === 'string'-_.isUndefined(x)->typeof(x) === 'undefined'.
- org.openrewrite.codemods.migrate.mui.AdapterV
- Converts components to use the v4 adapter module
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.All
- Combination of all deprecations
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.AutocompleteRenameCloseicon
- Renames
closeIconprop tocloseButtonIcon - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.AutocompleteRenameOption
- Renames
optionprop togetOptionLabel - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.AvatarCircleCircular
- Updates
circleprop tovariant="circular" - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.BadgeOverlapValue
- Updates
overlapprop tovariant="dot" - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.BaseHookImports
- Converts base imports to use React hooks
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BaseRemoveComponentProp
- Removes
componentprop from base components - See Material UI codemod projects for more details.
- Removes
- org.openrewrite.codemods.migrate.mui.BaseRemoveUnstyledSuffix
- Removes
Unstyledsuffix from base components - See Material UI codemod projects for more details.
- Removes
- org.openrewrite.codemods.migrate.mui.BaseRenameComponentsToSlots
- Renames base components to slots
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BaseUseNamedExports
- Updates base imports to use named exports
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BoxBorderradiusValues
- Updates
borderRadiusprop values - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.BoxRenameCss
- Renames CSS properties for Box component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.BoxRenameGap
- Renames
gapprop tospacing - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.BoxSxProp
- Converts
sxprop tosxstyle prop - See Material UI codemod projects for more details.
- Converts
- org.openrewrite.codemods.migrate.mui.ButtonColorProp
- Renames
colorprop tocolorOverride - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.ChipVariantProp
- Updates
variantprop for Chip component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.CircularprogressVariant
- Updates
variantprop for CircularProgress component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.CollapseRenameCollapsedheight
- Renames
collapsedHeightprop totransitionCollapsedHeight - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.ComponentRenameProp
- Renames
componentprop toas - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.CoreStylesImport
- Updates import paths for core styles
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.CreateTheme
- Updates createMuiTheme usage
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.DatePickersMovedToX
- Moves date pickers to
@mui/x-date-picker - See Material UI codemod projects for more details.
- Moves date pickers to
- org.openrewrite.codemods.migrate.mui.DialogProps
- Updates props for Dialog component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.DialogTitleProps
- Updates props for DialogTitle component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.EmotionPrependCache
- Prepends emotion cache
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ExpansionPanelComponent
- Converts ExpansionPanel to use ExpansionPanel component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.FabVariant
- Updates
variantprop for Fab component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.FadeRenameAlpha
- Renames
alphaprop toopacity - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.GridJustifyJustifycontent
- Updates
justifyprop tojustifyContentfor Grid component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.GridListComponent
- Converts GridList to use Grid component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.GridVProps
- Updates the usage of the
@mui/material/Grid2,@mui/system/Grid, and@mui/joy/Gridcomponents to their updated APIs - See Material UI codemod projects for more details.
- Updates the usage of the
- org.openrewrite.codemods.migrate.mui.HiddenDownProps
- Updates
downprop for Hidden component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.IconButtonSize
- Updates
sizeprop for IconButton component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.JoyAvatarRemoveImgprops
- Removes
imgPropsprop from Avatar component - See Material UI codemod projects for more details.
- Removes
- org.openrewrite.codemods.migrate.mui.JoyRenameClassnamePrefix
- Renames
Muiclassname prefix - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.JoyRenameComponentsToSlots
- Renames components to slots
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.JoyRenameRowProp
- Renames
rowprop toflexDirection="row" - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.JoyTextFieldToInput
- Renames
TextFieldtoInput - See Material UI codemod projects for more details.
- Renames
- org.openrewrite.codemods.migrate.mui.JssToStyled
- Converts JSS styles to styled-components
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.JssToTssReact
- Converts JSS to TypeScript in React components
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.LinkUnderlineHover
- Updates link underline on hover
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.MaterialUiStyles
- Updates usage of
@mui/styles - See Material UI codemod projects for more details.
- Updates usage of
- org.openrewrite.codemods.migrate.mui.MaterialUiTypes
- Updates usage of
@mui/types - See Material UI codemod projects for more details.
- Updates usage of
- org.openrewrite.codemods.migrate.mui.ModalProps
- Updates props for Modal component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.MovedLabModules
- Moves lab modules to
@mui/material - See Material UI codemod projects for more details.
- Moves lab modules to
- org.openrewrite.codemods.migrate.mui.MuiReplace
- Replaces
@muiimports with@mui/material - See Material UI codemod projects for more details.
- Replaces
- org.openrewrite.codemods.migrate.mui.OptimalImports
- Optimizes imports
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.PaginationRoundCircular
- Updates
circularprop tovariant="circular" - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.PresetSafe
- Ensures presets are safe to use
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.RenameCssVariables
- Renames CSS variables
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.RootRef
- Converts
rootReftoref - See Material UI codemod projects for more details.
- Converts
- org.openrewrite.codemods.migrate.mui.SkeletonVariant
- Updates
variantprop for Skeleton component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.Styled
- Updates the usage of
styledfrom@mui/system@v5to be compatible with@pigment-css/react - See Material UI codemod projects for more details.
- Updates the usage of
- org.openrewrite.codemods.migrate.mui.StyledEngineProvider
- Updates usage of styled engine provider
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.SxProp
- Update the usage of the
sxprop to be compatible with@pigment-css/react - See Material UI codemod projects for more details.
- Update the usage of the
- org.openrewrite.codemods.migrate.mui.SystemProps
- Remove system props and add them to the
sxprop - See Material UI codemod projects for more details.
- Remove system props and add them to the
- org.openrewrite.codemods.migrate.mui.TableProps
- Updates props for Table component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.TabsScrollButtons
- Updates scroll buttons for Tabs component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.TextareaMinmaxRows
- Updates
minRowsandmaxRowsprops for TextareaAutosize component - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.ThemeAugment
- Adds
DefaultThememodule augmentation to typescript projects - See Material UI codemod projects for more details.
- Adds
- org.openrewrite.codemods.migrate.mui.ThemeBreakpoints
- Updates theme breakpoints
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeBreakpointsWidth
- Updates
widthvalues for theme breakpoints - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.ThemeOptions
- Updates theme options
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemePaletteMode
- Updates theme palette mode
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeProvider
- Updates usage of ThemeProvider
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeSpacing
- Updates theme spacing
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeSpacingApi
- Updates theme spacing API
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.ThemeTypographyRound
- Updates
roundvalues for theme typography - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.ThemeV
- Update the theme creation from
@mui/system@v5to be compatible with@pigment-css/react - See Material UI codemod projects for more details.
- Update the theme creation from
- org.openrewrite.codemods.migrate.mui.TopLevelImports
- Converts all
@mui/materialsubmodule imports to the root module - See Material UI codemod projects for more details.
- Converts all
- org.openrewrite.codemods.migrate.mui.Transitions
- Updates usage of transitions
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.TreeViewMovedToX
- Moves tree view to
@mui/x-tree-view - See Material UI codemod projects for more details.
- Moves tree view to
- org.openrewrite.codemods.migrate.mui.UseAutocomplete
- Updates usage of useAutocomplete
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.UseTransitionprops
- Updates usage of useTransitionProps
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.VariantProp
- Updates
variantprop usage - See Material UI codemod projects for more details.
- Updates
- org.openrewrite.codemods.migrate.mui.WithMobileDialog
- Updates withMobileDialog higher-order component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.mui.WithWidth
- Updates withWidth higher-order component
- See Material UI codemod projects for more details.
- org.openrewrite.codemods.migrate.nextjs.NextJsCodemods
- Next.js Codemods for API Updates
- Next.js provides Codemod transformations to help upgrade your Next.js codebase when an API is updated or deprecated.
- org.openrewrite.cucumber.jvm.UpgradeCucumber7x
- Upgrade to Cucumber-JVM 7.x
- Upgrade to Cucumber-JVM 7.x from any previous version.
- org.openrewrite.docker.DockerBestPractices
- Apply Docker best practices
- Apply a set of Docker best practices to Dockerfiles. This recipe applies security hardening, build optimization, and maintainability improvements based on CIS Docker Benchmark and industry best practices.
- org.openrewrite.featureflags.launchdarkly.UpgradeLaunchDarkly7
- Migrate to LaunchDarkly 7.x
- This recipe will apply changes commonly needed when migrating to LaunchDarkly 7.x.
- org.openrewrite.github.AddManualTrigger
- Add manual workflow trigger
- You can manually trigger workflow runs. To trigger specific workflows in a repository, use the
workflow_dispatchevent.
- org.openrewrite.github.DependabotCheckForGithubActionsUpdatesDaily
- Check for github-actions updates daily
- Set dependabot to check for github-actions updates daily.
- org.openrewrite.github.DependabotCheckForGithubActionsUpdatesWeekly
- Check for github-actions updates weekly
- Set dependabot to check for github-actions updates weekly.
- org.openrewrite.github.FindGitHubActionSecretReferences
- Find GitHub action secret references
- Help identify and inventory your GitHub secrets that are being used in GitHub actions.
- org.openrewrite.github.MigrateSetupUvV6ToV7
- Migrate
astral-sh/setup-uvfrom v6 to v7 - Migrates
astral-sh/setup-uvfrom v6 to v7. Updates the action version and removes the deprecatedserver-urlinput. See the v7.0.0 release notes for breaking changes.
- Migrate
- org.openrewrite.github.MigrateTibdexGitHubAppTokenToActions
- Migrate from tibdex/github-app-token to actions/create-github-app-token
- Migrates from tibdex/github-app-token@v2 to actions/create-github-app-token@v2 and updates parameter names from snake_case to kebab-case.
- org.openrewrite.github.ReplaceOssrhSecretsWithSonatype
- Replace OSSRH secrets with Sonatype secrets
- Replace deprecated OSSRH_S01 secrets with new Sonatype secrets in GitHub Actions workflows. This is an example use of the
ReplaceSecretsandReplaceSecretKeysrecipes combined used to update the Maven publishing secrets in OpenRewrite's GitHub organization.
- org.openrewrite.github.gradle.RenameGradleBuildActionToSetupGradle
- Rename
gradle/gradle-build-actiontogradle/actions/setup-gradle - Rename the deprecated
gradle/gradle-build-actiontogradle/actions/setup-gradle@v3.
- Rename
- org.openrewrite.github.gradle.RenameWrapperValidationAction
- Rename
gradle/wrapper-validation-actiontogradle/actions/wrapper-validation - Rename the deprecated
gradle/wrapper-validation-actiontogradle/actions/wrapper-validation@v3.
- Rename
- org.openrewrite.github.security.GitHubActionsSecurity
- GitHub Actions security insights
- Finds potential security issues in GitHub Actions workflows, based on Zizmor security analysis rules.
- org.openrewrite.gitlab.BestPractices
- GitLab CI best practices
- Apply GitLab CI/CD best practices to
.gitlab-ci.yml. This includes addingworkflow:rulesto prevent duplicate pipelines, settinginterruptible: trueandretryin thedefaultsection, configuringartifacts:expire_in, and setting a jobtimeout.
- org.openrewrite.gitlab.search.FindDeprecatedSyntax
- Find deprecated GitLab CI syntax
- Find usages of deprecated
onlyandexceptkeywords in.gitlab-ci.yml. These keywords are deprecated in favor ofrules.
- org.openrewrite.gradle.GradleBestPractices
- Apply Gradle best practices
- Apply a set of Gradle best practices to the build files, for more efficient and ideomatic builds.
- org.openrewrite.gradle.plugins.RemoveDevelocity
- Remove Develocity
- Remove the Develocity plugin and configuration from the Gradle build and settings files.
- org.openrewrite.hibernate.validator.HibernateValidator_8_0
- Migrate to Hibernate Validator 8.0.x
- This recipe will apply changes commonly needed when migrating to Hibernate Validator 8.0.x.
- org.openrewrite.java.AddApache2LicenseHeader
- Add ASLv2 license header
- Adds the Apache Software License Version 2.0 to Java source files which are missing a license header.
- org.openrewrite.java.dropwizard.MigrateDropwizardToSpringBoot
- Migrate Dropwizard to Spring Boot
- Apply various changes to migrate Dropwizard applications to Spring Boot.
- org.openrewrite.java.dropwizard.MigrateTasksAndCommands
- Migrate
PostBodyTaskandConfiguredCommand - Remove or change the superclasses of
PostBodyTaskandConfiguredCommand.
- Migrate
- org.openrewrite.java.dropwizard.MigrateToDropwizard5
- Migrate to Dropwizard 5.0.x from 4.x
- Apply changes required to upgrade a Dropwizard 4.x application to 5.0.x. This includes upgrading dependencies, removing deprecated configuration options, and migrating Jetty handler implementations. Includes required migrations to Java 17, Jakarta EE 10, JUnit 5.14, Jackson 2.x, and Hibernate 6.6. See the upgrade guide.
- org.openrewrite.java.dropwizard.ModifyDropwizardHealthChecksToSpringVariants
- Convert Health Check Implementations
- Transforms Dropwizard HealthCheck classes to Spring Boot HealthIndicator.
- org.openrewrite.java.jackson.CodehausToFasterXML
- Migrate from Jackson Codehaus (legacy) to Jackson FasterXML
- In Jackson 2, the package and dependency coordinates moved from Codehaus to FasterXML.
- org.openrewrite.java.jackson.JacksonBestPractices
- Jackson best practices
- Apply best practices for using Jackson library, including upgrade to Jackson 2.x and removing redundant annotations.
- org.openrewrite.java.joda.time.NoJodaTime
- Prefer the Java standard library instead of Joda-Time
- Before Java 8, Java lacked a robust date and time library, leading to the widespread use of Joda-Time to fill this gap. With the release of Java 8, the
java.timepackage was introduced, incorporating most of Joda-Time's concepts. Features deemed too specialized or bulky forjava.timewere included in the ThreeTen-Extra library. This recipe migrates Joda-Time types tojava.timeandthreeten-extratypes.
- org.openrewrite.java.jspecify.JSpecifyBestPractices
- JSpecify best practices
- Apply JSpecify best practices, such as migrating off of alternatives, and adding missing
@Nullableannotations.
- org.openrewrite.java.liberty.MigrateFromWebSphereToLiberty
- Migrate from WebSphere traditional to Liberty
- Use this category of rules to identify code changes needed when migrating from WebSphere Application Server traditional to Liberty.
- org.openrewrite.java.logging.log4j.CommonsLoggingToLog4j
- Migrate JCL to Log4j 2.x API
- Transforms code written using Apache Commons Logging to use Log4j 2.x API.
- org.openrewrite.java.logging.log4j.Slf4jToLog4j
- Migrate SLF4J to Log4j 2.x API
- Transforms code written using SLF4J to use Log4j 2.x API.
- org.openrewrite.java.logging.logback.Log4jToLogback
- Migrate Log4j 2.x to Logback
- Migrates usage of Apache Log4j 2.x to using
logbackas an SLF4J implementation directly. Note, this currently does not modifylog4j.propertiesfiles.
- org.openrewrite.java.logging.slf4j.CommonsLogging1ToSlf4j1
- Migrate Apache Commons Logging 1.x to SLF4J 1.x
- Transforms usages of Apache Commons Logging 1.x to leveraging SLF4J 1.x directly.
- org.openrewrite.java.logging.slf4j.JBossLoggingToSlf4j
- Migrate JBoss Logging to SLF4J
- Migrates usage of the JBoss Logging facade to using SLF4J.
- org.openrewrite.java.logging.slf4j.JulToSlf4j
- Migrate JUL to SLF4J
- Migrates usage of Java Util Logging (JUL) to using SLF4J directly.
- org.openrewrite.java.logging.slf4j.Slf4jBestPractices
- SLF4J best practices
- Applies best practices to logging with SLF4J.
- org.openrewrite.java.micronaut.Micronaut2to3Migration
- Migrate from Micronaut 2.x to 3.x
- This recipe will apply changes required for migrating from Micronaut 2 to Micronaut 3.
- org.openrewrite.java.micronaut.Micronaut3to4Migration
- Migrate from Micronaut 3.x to 4.x
- This recipe will apply changes required for migrating from Micronaut 3 to Micronaut 4.
- org.openrewrite.java.micronaut.UpdateBlockingTaskExecutors
- Migrate the use of TaskExecutors with blocking IO
- This recipe will any usage of TaskExecutors.IO to TaskExecutors.BLOCKING in order to be compatible with virtual threads.
- org.openrewrite.java.migrate.ComIntelliJAnnotationsToOrgJetbrainsAnnotations
- Migrate com.intellij:annotations to org.jetbrains:annotations
- This recipe will upgrade old dependency of com.intellij:annotations to the newer org.jetbrains:annotations.
- org.openrewrite.java.migrate.IBMJDKtoOracleJDK
- Migrate from IBM Runtimes to Oracle Runtimes
- This recipe will apply changes commonly needed when upgrading Java versions. The solutions provided in this list are solutions necessary for migrating from IBM Runtimes to Oracle Runtimes.
- org.openrewrite.java.migrate.IBMSemeru
- Migrate to IBM Semeru Runtimes
- This recipe will apply changes commonly needed when upgrading Java versions. The solutions provided in this list are solutions only available in IBM Semeru Runtimes.
- org.openrewrite.java.migrate.UpgradeToJava25
- Migrate to Java 25
- This recipe will apply changes commonly needed when migrating to Java 25. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy. Build files will also be updated to use Java 25 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 25.
- org.openrewrite.java.migrate.WasDevMvnChangeParentArtifactId
- Change
net.wasdev.maven.parent:java8-parentto:parent - This recipe changes the artifactId of the
<parent>tag in thepom.xmlfromjava8-parenttoparent.
- Change
- org.openrewrite.java.migrate.guava.NoGuava
- Prefer the Java standard library instead of Guava
- Guava filled in important gaps in the Java standard library and still does. But at least some of Guava's API surface area is covered by the Java standard library now, and some projects may be able to remove Guava altogether if they migrate to standard library for these functions.
- org.openrewrite.java.migrate.guava.PreferIntegerRemainderUnsigned
- Prefer
Integer#remainderUnsigned - Prefer
java.lang.Integer#remainderUnsignedinstead of usingcom.google.common.primitives.UnsignedInts#remainderUnsigned.
- Prefer
- org.openrewrite.java.migrate.jakarta.UpdateJakartaAnnotations2
- Update Jakarta EE annotation Dependencies to 2.1.x
- Update Jakarta EE annotation Dependencies to 2.1.x.
- org.openrewrite.java.migrate.javax.AddJaxbDependenciesWithoutRuntime
- Add explicit JAXB API dependencies and remove runtimes
- This recipe will add explicit API dependencies without runtime dependencies for Jakarta EE 8 when a Java 8 application is using JAXB. Any existing API dependencies will be upgraded to the latest version of Jakarta EE 8. The artifacts are moved to Jakarta EE 8 version 2.x which allows for the continued use of the
javax.xml.bindnamespace. All JAXB runtime implementation dependencies are removed.
- org.openrewrite.java.migrate.javax.openJPAToEclipseLink
- Migrate from OpenJPA to EclipseLink JPA
- These recipes help migrate Java Persistence applications using OpenJPA to EclipseLink JPA.
- org.openrewrite.java.migrate.lang.FindVirtualThreadOpportunities
- Find Virtual Thread opportunities
- Find opportunities to convert existing code to use Virtual Threads.
- org.openrewrite.java.migrate.lang.UseVar
- Use local variable type inference
- Apply local variable type inference (
var) for primitives and objects. These recipes can cause unused imports, be advised to run `org.openrewrite.java.RemoveUnusedImports afterwards.
- org.openrewrite.java.migrate.lombok.LombokBestPractices
- Lombok Best Practices
- Applies all recipes that enforce best practices for using Lombok.
- org.openrewrite.java.migrate.util.JavaUtilAPIs
- Use modernized
java.utilAPIs - Certain java util APIs have been introduced and are favored over previous APIs.
- Use modernized
- org.openrewrite.java.search.FindSecrets
- Find plain text secrets
- Find secrets stored in plain text in code.
- org.openrewrite.java.spring.boot2.search.FindUpgradeRequirementsSpringBoot_2_5
- Find patterns that require updating for Spring Boot 2.5
- Looks for a series of patterns that have not yet had auto-remediation recipes developed for.
- org.openrewrite.java.spring.boot3.SpringBoot33BestPractices
- Spring Boot 3.3 best practices
- Applies best practices to Spring Boot 3 applications.
- org.openrewrite.java.spring.http.SpringWebDependency
- Find Spring Web dependency
- Find compile scoped Spring Web dependency for Maven and Gradle, both direct and transitive.
- org.openrewrite.java.spring.opentelemetry.MigrateToOpenTelemetry
- Complete migration to OpenTelemetry
- Comprehensive migration to OpenTelemetry including dependencies, configuration properties, and Java code changes. This recipe handles migration from Spring Cloud Sleuth, Brave/Zipkin, and OpenTracing to OpenTelemetry.
- org.openrewrite.java.spring.ws.UpgradeSpringWs_4_0
- Migrate to Spring WS 4.0
- Migrate applications to Spring WS 4.0. This recipe handles the removal of Apache Axiom support in Spring WS 4.0.x by migrating Axiom-based SOAP message handling to SAAJ (SOAP with Attachments API for Java). Note that Spring WS 4.1+ restores Axiom support if upgrading to that version is preferred.
- org.openrewrite.java.testing.archunit.ArchUnit0to1Migration
- ArchUnit 0.x upgrade
- Upgrade ArchUnit from 0.x to 1.x.
- org.openrewrite.java.testing.assertj.Assertj
- AssertJ best practices
- Migrates JUnit asserts to AssertJ and applies best practices to assertions.
- org.openrewrite.java.testing.cleanup.BestPractices
- Testing best practices
- Applies best practices to tests.
- org.openrewrite.java.testing.datafaker.JavaFakerToDataFaker
- Migrate from Java Faker to Datafaker
- Change imports and dependencies related to Java Faker to Datafaker replacements.
- org.openrewrite.java.testing.easymock.EasyMockToMockito
- Migrate from EasyMock to Mockito
- This recipe will apply changes commonly needed when migrating from EasyMock to Mockito.
- org.openrewrite.java.testing.jmockit.JMockitToMockito
- Migrate from JMockit to Mockito
- This recipe will apply changes commonly needed when migrating from JMockit to Mockito.
- org.openrewrite.java.testing.junit.JUnit6BestPractices
- JUnit 6 best practices
- Applies best practices to tests.
- org.openrewrite.java.testing.testcontainers.TestContainersBestPractices
- Testcontainers best practices
- Apply best practices to Testcontainers usage.
- org.openrewrite.javascript.change-import
- Change import
- Changes an import from one module/member to another, updating all type attributions.
- org.openrewrite.javascript.cleanup.add-parse-int-radix
- Add radix to
parseInt - Adds the radix parameter (base 10) to
parseInt()calls that are missing it, preventing potential parsing issues.
- Add radix to
- org.openrewrite.javascript.cleanup.async-callback-in-sync-array-method
- Detect async callbacks in synchronous array methods
- Detects async callbacks passed to array methods like .some(), .every(), .filter() which don't await promises. This is a common bug where Promise objects are always truthy.
- org.openrewrite.javascript.cleanup.order-imports
- Order imports
- Sort imports by category and module path. Categories: side-effect, namespace, default, named, type. Within each category, imports are sorted alphabetically by module path. Named specifiers within each import are also sorted alphabetically.
- org.openrewrite.javascript.cleanup.prefer-optional-chain
- Prefer optional chaining
- Converts ternary expressions like
foo ? foo.bar : undefinedto use optional chaining syntaxfoo?.bar.
- org.openrewrite.javascript.cleanup.use-object-property-shorthand
- Use object property shorthand
- Simplifies object properties where the property name and value/variable name are the same (e.g.,
\{ x: x \}becomes\{ x \}). Applies to both destructuring patterns and object literals.
- org.openrewrite.javascript.dependencies.add-dependency
- Add npm dependency
- Adds a new dependency to
package.jsonand updates the lock file by running the package manager.
- org.openrewrite.javascript.dependencies.find-dependency
- Find Node.js dependency
- Finds dependencies in a project's
package.json. Can find both direct dependencies and dependencies that transitively include the target package. This recipe is commonly used as a precondition for other recipes.
- org.openrewrite.javascript.dependencies.upgrade-dependency-version
- Upgrade npm dependency version
- Upgrades the version of a direct dependency in
package.jsonand updates the lock file by running the package manager.
- org.openrewrite.javascript.dependencies.upgrade-transitive-dependency-version
- Upgrade transitive npm dependency version
- Upgrades the version of a transitive dependency by adding override/resolution entries to
package.jsonand updates the lock file by running the package manager.
- org.openrewrite.javascript.format.auto-format
- Auto-format JavaScript/TypeScript code
- Format JavaScript and TypeScript code using formatting rules auto-detected from the project's existing code style.
- org.openrewrite.javascript.migrate.es6.modernize-octal-escape-sequences
- Modernize octal escape sequences
- Convert old-style octal escape sequences (e.g.,
\0,\123) to modern hex escape sequences (e.g.,\x00,\x53) or Unicode escape sequences (e.g.,\u0000,\u0053).
- org.openrewrite.javascript.migrate.es6.modernize-octal-literals
- Modernize octal literals
- Convert old-style octal literals (e.g.,
0777) to modern ES6 syntax (e.g.,0o777).
- org.openrewrite.javascript.migrate.es6.remove-duplicate-object-keys
- Remove duplicate object keys
- Remove duplicate keys in object literals, keeping only the last occurrence (last-wins semantics).
- org.openrewrite.javascript.migrate.typescript.export-assignment-to-export-default
- Convert
export =toexport default - Converts TypeScript
export =syntax to ES moduleexport defaultsyntax for compatibility with ECMAScript modules.
- Convert
- org.openrewrite.jenkins.CommonsLang3ToApiPlugin
- Use commons-lang3 API Plugin
- Updates
pom.xmlto depend oncommons-lang3-apiand excludecommons-lang3where it is brought in transitively.
- org.openrewrite.jenkins.CreateJenkinsfile
- Create Jenkinsfile
- Creates a simple base Jenkinsfile in Groovy for a Declarative Pipeline - located in the root of the project.
- org.openrewrite.jenkins.JavaxAnnotationsToSpotbugs
- Migrate
javax.annotationsto SpotBugs annotations - SpotBugs is the preferred replacement of JSR-305 annotations for Jenkins plugins.
- Migrate
- org.openrewrite.jenkins.ModernizeJenkinsfile
- Modernize Jenkinsfile
- Updates
Jenkinsfileto build with recommended Java versions, platforms, and settings.
- org.openrewrite.jenkins.ModernizePlugin
- Modernize a Jenkins plugin to the latest recommended versions
- This recipe is intended to change over time to reflect the recommended tooling and recommended Jenkins baseline.
- org.openrewrite.jenkins.ModernizePluginForJava8
- Modernize a Jenkins plugin to the latest versions supported by Java 8
- This recipe is intended to break down the modernization of very old plugins into distinct steps. It allows modernizing all tooling up to the last versions that supported Java 8. This can then be followed by another recipe that makes the jump to Java 11.
- org.openrewrite.jenkins.migrate.hudson.UtilGetPastTimeStringToGetTimeSpanString
- Replace
hudson.Util.getPastTimeStringwithgetTimeSpanString hudson.Util.getPastTimeStringhas been deprecated since the 2.204.1 LTS release on 2019-12-18.
- Replace
- org.openrewrite.maven.MigrateToMaven4
- Migrate to Maven 4
- Migrates Maven POMs from Maven 3 to Maven 4, addressing breaking changes and deprecations. This recipe updates property expressions, lifecycle phases, removes duplicate plugin declarations, and replaces removed properties to ensure compatibility with Maven 4.
- org.openrewrite.maven.RemoveMavenWrapper
- Remove Maven wrapper
- Remove Maven wrapper files from a project. This includes the
mvnwandmvnw.cmdscripts, and the.mvn/wrapperdirectory.
- org.openrewrite.micrometer.MicrometerBestPractices
- Micrometer best practices
- This recipe will apply a set of best practice refactorings for Micrometer, like adopting
Observationsinstead ofTimers.
- org.openrewrite.micrometer.misk.MigrateMiskToMicrometer
- Migrate Misk metrics to Micrometer
- This recipe will move Misk metrics to Micrometer, where that is possible to do without a loss of fidelity.
- org.openrewrite.netty.UpgradeNetty_4_1_to_4_2
- Migrates from Netty 4.1.x to Netty 4.2.x
- Migrate applications to the latest Netty 4.2.x release.
- org.openrewrite.okhttp.UpgradeMockWebServer3
- Migrate to MockWebServer3 (core module)
- Migrate from the legacy
mockwebserverartifact tomockwebserver3core module without JUnit dependency.
- org.openrewrite.okhttp.UpgradeMockWebServer3JUnit4
- Migrate to MockWebServer3 with JUnit 4
- Migrate from the legacy
mockwebserverartifact tomockwebserver3-junit4with JUnit 4 integration.
- org.openrewrite.okhttp.UpgradeOkHttp5
- Migrate to OkHttp 5.x
- This recipe will apply changes commonly needed when migrating to OkHttp 5.x.
- org.openrewrite.quarkus.MigrateToQuarkus_v3_32_0
- Quarkus Updates Aggregate 3.32.0
- Quarkus update recipes to upgrade your application to 3.32.0.
- org.openrewrite.quarkus.migrate.javaee.JavaEEtoQuarkus2Migration
- Migrate JavaEE to Quarkus 2
- These recipes help with the migration of a JavaEE application using EJBs and Hibernate to Quarkus 2. Additional transformations like JSF, JMS, Quarkus Tests may be necessary.
- org.openrewrite.quarkus.spring.ConfigureNativeBuild
- Configure Quarkus Native Build Support
- Adds configuration and dependencies required for Quarkus native image compilation with GraalVM. Includes native profile configuration and reflection hints where needed.
- org.openrewrite.quarkus.spring.CustomizeQuarkusPluginGoals
- Customize Quarkus Maven Plugin Goals
- Allows customization of Quarkus Maven plugin goals. Adds or modifies the executions and goals for the quarkus-maven-plugin.
- org.openrewrite.quarkus.spring.SpringBootToQuarkus
- Migrate Spring Boot to Quarkus
- Replace Spring Boot with Quarkus.
- org.openrewrite.recipe.rewrite-static-analysis.InlineDeprecatedMethods
- Inline deprecated delegating methods
- Automatically generated recipes to inline deprecated method calls that delegate to other methods in the same class.
- org.openrewrite.recipes.rewrite.OpenRewriteRecipeBestPractices
- OpenRewrite recipe best practices
- Best practices for OpenRewrite recipe development.
- org.openrewrite.staticanalysis.CodeCleanup
- Code cleanup
- Automatically cleanup code, e.g. remove unnecessary parentheses, simplify expressions.
- org.openrewrite.staticanalysis.CommonDeclarationSiteTypeVariances
- Properly use declaration-site type variance for well-known types
- When using a method parameter like
Function<IN, OUT>, it should rather beFunction<? super IN, ? extends OUT>. This recipe checks for method parameters of well-known types.
- org.openrewrite.staticanalysis.CommonStaticAnalysis
- Common static analysis issues
- Resolve common static analysis issues (also known as SAST issues).
- org.openrewrite.staticanalysis.JavaApiBestPractices
- Java API best practices
- Use the Java standard library in a way that is most idiomatic.
- org.openrewrite.staticanalysis.ReplaceApacheCommonsLang3ValidateNotNullWithObjectsRequireNonNull
- Replace
org.apache.commons.lang3.Validate#notNullwithObjects#requireNonNull - Replace
org.apache.commons.lang3.Validate.notNull(..)withObjects.requireNonNull(..).
- Replace
- software.amazon.awssdk.v2migration.AwsSdkJavaV1ToV2
- Migrate from the AWS SDK for Java v1 to the AWS SDK for Java v2
- This recipe will apply changes required for migrating from the AWS SDK for Java v1 to the AWS SDK for Java v2.
- tech.picnic.errorprone.refasterrules.AllRefasterRules
- All Picnic Refaster rules
- Collection of all Refaster rules from Picnic's error-prone-contrib project.