From 8240404a552bf538c5b171542037dfef06ffbdcf Mon Sep 17 00:00:00 2001 From: Oprysk Vyacheslav Date: Mon, 18 Apr 2022 23:46:08 +0300 Subject: [PATCH] chore: codeowners --- .github/CODEOWNERS | 2 ++ package.json | 4 ++-- src/components/RedocStandalone.tsx | 7 ++++--- src/components/SideMenu/styled.elements.ts | 15 +++++++++++---- src/services/models/Operation.ts | 2 +- src/services/models/SecurityRequirement.ts | 2 +- src/theme.ts | 2 +- 7 files changed, 22 insertions(+), 12 deletions(-) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..bfeb0d2c --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +* @Redocly/keyboard-warriors +/docs/ @Redocly/technical-writers \ No newline at end of file diff --git a/package.json b/package.json index b67cce5f..49f1263a 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "start": "webpack serve --mode=development --env playground --hot --config demo/webpack.config.ts", "start:prod": "webpack serve --env playground --mode=production --config demo/webpack.config.ts", "start:benchmark": "webpack serve --mode=production --env.bench --config demo/webpack.config.ts", - "test": "npm run lint && npm run unit && npm run license-check", + "test": "npm run unit && npm run license-check", "unit": "jest --coverage", "e2e": "cypress run", "e2e-ci": "cypress run --record", @@ -49,7 +49,7 @@ "stats": "webpack --env production --env standalone --json --profile --mode=production > stats.json", "prettier": "prettier --write \"cli/index.ts\" \"src/**/*.{ts,tsx}\"", "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 1", - "lint": "eslint 'src/**/*.{js,ts,tsx}' --cache", + "lint": "eslint --fix 'src/**/*.{js,ts,tsx}' --cache", "benchmark": "node ./benchmark/benchmark.js", "start:demo": "webpack serve --hot --config demo/webpack.config.ts --mode=development", "compile:cli": "tsc custom.d.ts cli/index.ts --target es6 --module commonjs --types yargs", diff --git a/src/components/RedocStandalone.tsx b/src/components/RedocStandalone.tsx index fe3c67e2..24ea13e0 100644 --- a/src/components/RedocStandalone.tsx +++ b/src/components/RedocStandalone.tsx @@ -26,9 +26,10 @@ export const RedocStandalone = function (props: RedocStandaloneProps) { const normalizedOpts = new RedocNormalizedOptions(options); if (normalizedOpts.nonce !== undefined) { - try { - __webpack_nonce__ = normalizedOpts.nonce; - } catch { } // If we have exception, Webpack was not used to run this. + try { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + __webpack_nonce__ = normalizedOpts.nonce; + } catch {} // If we have exception, Webpack was not used to run this. } return ( diff --git a/src/components/SideMenu/styled.elements.ts b/src/components/SideMenu/styled.elements.ts index e4d94179..abc9f15e 100644 --- a/src/components/SideMenu/styled.elements.ts +++ b/src/components/SideMenu/styled.elements.ts @@ -66,8 +66,11 @@ export const OperationBadge = styled.span.attrs((props: { type: string }) => ({ } `; - -function menuItemActive(depth, { theme }: { theme: ResolvedThemeInterface }, option: string): string { +function menuItemActive( + depth, + { theme }: { theme: ResolvedThemeInterface }, + option: string, +): string { if (depth > 1) { return theme.sidebar.level1Items[option]; } else if (depth === 1) { @@ -125,7 +128,9 @@ export const MenuItemLabel = styled.label.attrs((props: MenuItemLabelType) => ({ }))` cursor: pointer; color: ${props => - props.active ? menuItemActive(props.depth, props, 'activeTextColor') : props.theme.sidebar.textColor}; + props.active + ? menuItemActive(props.depth, props, 'activeTextColor') + : props.theme.sidebar.textColor}; margin: 0; padding: 12.5px ${props => props.theme.spacing.unit * 4}px; ${({ depth, type, theme }) => @@ -135,7 +140,9 @@ export const MenuItemLabel = styled.label.attrs((props: MenuItemLabelType) => ({ font-family: ${props => props.theme.typography.headings.fontFamily}; ${props => menuItemDepth[props.depth]}; background-color: ${props => - props.active ? menuItemActive(props.depth, props, 'activeBackgroundColor') : props.theme.sidebar.backgroundColor}; + props.active + ? menuItemActive(props.depth, props, 'activeBackgroundColor') + : props.theme.sidebar.backgroundColor}; ${props => (props.deprecated && deprecatedCss) || ''}; diff --git a/src/services/models/Operation.ts b/src/services/models/Operation.ts index 502846f3..2b3f6213 100644 --- a/src/services/models/Operation.ts +++ b/src/services/models/Operation.ts @@ -124,7 +124,7 @@ export class OperationModel implements IMenuItem { // TODO: update getting pathInfo for overriding servers on path level this.servers = normalizeServers('', operationSpec.servers || operationSpec.pathServers || []); } else { - this.operationHash = operationSpec.operationId && 'operation/' + operationSpec.operationId + this.operationHash = operationSpec.operationId && 'operation/' + operationSpec.operationId; this.id = operationSpec.operationId !== undefined ? (parent ? parent.id + '/' : '') + this.operationHash diff --git a/src/services/models/SecurityRequirement.ts b/src/services/models/SecurityRequirement.ts index 9ec1ae2a..8525f499 100644 --- a/src/services/models/SecurityRequirement.ts +++ b/src/services/models/SecurityRequirement.ts @@ -25,7 +25,7 @@ export class SecurityRequirementModel { return undefined; } const displayName = scheme['x-displayName'] || id; - + return { ...scheme, id, diff --git a/src/theme.ts b/src/theme.ts index a0f03981..e8f2bf2e 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -141,7 +141,7 @@ const defaultTheme: ThemeInterface = { groupItems: { activeBackgroundColor: theme => darken(0.1, theme.sidebar.backgroundColor), activeTextColor: theme => theme.sidebar.activeTextColor, - textTransform: 'uppercase' + textTransform: 'uppercase', }, level1Items: { activeBackgroundColor: theme => darken(0.05, theme.sidebar.backgroundColor),