Fixing and removing irregular white spaces

What are irregular spaces

\u000B - Line Tabulation (\v) - <VT>
\u000C - Form Feed (\f) - <FF>
\u00A0 - No-Break Space - <NBSP>
\u0085 - Next Line
\u1680 - Ogham Space Mark
\u180E - Mongolian Vowel Separator - <MVS>
\ufeff - Zero Width No-Break Space - <BOM>
\u2000 - En Quad
\u2001 - Em Quad
\u2002 - En Space - <ENSP>
\u2003 - Em Space - <EMSP>
\u2004 - Tree-Per-Em
\u2005 - Four-Per-Em
\u2006 - Six-Per-Em
\u2007 - Figure Space
\u2008 - Punctuation Space - <PUNCSP>
\u2009 - Thin Space
\u200A - Hair Space
\u200B - Zero Width Space - <ZWSP>
\u2028 - Line Separator
\u2029 - Paragraph Separator
\u202F - Narrow No-Break Space
\u205f - Medium Mathematical Space
\u3000 - Ideographic Space
  • Is NOT considered a separator for tokens and is often parsed as an Unexpected token ILLEGAL
  • Is NOT shown in modern browsers making code repository software expected to resolve the visualization
  • Is NOT a valid character within JSON which would cause parse errors

A story where i scrached my head

How to create one on purpose! And how they are coming to our files

So how the irregular spaces come to join our beautiful code sources!

Fixing and removing them

Features

  • Automatically replace non breaking space at save time.
  • Add a “Fix irregular whitespace in current file” command to replace all non breaking space at will.
  • Add a “Fix irregular whitespace in workspace” command to replace all non breaking space inside a workspace. (It will rewrite and save your file not currently open in your editor and just update the active ones without saving them).

Install

How to run

> Fix irregular whitespace in workspace
> Fix irregular whitespace in current file

Eslint and no-irregular-whitespace rule

ALT + SPACE irregular whitespace

How to make less irregular spaces!

--

--

--

Developper, Entrepreneur, CTO, Writer! A magic chaser! And A passionate thinker! Obsessed with Performance! And magic for life! And deep thinking!

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

May reading list

A brief introduction to Binary Search Tree (BST) using Python

My First Contribution to Open Source

How Kotlin’s delegated properties and lazy-initialization work

How I got a € 90k+ job (TC) in Germany as a self-taught web developer with 1.5 years of experience.

Munich

String Manipulations in Bash

ELDROW — The Wordle Solver

Automation with Selenium and Web Scraping in Python

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Mohamed Lamine Allal

Mohamed Lamine Allal

Developper, Entrepreneur, CTO, Writer! A magic chaser! And A passionate thinker! Obsessed with Performance! And magic for life! And deep thinking!

More from Medium

Show me the sky is blue using React.js Part 2

History of modules in JS

Use Swiper JS with ionic 6 (ion-slides alternative)

How To Upload Files To OneDrive Or SharePoint Using Microsoft Graph API And CSOM