Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-irregular-whitespace will give an error to irregular-whitespace if skipTemplates is true but template literal line breaks are included #13852

Closed
eai04191 opened this issue Nov 16, 2020 · 1 comment · Fixed by #13853
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules

Comments

@eai04191
Copy link
Sponsor

Tell us about your environment

  • ESLint Version: 7.13.0
  • Node Version: v12.18.0
  • npm Version: v6.14.4

What parser are you using?: default

Please show your full configuration:

Configuration
{
    "extends": ["eslint:recommended"],
    "env": {
        "es6": true,
        "browser": true,
        "jest": true,
        "node": true
    },
    "rules": {
        "no-unused-vars": "off",
        "no-irregular-whitespace": [
            "error",
            {
                "skipTemplates": true
            }
        ]
    }
}

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

const passed = `hoge fuga`;
const error = `hoge fuga
hoge fuga`;

// \U3000 is included between all `hoge` and `fuga`.
// But ESLint only gives an error on the 3rd line.
yarn eslint .\src\no-irregular-whitespace.js

What did you expect to happen?

ESLint does not raise an error for irregular-whitespace in template literals.

What actually happened? Please include the actual, raw output from ESLint.

  3:5  error  Irregular whitespace not allowed  no-irregular-whitespace

Are you willing to submit a pull request to fix this bug?

Probably difficult. I want to see if this is a bug or the correct behavior.

@eai04191 eai04191 added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Nov 16, 2020
@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Nov 16, 2020
@mdjermanovic
Copy link
Member

Hi @eai04191, thanks for the bug report!

I confirmed this bug in our online demo and prepared a fix.

mdjermanovic added a commit that referenced this issue Nov 20, 2020
…13853)

* Fix: no-irregular-whitespace skipTemplates false positive (fixes #13852)

* Add more tests
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators May 20, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 20, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants