Skip to content

feat: ensure a public property name doesn't start with an upper-case character. #20

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

Merged
merged 5 commits into from
Sep 17, 2019

Conversation

apapko
Copy link
Contributor

@apapko apapko commented Sep 17, 2019

No description provided.

@apapko apapko requested a review from trevor-bliss September 17, 2019 01:29
@apapko
Copy link
Contributor Author

apapko commented Sep 17, 2019

@trevor-bliss the new rule is not part of the valid-api because it needs to be configurable in platform.

const { docUrl } = require('../util/doc-url');
const { isApiDecorator } = require('../util/decorator-util');

const LEADING_UPPER_CASE_REGEX = new RegExp('^[A-Z.]');
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use a regex testing ascii A-Z instead of https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/toUpperCase to deal with all character ranges? Please verify with @caridy that this works across locales.

If you stick with a regex why is . in the regex?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We are only interested in testing that the leading character is an upper case.

apapko and others added 3 commits September 17, 2019 08:26
Co-Authored-By: Trevor <tbliss@salesforce.com>
@apapko apapko merged commit 43b7817 into master Sep 17, 2019
@apapko apapko deleted the apapko/no-upper-case-api branch September 17, 2019 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants