markdown-it / markdown-it-cjk-breaks

Suppress linebreaks between east asian characters
https://markdown-it.github.io
MIT License
20 stars 7 forks source link

use eslint-disable-next-line instead of disable & enable #4

Closed Crystal-RainSlide closed 3 years ago

Crystal-RainSlide commented 3 years ago

A minor one. See https://eslint.org/docs/user-guide/configuring/rules#disabling-rules


Use:

  // eslint-disable-next-line max-len
  return // ...

Instead of:

https://github.com/markdown-it/markdown-it-cjk-breaks/blob/5a8ea7f87fa7c57aa56919aefe5c566439157776/index.js#L13-L15

Or maybe even this:

  c = c.charCodeAt();
  return c >= 0x1100 && c <= 0x11FF || c === 0x302E || c === 0x302F ||
    c >= 0x3131 && c <= 0x318E || c >= 0x3200 && c <= 0x321E ||
    c >= 0x3260 && c <= 0x327E || c >= 0xA960 && c <= 0xA97C ||
    c >= 0xAC00 && c <= 0xD7A3 || c >= 0xD7B0 && c <= 0xD7C6 ||
    c >= 0xD7CB && c <= 0xD7FB || c >= 0xFFA0 && c <= 0xFFBE ||
    c >= 0xFFC2 && c <= 0xFFC7 || c >= 0xFFCA && c <= 0xFFCF ||
    c >= 0xFFD2 && c <= 0xFFD7 || c >= 0xFFDA && c <= 0xFFDC;

As unicode-13.0.0/Script/Hangul is same with unicode-10.0.0/Script/Hangul,

https://github.com/markdown-it/markdown-it-cjk-breaks/blob/5a8ea7f87fa7c57aa56919aefe5c566439157776/index.js#L12

can be updated to:


  // require('unicode-10.0.0/Script/Hangul/regex')
```.
puzrin commented 3 years ago

I understand comments, but IMO those improve ~ nothing. If package works right - no reasons to make changes.