From 8aa8184bdf72ee0bd97c372f1ad432822c407aa3 Mon Sep 17 00:00:00 2001 From: Steven Sacks Date: Tue, 12 May 2020 06:50:35 +0900 Subject: [PATCH 1/2] feat(eslint): spaced comment warn instead of error --- index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.js b/index.js index f3accc6..854d552 100644 --- a/index.js +++ b/index.js @@ -168,6 +168,11 @@ module.exports = { // Disabling this rule until this is resolved https://github.com/yannickcr/eslint-plugin-react/issues/1848 // at the moment the fix makes the code look messy and at times unreadable 'react/jsx-one-expression-per-line': 'off', + + // Unfortunately, the parameters for spaced-comments do not allow for JSX exclusions + // It is common to comment JSX during normal development, so 'warn' is a good compromise + // https://eslint.org/docs/rules/spaced-comment + 'spaced-comment': 'warn', }, overrides: [{ // Certain rules need to be disabled when we are linting markdown files, From aca5f282dab09cdf69ded1f92ce8e9bd4bd5824c Mon Sep 17 00:00:00 2001 From: Steven Sacks Date: Thu, 28 May 2020 21:04:17 +0900 Subject: [PATCH 2/2] fix(eslint): only warn on jsx files --- index.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index 854d552..dbcaa53 100644 --- a/index.js +++ b/index.js @@ -168,11 +168,6 @@ module.exports = { // Disabling this rule until this is resolved https://github.com/yannickcr/eslint-plugin-react/issues/1848 // at the moment the fix makes the code look messy and at times unreadable 'react/jsx-one-expression-per-line': 'off', - - // Unfortunately, the parameters for spaced-comments do not allow for JSX exclusions - // It is common to comment JSX during normal development, so 'warn' is a good compromise - // https://eslint.org/docs/rules/spaced-comment - 'spaced-comment': 'warn', }, overrides: [{ // Certain rules need to be disabled when we are linting markdown files, @@ -193,5 +188,12 @@ module.exports = { 'react/prop-types': 0, 'react/require-default-props': 0, }, + }, { + files: ['**/*.jsx'], + rules: { + // It is common to comment JSX during normal development, so 'warn' is least disruptive + // https://eslint.org/docs/rules/spaced-comment + 'spaced-comment': 'warn', + }, }], };