Skip to main content

Enforce or disallow spaces inside of curly braces in JSX attributes and expressions

org.openrewrite.codemods.format.JsxCurlySpacing

Enforce or disallow spaces inside of curly braces in JSX attributes and expressions See rule details

Tags

  • eslint
  • stylistic

Recipe source

GitHub, Issue Tracker, Maven Central

This recipe is available under the Moderne Source Available License.

Definition

  • Lint source code with ESLint
    • fix: true
    • configFile: { "root": true, "parser": "@typescript-eslint/parser", "parserOptions": { "project": ["./tsconfig.json"] }, "plugins": ["@stylistic"], "rules": { "@stylistic/jsx-curly-spacing": 2 }, "globals": { "browser": true, "node": true } }

Usage

This recipe has no required configuration options. It can be activated by adding a dependency on org.openrewrite.recipe:rewrite-codemods in your build file or by running a shell command (in which case no build changes are needed):

  1. Add the following to your build.gradle file:
build.gradle
plugins {
id("org.openrewrite.rewrite") version("7.5.0")
}

rewrite {
activeRecipe("org.openrewrite.codemods.format.JsxCurlySpacing")
setExportDatatables(true)
}

repositories {
mavenCentral()
}

dependencies {
rewrite("org.openrewrite.recipe:rewrite-codemods:0.12.2")
}
  1. Run gradle rewriteRun to run the recipe.

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

ESLint messages

org.openrewrite.codemods.ESLintMessages

Errors and warnings as reported by ESLint.

Column NameDescription
Source PathThe source path of the file.
Rule IDESLint Rule ID.
SeverityEither Warning or Error.
FatalIs this a fatal error (like a parse error).
MessageThe message created by the rule.
LineLine in source file this message pertains to.
ColumnColumn in source file this message pertains to.