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

Do not escape underscores inside word #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SemenchenkoVitaliy
Copy link
Member

No description provided.

@SemenchenkoVitaliy SemenchenkoVitaliy added the bug Something isn't working label May 20, 2019
@SemenchenkoVitaliy SemenchenkoVitaliy self-assigned this May 20, 2019
CHANGELOG.md Outdated Show resolved Hide resolved
test/example.js Outdated Show resolved Hide resolved
@SemenchenkoVitaliy SemenchenkoVitaliy changed the title Do not escape undescore inside word Do not escape undescores inside word May 23, 2019
test/example.js Outdated Show resolved Hide resolved
@SemenchenkoVitaliy SemenchenkoVitaliy force-pushed the do-not-escape-undescore-inside-word branch from f49e934 to 6535c73 Compare May 27, 2019 12:58
@SemenchenkoVitaliy
Copy link
Member Author

ping @lundibundi

CHANGELOG.md Outdated
@@ -15,6 +15,7 @@ and this project adheres to
### Fixed

- Support for functions definitions in parameters.
- Do not escape undescores inside word.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Do not escape undescores inside word.
- Do not escape underscores inside words.

lib/generator.js Outdated Show resolved Hide resolved
lib/generator.js Outdated
str[i] === '[' ||
str[i] === ']' ||
(str[i] === '_' &&
!(isAlphaNumeric(str[i - 1]) && isAlphaNumeric(str[i + 1])))
Copy link
Member

@lundibundi lundibundi May 29, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO we shouldn't support non-ascii identifier symbols. Moreover, our eslint config won't even allow such identifiers.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SemenchenkoVitaliy the rule you linked doesn't check if the identifier contains Unicode characters with code points values higher than 0x7F, it just checks that the identifier is in camel case, and it is possible to use camel case in other languages. As for using underscores in the middle of the identifier with this rule, they can be used when everything else is in uppercase (as in constants), for example:

const ПРИВІТ_СВІТЕ = 'Hello, world!';

@SemenchenkoVitaliy SemenchenkoVitaliy force-pushed the do-not-escape-undescore-inside-word branch 5 times, most recently from 83e515f to c6cfd00 Compare June 2, 2019 09:39
@lundibundi lundibundi requested a review from belochub June 24, 2019 10:52
@SemenchenkoVitaliy SemenchenkoVitaliy force-pushed the do-not-escape-undescore-inside-word branch from c6cfd00 to 0cf0a16 Compare June 26, 2019 09:25
@SemenchenkoVitaliy SemenchenkoVitaliy changed the title Do not escape undescores inside word Do not escape underscores inside word Jun 26, 2019
@SemenchenkoVitaliy SemenchenkoVitaliy force-pushed the do-not-escape-undescore-inside-word branch from 065d426 to 8ff60eb Compare July 3, 2019 12:53
lib/generator.js Outdated Show resolved Hide resolved
test/example.js Outdated Show resolved Hide resolved
@SemenchenkoVitaliy SemenchenkoVitaliy force-pushed the do-not-escape-undescore-inside-word branch from 1e056a6 to 1872117 Compare July 4, 2019 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants