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

fix(jsdocs): solve all lint warnings in project #869

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b3e6d6b
style(code): adopt tsdocs
yinonov Jan 6, 2022
8fef962
Merge branch 'main' into tsdocs
YonatanKra Jan 9, 2022
8e908af
fix all lint warnings
rinaok Nov 29, 2022
3ba32bc
Change files
rinaok Nov 29, 2022
ebca1c2
Merge branch 'main' of https://github.com/Vonage/vivid-3 into fix(lin…
rinaok Nov 29, 2022
a874e60
fix
rinaok Nov 29, 2022
52e7f19
BuildExecutorSchema
rinaok Nov 29, 2022
d8abab6
update
rinaok Nov 29, 2022
e5032c7
no-non-null-assertion
rinaok Nov 30, 2022
5ff6f8a
revert change
rinaok Nov 30, 2022
082d988
Merge branch 'main' of https://github.com/Vonage/vivid-3 into fix(lin…
rinaok Dec 5, 2022
3cbeed8
Merge remote-tracking branch 'origin/main' into tsdocs
Dec 16, 2022
8798165
update
Dec 16, 2022
b7af131
Merge branch 'main' of https://github.com/Vonage/vivid-3 into fix(lin…
rinaok Dec 19, 2022
c9788aa
Merge branch 'main' of https://github.com/Vonage/vivid-3 into tsdocs
rinaok Dec 19, 2022
bc8ebd4
Merge branch 'tsdocs' of https://github.com/Vonage/vivid-3 into fix(l…
rinaok Dec 19, 2022
be2a6c4
Merge branch 'main' into fix(lint)--warnings
rinaok Dec 21, 2022
08f97c1
Delete @vonage-vivid-ff905da9-3cf8-4757-b2fb-eb5e685f6fed.json
rinaok Dec 21, 2022
5391e3c
Delete @vonage-nx-vivid-7d169e0e-bacc-4ea2-bc7d-99ce63ec14b2.json
rinaok Dec 21, 2022
cc81b3e
Update libs/components/src/lib/breadcrumb/ui.test.ts
rinaok Dec 21, 2022
2fd7fdb
Merge branch 'main' into fix(lint)--warnings
rinaok Dec 21, 2022
4508fa4
Change files
rinaok Dec 21, 2022
f66864d
Merge branch 'main' of https://github.com/Vonage/vivid-3 into fix(lin…
rinaok Dec 21, 2022
efc3c14
remove *.test.ts
rinaok Dec 21, 2022
b6e20ef
fix
rinaok Dec 26, 2022
638b0d4
Merge branch 'main' into fix(lint)--warnings
rinaok Dec 26, 2022
f82a1f7
revert
rinaok Dec 26, 2022
c8996aa
Merge branch 'main' into fix(lint)--warnings
rinaok Dec 26, 2022
c451ea8
Merge branch 'main' into fix(lint)--warnings
rinaok Dec 26, 2022
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"comment": "solve lint warnings",
"type": "none",
"packageName": "@vonage/nx-vivid",
"email": "rina.oksman@vonage.com",
"dependentChangeType": "none"
}
9 changes: 5 additions & 4 deletions libs/components/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
"env": {
"browser": true
},
"plugins": ["@typescript-eslint", "import", "jsdoc"],
"plugins": ["@typescript-eslint", "import", "eslint-plugin-tsdoc"],
"extends": [
"../../.eslintrc.json",
"@microsoft/eslint-config-fast-dna",
"plugin:compat/recommended",
"plugin:jsdoc/recommended"
"plugin:compat/recommended"
],
"rules": {
// lint
"@nrwl/nx/workspace/no-attribute-default-value": "error",
"@typescript-eslint/no-non-null-assertion": "off",
"indent": "off",
"@typescript-eslint/indent": [
"error",
Expand Down Expand Up @@ -51,7 +51,8 @@
{
"accessibility": "no-public"
}
]
],
"tsdoc/syntax": "warn"
},
"overrides": [
{
Expand Down
7 changes: 7 additions & 0 deletions libs/components/rollup.config.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ const path = require('path');
const replace = require('@rollup/plugin-replace');
const postcss = require('rollup-plugin-postcss');

/**
*
*
* @param {string} [workingFolder='./src/lib/'] src
* @returns {*} folders
*/
function getFoldersInAFolder(workingFolder = './src/lib/') {
const folders = [];
const testsFolder = path.join(__dirname, workingFolder);
Expand All @@ -16,6 +22,7 @@ function getFoldersInAFolder(workingFolder = './src/lib/') {
return folders;
}

/** @type {*} */
const components = getFoldersInAFolder();
const input = components.reduce((inputObject, componentName) => {
inputObject[`${componentName}/index`] = path.join(
Expand Down
18 changes: 18 additions & 0 deletions libs/components/src/lib/accordion-item/accordion-item.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ const getClasses = ({
['no-indicator', noIndicator],
);

/**
*
* @param {ElementDefinitionContext} context element definition
* @returns {HTMLElement} template
*/
export const AccordionItemTemplate: (
context: ElementDefinitionContext,
definition: FoundationElementDefinition
Expand All @@ -33,6 +38,13 @@ export const AccordionItemTemplate: (
</div>
`;

/**
*
*
* @param {ElementDefinitionContext} context element definition
* @param {(number | string | undefined)} headingLevel - heading level
* @returns {HTMLElement} template
*/
const renderPanelHeader = (context: ElementDefinitionContext, headingLevel: number | string | undefined) => {
const header: string = headingLevel ? 'h' + headingLevel : 'h3';
return html<AccordionItem>`
Expand All @@ -42,6 +54,12 @@ const renderPanelHeader = (context: ElementDefinitionContext, headingLevel: numb
`;
};

/**
*
*
* @param {ElementDefinitionContext} context element definition
* @returns {HTMLElement} template
*/
const renderHeaderButton = (context: ElementDefinitionContext) => {
const affixIconTemplate = affixIconTemplateFactory(context);
const focusTemplate = focusTemplateFactory(context);
Expand Down
16 changes: 9 additions & 7 deletions libs/components/src/lib/accordion-item/accordion-item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,40 @@ import { attr } from '@microsoft/fast-element';
import { AffixIconWithTrailing } from '../../shared/patterns/affix';

/**
* Base class for accordion-item
*
* @public
* Base class for accordion-item
*
* @class AccordionItem
* @augments {FoundationElement}
*/
export class AccordionItem extends FoundationElement {
/**
*
*
* @public
*
*
* HTML Attribute: heading
*/
@attr heading?: string;

/**
*
* @public
*
* HTML Attribute: heading-level
*/
@attr({ attribute: 'heading-level' }) headingLevel?: 2 | 3 | 4 | 5 | 6;

/**
* Indicates whether the accordion-item has indicator
*
* @public
*
* HTML Attribute: no-indicator
*/
@attr({ mode: 'boolean', attribute: 'no-indicator' }) noIndicator = false;

/**
*
* @public
*
*
* HTML Attribute: meta
*/
Expand All @@ -44,7 +46,7 @@ export class AccordionItem extends FoundationElement {
/**
* Indicates whether the accordion-item is open
*
* @public
*
* HTML Attribute: open
*/
@attr({ mode: 'boolean' }) open = false;
Expand Down
3 changes: 1 addition & 2 deletions libs/components/src/lib/accordion/accordion.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ const getClasses = (_: Accordion) => classNames('base');

/**
*
* @param context
* @public
* @returns {HTMLElement} template
*/
export const AccordionTemplate: (
context: ElementDefinitionContext,
Expand Down
4 changes: 2 additions & 2 deletions libs/components/src/lib/accordion/accordion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ import type { AccordionItem } from '../accordion-item/accordion-item';
/**
* Base class for accordion
*
* @public
*
*/
export class Accordion extends FoundationElement {
private accordionItems: HTMLCollectionOf<AccordionItem> | undefined = undefined;

/**
*
* @public
*
* HTML Attribute: multi
*/
@attr({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ const getClasses = ({
/**
* The template for the {@link @microsoft/fast-foundation#action-group} component.
*
* @param context
* @public
* @returns {HTMLElement} template
*/
export const ActionGroupTemplate: (
context: ElementDefinitionContext,
Expand Down
18 changes: 9 additions & 9 deletions libs/components/src/lib/action-group/action-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,47 @@ import type {
/**
* Types of button appearance.
*
* @public
*
*/
export type ActionGroupAppearance = Extract<Appearance,
Appearance.Filled | Appearance.Outlined | Appearance.Ghost>;

/**
* Types of button shape.
*
* @public
*
*/
type ActionGroupShape = Extract<Shape, Shape.Rounded | Shape.Pill>;

/**
* Base class for action-group
*
* @public
*
*/
export class ActionGroup extends FoundationElement {
/**
* The shape the ActionGroup should have.
*
* @public
* @remarks
*
*
* HTML Attribute: shape
*/
@attr shape?: ActionGroupShape;

/**
* The appearance the ActionGroup should have.
*
* @public
* @remarks
*
*
* HTML Attribute: appearance
*/
@attr appearance?: ActionGroupAppearance;

/**
* Indicates whether action group should have padding.
*
* @public
* @remarks
*
*
* HTML Attribute: tight
*/
@attr({
Expand Down
5 changes: 5 additions & 0 deletions libs/components/src/lib/action-group/ui.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import {

const components = ['action-group', 'button', 'text-field', 'layout', 'popup', 'divider'];

/**
*
*
* @returns {*} HTMLElement
*/
function runActionGroupTest() {
return async ({page}: { page: Page }) => {
const template = extractHTMLBlocksFromReadme(
Expand Down
14 changes: 8 additions & 6 deletions libs/components/src/lib/avatar/avatar.template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const getClasses = ({appearance, connotation, shape, size}: Avatar) => className
);

/**
avatar icon
* avatar icon
*
* @returns {HTMLElement} template
*/
function renderIcon(iconTag: string) {
return html<Avatar>`
Expand All @@ -29,19 +31,19 @@ function renderIcon(iconTag: string) {


/**
avatar initials
* avatar initials
*
* @returns {HTMLElement} template
*/
function renderInitials() {
return html<Avatar>`
<span class="initials">${ ({ name }) => name!.substring(0, 2) }</span>
`;
<span class="initials">${ ({ name }) => name!.substring(0, 2) }</span>`;
}

/**
* The template for the {@link @microsoft/fast-foundation#Avatar} component.
*
* @param context
* @public
* @returns {HTMLElement} template
*/
export const AvatarTemplate: (
context: ElementDefinitionContext,
Expand Down
30 changes: 15 additions & 15 deletions libs/components/src/lib/avatar/avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import type {
/**
* Types of avatar connotation.
*
* @public
*
*/
export type AvatarConnotation = Extract<Connotation,
| Connotation.Accent
Expand All @@ -18,27 +18,27 @@ export type AvatarConnotation = Extract<Connotation,
/**
* Types of avatar appearance.
*
* @public
*
*/
export type AvatarAppearance = Extract<Appearance,
Appearance.Filled | Appearance.Outlined>;

/**
* Types of avatar shape.
*
* @public
*
*/
type AvatarShape = Extract<Shape, Shape.Rounded | Shape.Pill>;
/**
* Base class for avatar
*
* @public
*
*/

/**
* Types of avatar size.
*
* @public
*
*/
type AvatarSize = Extract<Size, Size.Condensed | Size.Normal | Size.Expanded>;

Expand All @@ -47,26 +47,26 @@ export class Avatar extends FoundationElement {
/**
* The connotation the avatar should have.
*
* @public
* @remarks
*
*
* HTML Attribute: connotation
*/
@attr connotation?: AvatarConnotation;

/**
* The shape the avatar should have.
*
* @public
* @remarks
*
*
* HTML Attribute: shape
*/
@attr shape?: AvatarShape;

/**
* The appearance the avatar should have.
*
* @public
* @remarks
*
*
* HTML Attribute: appearance
*/
@attr appearance?: AvatarAppearance;
Expand All @@ -75,8 +75,8 @@ export class Avatar extends FoundationElement {
/**
* The size the avatar should have.
*
* @public
* @remarks
*
*
* HTML Attribute: size
*/
@attr size?: AvatarSize;
Expand All @@ -85,14 +85,14 @@ export class Avatar extends FoundationElement {
/**
* avatar header icon
*
* @public
*
*/
@attr icon?: string;

/**
* avatar name
*
* @public
*
*/
@attr name?: string;
}
Loading