Skip to content
This repository has been archived by the owner on Mar 18, 2023. It is now read-only.

Commit

Permalink
chore(lint): add TSDoc to eslint config
Browse files Browse the repository at this point in the history
Closes: #107
  • Loading branch information
volkflo committed May 23, 2022
1 parent 7d6eafb commit c6f0d95
Show file tree
Hide file tree
Showing 13 changed files with 180 additions and 21 deletions.
10 changes: 8 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,22 @@
],
"createDefaultProgram": true
},
"plugins": [
"@typescript-eslint/eslint-plugin",
"eslint-plugin-tsdoc"
],
"extends": [
"plugin:@angular-eslint/recommended",
"plugin:@angular-eslint/template/process-inline-templates",
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended"
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
"@typescript-eslint/no-empty-function": "off"
"@typescript-eslint/no-empty-function": "off",
"tsdoc/syntax": "warn"
}
},
// NOTE: WE ARE NOT APPLYING PRETTIER IN THIS OVERRIDE, ONLY @ANGULAR-ESLINT/TEMPLATE
Expand Down
18 changes: 18 additions & 0 deletions cypress/plugins/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* Copyright 2022 Scheer PAS Schweiz AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* imitations under the License.
*/

/// <reference types="cypress" />
// ***********************************************************
// This example plugins/index.ts can be used to load plugins
Expand All @@ -12,6 +28,8 @@
// This function is called when a project is opened or re-opened (e.g. due to
// the project's config changing)

/* eslint-disable tsdoc/syntax */

/**
* @type {Cypress.PluginConfig}
*/
Expand Down
134 changes: 134 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"eslint": "8.14.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-tsdoc": "^0.2.16",
"jasmine-core": "4.1.0",
"karma": "6.3.19",
"karma-chrome-launcher": "3.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ export class MarketplaceClientAppComponent implements OnInit {
/**
* Try to create a user organization every time.
* Refactor this later to accept org-names
* @private
*/
private createOrgAndLoadClients() {
this.orgService
Expand Down Expand Up @@ -159,7 +158,7 @@ export class MarketplaceClientAppComponent implements OnInit {
* the client already exists
* there are multiple orgs and no org is selected
*
* @return true if the create client button should be disabled
* @returns true if the create client button should be disabled
*/
public isCreateButtonDisabled(): boolean {
return (
Expand Down
5 changes: 2 additions & 3 deletions src/app/components/my-apps/my-apps.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,8 @@ export class MyAppsComponent implements OnInit {
}

/**
* Contracts will be stored in a map with schema {client.name:contract.version,contract-object}
* @param contracts
* @private
* Contracts will be stored in a map with schema "\{client.name:contract.version,contract-object\}"
* @param contracts - array of extended contracts
*/
private extractContracts(contracts: IContractExt[]) {
this.contracts = this.contracts.concat(contracts);
Expand Down
1 change: 1 addition & 0 deletions src/app/interfaces/ICommunication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* imitations under the License.
*/

/* eslint-disable tsdoc/syntax */
import { IPolicyExt } from './IPolicy';

export interface IAction {
Expand Down
8 changes: 4 additions & 4 deletions src/app/services/api/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ export class ApiService {
/**
* This method will create and name the definition file and creates the download
* The name pattern is: apiName-apiVersion.fileEnding e.g. Petstore-1.0.json
* @param data the definition as blob
* @param apiId the name of the API
* @param apiVersion the version of the API
* @param definitionType the definition type of the API (SwaggerJSON, SwaggerYAML, WSDL)
* @param data - the definition as blob
* @param apiId - the name of the API
* @param apiVersion - the version of the API
* @param definitionType - the definition type of the API (SwaggerJSON, SwaggerYAML, WSDL)
*/
private downloadFile(
data: Blob,
Expand Down
2 changes: 1 addition & 1 deletion src/app/services/permissions/permissions.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class PermissionsService {

/**
* This will return an array of organizationIds where the permission applies
* @param requestedPermission the permission to be checked
* @param requestedPermission - the permission to be checked
*/
public getAllowedOrganizations(requestedPermission: IPermission): string[] {
const organizations: string[] = [];
Expand Down
5 changes: 2 additions & 3 deletions src/app/services/policy/policy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -405,9 +405,8 @@ export class PolicyService {
/**
* The function calculates in reference to the max value of a policy the remaining time
* Schema: ([max value in sec] - [remaining time in sec]) / [max value in sec] * [unit multiplier]
* @param timeUnitData
* @param reset the value once the policy will reset the current value in seconds
* @private
* @param timeUnitData - the time unit the policy applies for
* @param reset - the value once the policy will reset the current value in seconds
*/
private calcCurrentTimeValue(
timeUnitData: ITimeUnitData,
Expand Down
4 changes: 2 additions & 2 deletions src/app/services/spinner/spinner.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Scheer PAS Schweiz AG
* Copyright 2022 Scheer PAS Schweiz AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,7 +40,7 @@ export class SpinnerService {

/**
* Because of change detection we need a timeout, otherwise console would show several errors
* @param waiting
* @param waiting - boolean if the spinner is shown or not
*/
setWaiting(waiting: boolean): void {
setTimeout(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/app/services/toc/toc.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Scheer PAS Schweiz AG
* Copyright 2022 Scheer PAS Schweiz AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@ export class TocService {

/**
* Schema Example: applications#SpringCorp.-1.0-SupportManager-1.0
* @param contract
* @param contract - the extended contract
*/
formatApiVersionPlanId(contract: IContractExt): string {
return (
Expand All @@ -39,7 +39,7 @@ export class TocService {

/**
* Schema Example: applications#SpringCorp.-1.0
* @param contract
* @param contract - the extended contract
*/
formatClientId(contract: IContractExt): string {
return contract.client.client.id + '-' + contract.client.version;
Expand Down
4 changes: 3 additions & 1 deletion src/polyfills.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021 Scheer PAS Schweiz AG
* Copyright 2022 Scheer PAS Schweiz AG
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,6 +14,8 @@
* imitations under the License.
*/

/* eslint-disable tsdoc/syntax */

/**
* This file includes polyfills needed by Angular and is loaded before the app.
* You can add your own extra polyfills to this file.
Expand Down

0 comments on commit c6f0d95

Please sign in to comment.