Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ jobs:
rm package.json
npm config set package-lock false
npm i @types/node @commitlint/types @commitlint/config-conventional --force
npx commitlint --from=$(git merge-base remotes/origin/${CIRCLE_BRANCH} master) --verbose
npm ls

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit(non-blocking)
Do we still need this line?

npx @commitlint/cli@17.4.2 --from=$(git merge-base remotes/origin/${CIRCLE_BRANCH} master) --verbose
lint:
docker: *docker
steps:
Expand Down
4 changes: 1 addition & 3 deletions commitlint.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { UserConfig } from '@commitlint/types'
import path from 'path'

const Configuration: UserConfig = {
export const Configuration: UserConfig = {
extends: ['@commitlint/config-conventional'],
/** Add optional custom formatter */
formatter: path.resolve(__dirname, 'commitlint.format.ts'),
Expand Down Expand Up @@ -120,5 +120,3 @@ const Configuration: UserConfig = {
},
},
}

module.exports = Configuration
4 changes: 1 addition & 3 deletions commitlint.format.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Formatter, FormattableReport } from '@commitlint/types'

// Custom formatter for commitlint message
const formatter: Formatter = function (report, options) {
export const formatter: Formatter = function (report, options) {
const { results, valid } = report as IFormatReport
if (results && !valid) {
console.log('\nCommit needs to be formatted as conventional commit')
Expand All @@ -21,8 +21,6 @@ const formatter: Formatter = function (report, options) {
return ''
}

module.exports = formatter

// Fix type definition for formattable report
interface IFormatReport extends FormattableReport {
errorCount: number
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,27 @@ export default class HowtoDescription extends PureComponent<IProps, IState> {
data-cy={'accept'}
variant={'primary'}
icon="check"
mr={1}
onClick={() => this.props.moderateHowto(true)}
/>
showIconOnly={true}
>
Accept
</Button>
<Button
data-cy="reject-howto"
variant={'outline'}
icon="delete"
onClick={() => this.props.moderateHowto(false)}
/>
showIconOnly={true}
sx={{ ml: 1 }}
>
Reject
</Button>
</Flex>
)}
{/* Check if logged in user is the creator of the how-to OR a super-admin */}
{loggedInUser && isAllowToEditContent(howto, loggedInUser) && (
<Link to={'/how-to/' + this.props.howto.slug + '/edit'}>
<Button variant={'primary'} data-cy={'edit'}>
<Button variant={'primary'} data-cy={'edit'} sx={{ ml: 1 }}>
Edit
</Button>
</Link>
Expand Down