Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

no-irregular-whitespace enforces strings/comments despite contrary documentation #3572

Closed
cjc343 opened this issue Dec 13, 2017 · 1 comment

Comments

@cjc343
Copy link

cjc343 commented Dec 13, 2017

Bug Report

  • TSLint version: 5.7.0
  • TypeScript version: 2.5.2
  • Running TSLint via: (pick one) CLI/NPM: tslint -p ./tsconfig.json -c ./tslint.json -e '**/node_modules/**/*'

TypeScript code being linted

Note - the claims in the 'code' below are untrue because GitHub is replacing nbsp chars with standard spaces. To repro, you must supply your own nbsp chars.

// this comment contains nbsp chars
const s = 'this string contains nbsp chars';

with tslint.json configuration:

{
  "rules": {
    "no-irregular-whitespace": true
  }
}

Actual behavior

Lint failures occur on nbsp chars in string literals and comments.

Expected behavior

Per docs: Disallow irregular whitespace outside of strings and comments


I'm less bothered by the actual behaviour & more-so by the incorrect documentation - disabling the rule when irregular whitespace belongs in a string literal is a perfectly acceptable solution to me.

@ajafff
Copy link
Contributor

ajafff commented Dec 13, 2017

As you already noted: this is a bug in the docs and should be fairly easy to fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants