From 234e8a311b9a1a180c42f2b8e4767e88e6bdeffa Mon Sep 17 00:00:00 2001 From: Kai Wang Date: Wed, 14 Aug 2019 18:47:40 -0700 Subject: [PATCH] Disallow unnecessary curly braces in JSX props and children. (react/jsx-curly-brace-presence) Fixes: https://github.com/standard/standard/issues/1366 --- CHANGELOG.md | 1 + eslintrc.json | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b78707..d79c371 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](https://semver.org/). - Disallow lexical declarations in case/default clauses ([no-case-declarations](https://eslint.org/docs/rules/no-case-declarations)) [#1211](https://github.com/standard/standard/issues/1211) [eslint-config-standard/#137](https://github.com/standard/eslint-config-standard/pull/137) [1%] - Require the first JSX property to be placed on a new line if the JSX tag takes up multiple lines and there are multiple properties ([react/jsx-first-prop-new-line](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-first-prop-new-line.md)) [#696](https://github.com/standard/standard/issues/696) [1%] - Require JSX closing bracket to be aligned with the opening tag ([react/jsx-closing-bracket-location](https://eslint.org/docs/rules/react/jsx-closing-bracket-location)) [#1361](https://github.com/standard/standard/issues/1361) [1%] +- Disallow unnecessary curly braces in JSX props and children ([react/jsx-curly-brace-presence](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-curly-brace-presence.md)) [#1366](https://github.com/standard/standard/issues/1366) [1%] - Disallow import of modules using absolute paths ([import/no-absolute-path](https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/no-absolute-path.md)) [#861](https://github.com/standard/standard/issues/861) [#1343](https://github.com/standard/standard/issues/1343) [0%] - Require no spaces before JSX closing brackets ([react/jsx-tag-spacing](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-tag-spacing.md)) [#1348](https://github.com/standard/standard/issues/1348) [eslint-config-standard-jsx/38](https://github.com/standard/eslint-config-standard-jsx/pull/38) [0%] - Disallow multiple spaces between inline JSX props ([react/jsx-props-no-multi-spaces](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-props-no-multi-spaces.md)) [#1363](https://github.com/standard/standard/issues/1363) [0%] diff --git a/eslintrc.json b/eslintrc.json index ac1effb..9ff137f 100644 --- a/eslintrc.json +++ b/eslintrc.json @@ -38,6 +38,7 @@ "react/jsx-closing-bracket-location": ["error", "tag-aligned"], "react/jsx-closing-tag-location": "error", "react/jsx-first-prop-new-line": ["error", "multiline-multiprop"], + "react/jsx-curly-brace-presence": ["error", { "props": "never", "children": "never" }], "react/jsx-pascal-case": ["error", { "allowAllCaps": false }], "react/jsx-fragments": ["error", "syntax"], "react/jsx-props-no-multi-spaces": "error",