Skip to content

Commit 1eaa0d6

Browse files
[chore] Add rule to make provider casing more consistent (#3640)
1 parent b598ce1 commit 1eaa0d6

File tree

18 files changed

+69
-61
lines changed

18 files changed

+69
-61
lines changed

.eslintrc.cjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,5 +500,13 @@ module.exports = {
500500
// https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks
501501
'react-hooks/rules-of-hooks': 'error',
502502
'react-hooks/exhaustive-deps': 'warn',
503+
504+
'no-restricted-syntax': [
505+
'warn',
506+
{
507+
selector: "JSXText[value=/\\bGithub\\b|\\bGitlab\\b|\\bBitBucket\\b/]",
508+
message: "Use correct casing (GitHub, GitLab, Bitbucket)"
509+
}
510+
]
503511
},
504512
}

src/pages/AccountSettings/tabs/Admin/GithubIntegrationSection/GithubIntegrationSection.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function GithubIntegrationSection() {
4747

4848
return (
4949
<div className="flex flex-col gap-2">
50-
<h2 className="text-lg font-semibold">Github Integration</h2>
50+
<h2 className="text-lg font-semibold">GitHub Integration</h2>
5151
<GithubIntegrationCopy integrationId={accountDetails?.integrationId} />
5252
</div>
5353
)

src/pages/AccountSettings/tabs/Admin/GithubIntegrationSection/GithubIntegrationSection.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ describe('GithubIntegrationSection', () => {
146146
render(<GithubIntegrationSection />, { wrapper: wrapper() })
147147

148148
const link = await screen.findByRole('link', {
149-
name: /Github/i,
149+
name: /GitHub/i,
150150
})
151151
expect(link).toBeInTheDocument()
152152
})

src/pages/AccountSettings/tabs/Admin/ManageAdminCard/AdminTable/AdminTable.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default function AdminTable() {
163163
if (!isLoading && !tableData?.length) {
164164
return (
165165
<p>
166-
No admins yet. Note that admins in your Github organization are
166+
No admins yet. Note that admins in your GitHub organization are
167167
automatically considered admins.
168168
</p>
169169
)

src/pages/AccountSettings/tabs/Admin/ManageAdminCard/ManageAdminCard.test.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ describe('ManageAdminCard', () => {
110110
render(<ManageAdminCard />, { wrapper })
111111

112112
const noAdmins = await screen.findByText(
113-
/No admins yet. Note that admins in your Github organization are automatically considered admins./
113+
/No admins yet. Note that admins in your GitHub organization are automatically considered admins./
114114
)
115115
expect(noAdmins).toBeInTheDocument()
116116
})
@@ -123,7 +123,7 @@ describe('ManageAdminCard', () => {
123123
render(<ManageAdminCard />, { wrapper })
124124

125125
const noAdmins = await screen.findByText(
126-
/No admins yet. Note that admins in your Github organization are automatically considered admins./
126+
/No admins yet. Note that admins in your GitHub organization are automatically considered admins./
127127
)
128128
expect(noAdmins).toBeInTheDocument()
129129
})

src/pages/CommitDetailPage/CommitCoverage/BotErrorBanner/BotErrorBanner.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import BannerHeading from 'ui/Banner/BannerHeading'
1111
export const ProvidersEnum = Object.freeze({
1212
Github: 'GitHub',
1313
Gitlab: 'GitLab',
14-
BitBucket: 'BitBucket',
14+
Bitbucket: 'Bitbucket',
1515
})
1616

1717
function useProviderSetting() {
@@ -28,7 +28,7 @@ function useProviderSetting() {
2828
const ghWithNoApp =
2929
!accountDetails?.integrationId && provider === ProvidersEnum.Github
3030

31-
const bbProvider = provider === ProvidersEnum.BitBucket
31+
const bbProvider = provider === ProvidersEnum.Bitbucket
3232
const glProvider = provider === ProvidersEnum.Gitlab
3333

3434
return { ghWithNoApp, bbProvider, glProvider, ghWithApp }
@@ -83,7 +83,7 @@ const BotErrorHeading = () => {
8383

8484
if (ghWithApp) {
8585
return (
86-
<p className="font-semibold">There was an issue with the Github app</p>
86+
<p className="font-semibold">There was an issue with the GitHub app</p>
8787
)
8888
}
8989

src/pages/CommitDetailPage/CommitCoverage/BotErrorBanner/BotErrorBanner.test.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe('BotErrorBanner', () => {
5959
})
6060

6161
const title = await screen.findByText(
62-
'There was an issue with the Github app'
62+
'There was an issue with the GitHub app'
6363
)
6464
expect(title).toBeInTheDocument()
6565
})

src/pages/EnterpriseLandingPage/EnterpriseLandingPage.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe('EnterpriseLandingPage', () => {
106106
it('displays bitbucket card', async () => {
107107
render(<EnterpriseLandingPage />, { wrapper })
108108

109-
const element = await screen.findByRole('heading', { name: 'BitBucket' })
109+
const element = await screen.findByRole('heading', { name: 'Bitbucket' })
110110
expect(element).toBeInTheDocument()
111111
})
112112

@@ -138,7 +138,7 @@ describe('EnterpriseLandingPage', () => {
138138
it('displays bitbucket button', () => {
139139
render(<EnterpriseLandingPage />, { wrapper })
140140

141-
expect(screen.queryByText('BitBucket')).toBeNull()
141+
expect(screen.queryByText('Bitbucket')).toBeNull()
142142
})
143143
})
144144
})

src/pages/EnterpriseLandingPage/ProviderCard/ProviderCard.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ describe('ProviderCard', () => {
2727
)
2828

2929
const element = screen.getByRole('link', {
30-
name: 'Login via BitBucket',
30+
name: 'Login via Bitbucket',
3131
})
3232
expect(element).toBeInTheDocument()
3333
expect(element).toHaveAttribute('href', '/login/bb')
@@ -43,7 +43,7 @@ describe('ProviderCard', () => {
4343
)
4444

4545
const element = screen.getByRole('link', {
46-
name: 'Login via BitBucket Server',
46+
name: 'Login via Bitbucket Server',
4747
})
4848
expect(element).toBeInTheDocument()
4949
expect(element).toHaveAttribute('href', '/login/bbs')

src/pages/RepoPage/FailedTestsTab/CodecovCLI/CodecovCLI.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ function Step4() {
8383
</Card.Header>
8484
<Card.Content className="flex flex-col gap-4">
8585
<p>
86-
Codecov offers existing wrappers for the CLI (Github Actions, Circle
86+
Codecov offers existing wrappers for the CLI (GitHub Actions, Circle
8787
CI Orb, Bitrise Step) that makes uploading coverage to Codecov easy,
8888
as described{' '}
8989
<A
@@ -164,7 +164,7 @@ function Step6() {
164164
tests result on the following areas:
165165
</p>
166166
<ul className="list-inside list-disc">
167-
<li>Github pull request comment</li>
167+
<li>GitHub pull request comment</li>
168168
<li>Failed tests dashboard here.</li>
169169
</ul>
170170
</Card.Content>

0 commit comments

Comments
 (0)