mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-23 10:02:51 +00:00
Compare commits
5 Commits
be98df0bad
...
81-automat
| Author | SHA1 | Date | |
|---|---|---|---|
|
f8efb7db57
|
|||
|
2a1a7a5d5b
|
|||
|
|
a69b80d1d4 | ||
|
e2abc983ef
|
|||
|
913193abdb
|
5
.changeset/cold-years-listen.md
Normal file
5
.changeset/cold-years-listen.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
"@openstapps/easy-ast": patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Fixed docs generation
|
||||||
@@ -22,7 +22,7 @@ const config = {
|
|||||||
'plugin:unicorn/recommended',
|
'plugin:unicorn/recommended',
|
||||||
'prettier',
|
'prettier',
|
||||||
],
|
],
|
||||||
plugins: ['eslint-plugin-unicorn', 'eslint-plugin-jsdoc'],
|
plugins: ['eslint-plugin-unicorn', 'eslint-plugin-jsdoc', 'header'],
|
||||||
settings: {
|
settings: {
|
||||||
jsdoc: {
|
jsdoc: {
|
||||||
mode: 'typescript',
|
mode: 'typescript',
|
||||||
@@ -36,6 +36,7 @@ const config = {
|
|||||||
'unicorn/prefer-node-protocol': 'off',
|
'unicorn/prefer-node-protocol': 'off',
|
||||||
'unicorn/no-process-exit': 'off',
|
'unicorn/no-process-exit': 'off',
|
||||||
'unicorn/no-array-reduce': 'off',
|
'unicorn/no-array-reduce': 'off',
|
||||||
|
'unicorn/prefer-event-target': 'off',
|
||||||
'unicorn/prevent-abbreviations': [
|
'unicorn/prevent-abbreviations': [
|
||||||
'error',
|
'error',
|
||||||
{
|
{
|
||||||
@@ -77,6 +78,27 @@ const config = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'header/header': [
|
||||||
|
2,
|
||||||
|
'block',
|
||||||
|
[
|
||||||
|
'',
|
||||||
|
' * Copyright (C) 2023 StApps',
|
||||||
|
' * This program is free software: you can redistribute it and/or modify it',
|
||||||
|
' * under the terms of the GNU General Public License as published by the Free',
|
||||||
|
' * Software Foundation, version 3.',
|
||||||
|
' *',
|
||||||
|
' * This program is distributed in the hope that it will be useful, but WITHOUT',
|
||||||
|
' * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or',
|
||||||
|
' * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for',
|
||||||
|
' * more details.',
|
||||||
|
' *',
|
||||||
|
' * You should have received a copy of the GNU General Public License along with',
|
||||||
|
' * this program. If not, see <https://www.gnu.org/licenses/>.',
|
||||||
|
' ',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
|
||||||
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
||||||
'@typescript-eslint/no-unused-vars': [
|
'@typescript-eslint/no-unused-vars': [
|
||||||
'error',
|
'error',
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
Copyright (C) {{year}} {{author}}
|
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
GNU General Public License for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
@@ -22,11 +22,13 @@
|
|||||||
"typescript": "5.4.2"
|
"typescript": "5.4.2"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@typescript-eslint/eslint-plugin": "7.2.0",
|
"@typescript-eslint/eslint-plugin": "5.60.1",
|
||||||
"@typescript-eslint/parser": "7.2.0",
|
"@typescript-eslint/parser": "5.60.1",
|
||||||
"eslint": "8.57.0",
|
"eslint": "8.43.0",
|
||||||
"eslint-config-prettier": "9.1.0",
|
"eslint-config-prettier": "8.8.0",
|
||||||
"eslint-plugin-jsdoc": "48.2.1",
|
"eslint-plugin-jsdoc": "46.4.2",
|
||||||
"eslint-plugin-unicorn": "51.0.1"
|
"eslint-plugin-prettier": "4.2.1",
|
||||||
|
"eslint-plugin-unicorn": "47.0.0",
|
||||||
|
"eslint-plugin-header": "3.1.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
src/app/_helpers/data
|
src/app/_helpers/data
|
||||||
node_modules
|
node_modules
|
||||||
|
src/index.html
|
||||||
|
|||||||
@@ -1,76 +1,43 @@
|
|||||||
{
|
{
|
||||||
"root": true,
|
"root": true,
|
||||||
"ignorePatterns": ["projects/**/*"],
|
"ignorePatterns": ["projects/**/*"],
|
||||||
|
"extends": ["@openstapps/eslint-config"],
|
||||||
"overrides": [
|
"overrides": [
|
||||||
{
|
{
|
||||||
"files": ["*.ts"],
|
"files": ["*.ts"],
|
||||||
"parser": "@typescript-eslint/parser",
|
|
||||||
"parserOptions": {
|
|
||||||
"ecmaVersion": 2020,
|
|
||||||
"sourceType": "module",
|
|
||||||
"project": ["tsconfig.json", "tsconfig.spec.json", "cypress/tsconfig.json"],
|
|
||||||
"createDefaultProgram": true
|
|
||||||
},
|
|
||||||
"extends": [
|
"extends": [
|
||||||
"plugin:@typescript-eslint/recommended",
|
|
||||||
"plugin:@angular-eslint/recommended",
|
"plugin:@angular-eslint/recommended",
|
||||||
"plugin:@angular-eslint/template/process-inline-templates",
|
"plugin:@angular-eslint/template/process-inline-templates"
|
||||||
"plugin:jsdoc/recommended",
|
|
||||||
"plugin:unicorn/recommended",
|
|
||||||
"prettier"
|
|
||||||
],
|
],
|
||||||
"plugins": ["eslint-plugin-unicorn", "eslint-plugin-jsdoc"],
|
|
||||||
"settings": {
|
|
||||||
"jsdoc": {
|
|
||||||
"mode": "typescript"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"rules": {
|
"rules": {
|
||||||
"unicorn/filename-case": "error",
|
"@angular-eslint/use-lifecycle-interface": "error",
|
||||||
"unicorn/no-array-reduce": "off",
|
"no-console": "off"
|
||||||
"unicorn/no-array-callback-reference": "off",
|
|
||||||
"unicorn/no-await-expression-member": "off",
|
|
||||||
"unicorn/prefer-object-from-entries": "off",
|
|
||||||
"unicorn/prefer-node-protocol": "off",
|
|
||||||
"unicorn/no-process-exit": "off",
|
|
||||||
"unicorn/prefer-event-target": "off",
|
|
||||||
"unicorn/prevent-abbreviations": [
|
|
||||||
"warn",
|
|
||||||
{
|
|
||||||
"replacements": {
|
|
||||||
"ref": false,
|
|
||||||
"i": false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"unicorn/no-nested-ternary": "off",
|
|
||||||
"unicorn/better-regex": "off",
|
|
||||||
"unicorn/no-non-null-assertion": "off",
|
|
||||||
"unicorn/consistent-function-scoping": ["error", {"checkArrowFunctions": false}],
|
|
||||||
"jsdoc/no-types": "error",
|
|
||||||
"jsdoc/require-param": "off",
|
|
||||||
"jsdoc/require-param-description": "error",
|
|
||||||
"jsdoc/check-param-names": "error",
|
|
||||||
"jsdoc/require-returns": "off",
|
|
||||||
"jsdoc/require-param-type": "off",
|
|
||||||
"jsdoc/require-returns-type": "off",
|
|
||||||
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
||||||
"@typescript-eslint/no-non-null-assertion": "off",
|
|
||||||
"@typescript-eslint/no-unused-vars": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
"args": "after-used",
|
|
||||||
"argsIgnorePattern": "^_"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"@typescript-eslint/lines-between-class-members": ["error", "always"],
|
|
||||||
"@typescript-eslint/no-explicit-any": "error",
|
|
||||||
"@angular-eslint/use-lifecycle-interface": "error"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"files": ["*.html"],
|
"files": ["*.html"],
|
||||||
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"]
|
"plugins": ["header"],
|
||||||
|
"extends": ["plugin:@angular-eslint/template/recommended", "prettier"],
|
||||||
|
"rules": {
|
||||||
|
"header/header": [
|
||||||
|
2,
|
||||||
|
"block-html",
|
||||||
|
[
|
||||||
|
"~ Copyright (C) 2023 StApps",
|
||||||
|
" ~ This program is free software: you can redistribute it and/or modify it",
|
||||||
|
" ~ under the terms of the GNU General Public License as published by the Free",
|
||||||
|
" ~ Software Foundation, version 3.",
|
||||||
|
" ~",
|
||||||
|
" ~ This program is distributed in the hope that it will be useful, but WITHOUT",
|
||||||
|
" ~ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or",
|
||||||
|
" ~ FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for",
|
||||||
|
" ~ more details.",
|
||||||
|
" ~",
|
||||||
|
" ~ You should have received a copy of the GNU General Public License along with",
|
||||||
|
" ~ this program. If not, see <https://www.gnu.org/licenses/>."
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,6 +138,7 @@
|
|||||||
"@ionic/angular-toolkit": "11.0.1",
|
"@ionic/angular-toolkit": "11.0.1",
|
||||||
"@ionic/cli": "7.2.0",
|
"@ionic/cli": "7.2.0",
|
||||||
"@openstapps/prettier-config": "workspace:*",
|
"@openstapps/prettier-config": "workspace:*",
|
||||||
|
"@openstapps/eslint-config": "workspace:*",
|
||||||
"@openstapps/tsconfig": "workspace:*",
|
"@openstapps/tsconfig": "workspace:*",
|
||||||
"@types/fontkit": "2.0.7",
|
"@types/fontkit": "2.0.7",
|
||||||
"@types/geojson": "1.0.6",
|
"@types/geojson": "1.0.6",
|
||||||
@@ -154,11 +155,6 @@
|
|||||||
"@typescript-eslint/parser": "7.2.0",
|
"@typescript-eslint/parser": "7.2.0",
|
||||||
"cordova-res": "0.15.4",
|
"cordova-res": "0.15.4",
|
||||||
"cypress": "13.7.0",
|
"cypress": "13.7.0",
|
||||||
"eslint": "8.57.0",
|
|
||||||
"eslint-plugin-jsdoc": "48.2.1",
|
|
||||||
"eslint-plugin-prettier": "5.1.3",
|
|
||||||
"eslint-plugin-unicorn": "51.0.1",
|
|
||||||
"fast-deep-equal": "3.1.3",
|
|
||||||
"fontkit": "2.0.2",
|
"fontkit": "2.0.2",
|
||||||
"glob": "10.3.10",
|
"glob": "10.3.10",
|
||||||
"http-server": "14.1.1",
|
"http-server": "14.1.1",
|
||||||
|
|||||||
@@ -33,9 +33,9 @@ ion-item {
|
|||||||
margin: var(--spacing-sm);
|
margin: var(--spacing-sm);
|
||||||
|
|
||||||
ion-thumbnail {
|
ion-thumbnail {
|
||||||
--ion-margin: var(--spacing-xs);
|
--size: 36px;
|
||||||
|
|
||||||
margin-block: auto;
|
margin: 0;
|
||||||
margin-inline: var(--spacing-md);
|
margin-inline: var(--spacing-md);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
import {Component, EventEmitter, Input, Output} from '@angular/core';
|
||||||
import {DocumentAction, PAIADocument, PAIADocumentStatus} from '../../../types';
|
import {DocumentAction, PAIADocument, PAIADocumentStatus, PAIADocumentVisualStatus} from '../../../types';
|
||||||
import {LibraryAccountService} from '../../library-account.service';
|
import {LibraryAccountService} from '../../library-account.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -27,12 +27,15 @@ export class PAIAItemComponent {
|
|||||||
|
|
||||||
renewable: boolean;
|
renewable: boolean;
|
||||||
|
|
||||||
|
visualStatus?: PAIADocumentVisualStatus;
|
||||||
|
|
||||||
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
set item(value: PAIADocument) {
|
set item(value: PAIADocument) {
|
||||||
this._item = value;
|
this._item = value;
|
||||||
void this.setRenewable();
|
void this.setRenewable();
|
||||||
|
this.visualStatus = this.getVisualStatus(Number(this.item.status));
|
||||||
}
|
}
|
||||||
|
|
||||||
get item(): PAIADocument {
|
get item(): PAIADocument {
|
||||||
@@ -56,4 +59,18 @@ export class PAIAItemComponent {
|
|||||||
const isActive = await this.libraryAccountService.isActivePatron();
|
const isActive = await this.libraryAccountService.isActivePatron();
|
||||||
this.renewable = isActive && Number(this.item.status) === PAIADocumentStatus.Held;
|
this.renewable = isActive && Number(this.item.status) === PAIADocumentStatus.Held;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private getVisualStatus(status: PAIADocumentStatus): PAIADocumentVisualStatus | undefined {
|
||||||
|
switch (status) {
|
||||||
|
case PAIADocumentStatus.Ordered: {
|
||||||
|
return {color: 'warning', status: status, statusText: 'ordered'};
|
||||||
|
}
|
||||||
|
case PAIADocumentStatus.Provided: {
|
||||||
|
return {color: 'success', status: status, statusText: 'ready'};
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,10 +14,16 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<!-- TODO: text not selectable in Chrome, bugfix needed https://github.com/ionic-team/ionic-framework/issues/24956 -->
|
|
||||||
<ion-label class="ion-text-wrap">
|
<ion-label class="ion-text-wrap">
|
||||||
@if (item.about) {
|
@if (item.about) {
|
||||||
<h2 class="name">{{ item.about }}</h2>
|
<h2 class="name">
|
||||||
|
@if (visualStatus) {
|
||||||
|
<ion-badge [color]="visualStatus.color" slot="start">
|
||||||
|
{{ 'library.account.pages' + '.' + listName + '.' + visualStatus.statusText | translate }}
|
||||||
|
</ion-badge>
|
||||||
|
}
|
||||||
|
{{ item.about }}
|
||||||
|
</h2>
|
||||||
}
|
}
|
||||||
@for (property of propertiesToShow; track property) {
|
@for (property of propertiesToShow; track property) {
|
||||||
@if (item[property]) {
|
@if (item[property]) {
|
||||||
|
|||||||
@@ -12,3 +12,6 @@
|
|||||||
* You should have received a copy of the GNU General Public License along with
|
* You should have received a copy of the GNU General Public License along with
|
||||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
ion-badge {
|
||||||
|
vertical-align: bottom;
|
||||||
|
}
|
||||||
|
|||||||
@@ -35,23 +35,13 @@
|
|||||||
@switch (activeSegment) {
|
@switch (activeSegment) {
|
||||||
@case ('orders') {
|
@case ('orders') {
|
||||||
@for (hold of paiaDocuments; track hold) {
|
@for (hold of paiaDocuments; track hold) {
|
||||||
@if (toNumber(hold.status) === paiaDocumentStatus.Provided) {
|
<stapps-paia-item
|
||||||
<stapps-paia-item
|
[item]="hold"
|
||||||
[item]="hold"
|
[propertiesToShow]="['label', 'storage']"
|
||||||
[propertiesToShow]="['label', 'storage']"
|
(documentAction)="onDocumentAction($event)"
|
||||||
(documentAction)="onDocumentAction($event)"
|
listName="holds"
|
||||||
listName="holds"
|
>
|
||||||
>
|
</stapps-paia-item>
|
||||||
</stapps-paia-item>
|
|
||||||
} @else {
|
|
||||||
<stapps-paia-item
|
|
||||||
[item]="hold"
|
|
||||||
[propertiesToShow]="['label']"
|
|
||||||
(documentAction)="onDocumentAction($event)"
|
|
||||||
listName="holds"
|
|
||||||
>
|
|
||||||
</stapps-paia-item>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@case ('reservations') {
|
@case ('reservations') {
|
||||||
|
|||||||
@@ -88,3 +88,9 @@ export interface DocumentAction {
|
|||||||
action: 'cancel' | 'renew';
|
action: 'cancel' | 'renew';
|
||||||
doc: PAIADocument;
|
doc: PAIADocument;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface PAIADocumentVisualStatus {
|
||||||
|
color: 'warning' | 'success';
|
||||||
|
status: PAIADocumentStatus;
|
||||||
|
statusText: 'ordered' | 'ready';
|
||||||
|
}
|
||||||
|
|||||||
@@ -336,13 +336,15 @@
|
|||||||
"title": "Titel",
|
"title": "Titel",
|
||||||
"about": "Mehr Informationen",
|
"about": "Mehr Informationen",
|
||||||
"label": "Signatur",
|
"label": "Signatur",
|
||||||
"starttime": "Übermittelt am",
|
"starttime": "Vorgemerkt am",
|
||||||
"endtime": "Abzuholen bis",
|
"endtime": "Abzuholen bis",
|
||||||
"storage": "Abholtheke",
|
"storage": "Abholtheke",
|
||||||
"queue": "Position in der Warteschlange"
|
"queue": "Position in der Warteschlange"
|
||||||
},
|
},
|
||||||
"holds": "Bestellungen",
|
"holds": "Bestellungen",
|
||||||
"reservations": "Vormerkungen"
|
"reservations": "Vormerkungen",
|
||||||
|
"ordered": "Bestellt",
|
||||||
|
"ready": "Abholbereit"
|
||||||
},
|
},
|
||||||
"checked_out": {
|
"checked_out": {
|
||||||
"title": "Deine Ausleihen",
|
"title": "Deine Ausleihen",
|
||||||
|
|||||||
@@ -336,13 +336,15 @@
|
|||||||
"title": "Title",
|
"title": "Title",
|
||||||
"about": "More information",
|
"about": "More information",
|
||||||
"label": "Shelfmark",
|
"label": "Shelfmark",
|
||||||
"starttime": "Submitted at",
|
"starttime": "Reserved on",
|
||||||
"endtime": "Available for pickup until",
|
"endtime": "Available for pickup until",
|
||||||
"storage": "Pick-up counter",
|
"storage": "Pickup counter",
|
||||||
"queue": "Position in the queue"
|
"queue": "Position in the queue"
|
||||||
},
|
},
|
||||||
"holds": "orders",
|
"holds": "orders",
|
||||||
"reservations": "reservations"
|
"reservations": "reservations",
|
||||||
|
"ordered": "Ordered",
|
||||||
|
"ready": "Ready for pickup"
|
||||||
},
|
},
|
||||||
"checked_out": {
|
"checked_out": {
|
||||||
"title": "checked out items",
|
"title": "checked out items",
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
"deploy": "dotenv -c -- turbo run deploy --concurrency=1",
|
"deploy": "dotenv -c -- turbo run deploy --concurrency=1",
|
||||||
"dev": "dotenv -c -- turbo run dev",
|
"dev": "dotenv -c -- turbo run dev",
|
||||||
"docs": "dotenv -c -- turbo run docs && typedoc && mkdir docs/api && cp packages/core/lib/api-doc.html docs/api/index.html && cp packages/core/lib/openapi.json docs/api/openapi.json && cp -r packages/core/lib/schema docs/api/schema",
|
"docs": "dotenv -c -- turbo run docs && typedoc && mkdir docs/api && cp packages/core/lib/api-doc.html docs/api/index.html && cp packages/core/lib/openapi.json docs/api/openapi.json && cp -r packages/core/lib/schema docs/api/schema",
|
||||||
|
"docs:serve": "http-server docs -p 8080 -o",
|
||||||
"format": "dotenv -c -- turbo run format",
|
"format": "dotenv -c -- turbo run format",
|
||||||
"format:fix": "dotenv -c -- turbo run format:fix",
|
"format:fix": "dotenv -c -- turbo run format:fix",
|
||||||
"lint": "dotenv -c -- turbo run lint",
|
"lint": "dotenv -c -- turbo run lint",
|
||||||
@@ -34,6 +35,7 @@
|
|||||||
"deepmerge": "4.3.1",
|
"deepmerge": "4.3.1",
|
||||||
"dotenv-cli": "7.2.1",
|
"dotenv-cli": "7.2.1",
|
||||||
"glob": "10.3.10",
|
"glob": "10.3.10",
|
||||||
|
"http-server": "14.1.1",
|
||||||
"junit-report-merger": "6.0.3",
|
"junit-report-merger": "6.0.3",
|
||||||
"prettier": "3.1.1",
|
"prettier": "3.1.1",
|
||||||
"syncpack": "12.3.0",
|
"syncpack": "12.3.0",
|
||||||
@@ -41,5 +43,10 @@
|
|||||||
"turbo-ignore": "1.10.16",
|
"turbo-ignore": "1.10.16",
|
||||||
"typedoc": "0.25.12",
|
"typedoc": "0.25.12",
|
||||||
"typescript": "5.4.2"
|
"typescript": "5.4.2"
|
||||||
|
},
|
||||||
|
"pnpm": {
|
||||||
|
"patchedDependencies": {
|
||||||
|
"eslint-plugin-header@3.1.1": "patches/eslint-plugin-header@3.1.1.patch"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,8 @@ import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
|||||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||||
import {TypeFlags} from 'typescript';
|
import {TypeFlags} from 'typescript';
|
||||||
|
|
||||||
// @ts-expect-error unused type
|
|
||||||
type TestTypeAlias = number | string;
|
type TestTypeAlias = number | string;
|
||||||
|
|
||||||
// @ts-expect-error unused type
|
|
||||||
enum TestEnum {
|
enum TestEnum {
|
||||||
Foo,
|
Foo,
|
||||||
Bar,
|
Bar,
|
||||||
|
|||||||
@@ -18,13 +18,9 @@ import {LightweightDefinitionKind} from '../../src/index.js';
|
|||||||
|
|
||||||
interface Random {}
|
interface Random {}
|
||||||
|
|
||||||
// @ts-expect-error unused type
|
|
||||||
type TestArrayGeneric = Array<string>;
|
type TestArrayGeneric = Array<string>;
|
||||||
// @ts-expect-error unused type
|
|
||||||
type TestArrayLiteral = number[];
|
type TestArrayLiteral = number[];
|
||||||
// @ts-expect-error unused type
|
|
||||||
type TestArrayReferenceGeneric = Array<Random>;
|
type TestArrayReferenceGeneric = Array<Random>;
|
||||||
// @ts-expect-error unused type
|
|
||||||
type TestArrayReferenceLiteral = Random[];
|
type TestArrayReferenceLiteral = Random[];
|
||||||
|
|
||||||
export const testConfig: EasyAstSpecType = {
|
export const testConfig: EasyAstSpecType = {
|
||||||
|
|||||||
@@ -16,12 +16,10 @@
|
|||||||
import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
||||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||||
|
|
||||||
// @ts-expect-error unused type
|
|
||||||
interface TestInterface {
|
interface TestInterface {
|
||||||
foo: number;
|
foo: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-expect-error unused type
|
|
||||||
class TestClass {
|
class TestClass {
|
||||||
bar: string = 'test';
|
bar: string = 'test';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,10 +22,8 @@ import {LightweightDefinitionKind} from '../../src/index.js';
|
|||||||
* Class description
|
* Class description
|
||||||
*
|
*
|
||||||
* More description
|
* More description
|
||||||
*
|
|
||||||
* @classTag classParameter1 classParameter2
|
* @classTag classParameter1 classParameter2
|
||||||
*/
|
*/
|
||||||
// @ts-expect-error unused type
|
|
||||||
interface TestInterface {
|
interface TestInterface {
|
||||||
/**
|
/**
|
||||||
* Property comment
|
* Property comment
|
||||||
@@ -33,7 +31,6 @@ interface TestInterface {
|
|||||||
* Property description
|
* Property description
|
||||||
*
|
*
|
||||||
* More description
|
* More description
|
||||||
*
|
|
||||||
* @propertyTag propertyParameter1 propertyParameter2
|
* @propertyTag propertyParameter1 propertyParameter2
|
||||||
*/
|
*/
|
||||||
foo: string;
|
foo: string;
|
||||||
@@ -45,10 +42,8 @@ interface TestInterface {
|
|||||||
* Class description
|
* Class description
|
||||||
*
|
*
|
||||||
* More description
|
* More description
|
||||||
*
|
|
||||||
* @classTag classParameter1 classParameter2
|
* @classTag classParameter1 classParameter2
|
||||||
*/
|
*/
|
||||||
// @ts-expect-error unused type
|
|
||||||
class TestClass {
|
class TestClass {
|
||||||
/**
|
/**
|
||||||
* Property comment
|
* Property comment
|
||||||
@@ -56,7 +51,6 @@ class TestClass {
|
|||||||
* Property description
|
* Property description
|
||||||
*
|
*
|
||||||
* More description
|
* More description
|
||||||
*
|
|
||||||
* @propertyTag propertyParameter1 propertyParameter2
|
* @propertyTag propertyParameter1 propertyParameter2
|
||||||
*/
|
*/
|
||||||
foo = 1;
|
foo = 1;
|
||||||
@@ -68,10 +62,8 @@ class TestClass {
|
|||||||
* Enum description
|
* Enum description
|
||||||
*
|
*
|
||||||
* More description
|
* More description
|
||||||
*
|
|
||||||
* @enumTag enumParameter1
|
* @enumTag enumParameter1
|
||||||
*/
|
*/
|
||||||
// @ts-expect-error unused type
|
|
||||||
enum TestAlias {}
|
enum TestAlias {}
|
||||||
|
|
||||||
export const testConfig: EasyAstSpecType = {
|
export const testConfig: EasyAstSpecType = {
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ interface Test1<T = number> {
|
|||||||
foo: T;
|
foo: T;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-expect-error unused type
|
|
||||||
interface Test2 {
|
interface Test2 {
|
||||||
bar: Test1;
|
bar: Test1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,13 +17,11 @@ import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
|||||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||||
import {TypeFlags} from 'typescript';
|
import {TypeFlags} from 'typescript';
|
||||||
|
|
||||||
// @ts-expect-error unused type
|
|
||||||
enum TestAuto {
|
enum TestAuto {
|
||||||
Foo,
|
Foo,
|
||||||
Bar,
|
Bar,
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-expect-error unused type
|
|
||||||
enum TestSpecified {
|
enum TestSpecified {
|
||||||
YES = 'yes',
|
YES = 'yes',
|
||||||
NO = 'no',
|
NO = 'no',
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ import {LightweightDefinitionKind} from '../../src/index.js';
|
|||||||
|
|
||||||
interface $Random {}
|
interface $Random {}
|
||||||
|
|
||||||
// @ts-expect-error unused type
|
|
||||||
interface Generics {
|
interface Generics {
|
||||||
baz: Foo<number, $Random>;
|
baz: Foo<number, $Random>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,12 +18,10 @@ import {LightweightDefinitionKind} from '../../src/index.js';
|
|||||||
|
|
||||||
interface $Random {}
|
interface $Random {}
|
||||||
|
|
||||||
// @ts-expect-error unused
|
|
||||||
interface IndexSignatureObject {
|
interface IndexSignatureObject {
|
||||||
[key: string]: $Random;
|
[key: string]: $Random;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-expect-error unused
|
|
||||||
interface IndexSignaturePrimitive {
|
interface IndexSignaturePrimitive {
|
||||||
[key: string]: number;
|
[key: string]: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ interface $BaseInterface2 {
|
|||||||
|
|
||||||
class $BaseClass {}
|
class $BaseClass {}
|
||||||
|
|
||||||
// @ts-expect-error unused
|
|
||||||
class InheritingClass extends $BaseClass implements $BaseInterface<number>, $BaseInterface2 {
|
class InheritingClass extends $BaseClass implements $BaseInterface<number>, $BaseInterface2 {
|
||||||
bar: string = '';
|
bar: string = '';
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
||||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||||
|
|
||||||
// @ts-expect-error unused
|
|
||||||
interface NestedObject {
|
interface NestedObject {
|
||||||
nested: {
|
nested: {
|
||||||
deeplyNested: {
|
deeplyNested: {
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
|||||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||||
import {TypeFlags} from 'typescript';
|
import {TypeFlags} from 'typescript';
|
||||||
|
|
||||||
// @ts-expect-error unused
|
|
||||||
interface Test {
|
interface Test {
|
||||||
number_type: number;
|
number_type: number;
|
||||||
string_type: string;
|
string_type: string;
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
||||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||||
|
|
||||||
// @ts-expect-error unused
|
|
||||||
interface Foo<T extends Bar<string>> {
|
interface Foo<T extends Bar<string>> {
|
||||||
bar: T;
|
bar: T;
|
||||||
}
|
}
|
||||||
|
|||||||
41
patches/eslint-plugin-header@3.1.1.patch
Normal file
41
patches/eslint-plugin-header@3.1.1.patch
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
diff --git a/lib/rules/header.js b/lib/rules/header.js
|
||||||
|
index 3504b6fc59b780674e652ad1ca944cb3577b8fed..d86dc0b490845c22f54ae83dbc52efcf448e628b 100644
|
||||||
|
--- a/lib/rules/header.js
|
||||||
|
+++ b/lib/rules/header.js
|
||||||
|
@@ -27,6 +27,9 @@ function excludeShebangs(comments) {
|
||||||
|
// check if they are at the start of the file since that is already checked by
|
||||||
|
// hasHeader().
|
||||||
|
function getLeadingComments(context, node) {
|
||||||
|
+ if (!node.body) {
|
||||||
|
+ return context.getSourceCode().ast.comments;
|
||||||
|
+ }
|
||||||
|
var all = excludeShebangs(context.getSourceCode().getAllComments(node.body.length ? node.body[0] : node));
|
||||||
|
if (all[0].type.toLowerCase() === "block") {
|
||||||
|
return [all[0]];
|
||||||
|
@@ -44,6 +47,8 @@ function genCommentBody(commentType, textArray, eol, numNewlines) {
|
||||||
|
var eols = eol.repeat(numNewlines);
|
||||||
|
if (commentType === "block") {
|
||||||
|
return "/*" + textArray.join(eol) + "*/" + eols;
|
||||||
|
+ } else if (commentType === "block-html") {
|
||||||
|
+ return "<!--\n " + textArray.join(eol) + "\n -->" + eols;
|
||||||
|
} else {
|
||||||
|
return "//" + textArray.join(eol + "//") + eols;
|
||||||
|
}
|
||||||
|
@@ -103,7 +108,7 @@ function hasHeader(src) {
|
||||||
|
src = src.slice(m.index + m[0].length);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- return src.substr(0, 2) === "/*" || src.substr(0, 2) === "//";
|
||||||
|
+ return src.substr(0, 2) === "/*" || src.substr(0, 2) === "//" || src.substr(0, 4) === "<!--";
|
||||||
|
}
|
||||||
|
|
||||||
|
function matchesLineEndings(src, num) {
|
||||||
|
@@ -180,7 +185,7 @@ module.exports = {
|
||||||
|
message: "missing header",
|
||||||
|
fix: canFix ? genPrependFixer(commentType, node, fixLines, eol, numNewlines) : null
|
||||||
|
});
|
||||||
|
- } else if (leadingComments[0].type.toLowerCase() !== commentType) {
|
||||||
|
+ } else if (leadingComments[0].type.toLowerCase() !== commentType.replace(/-html$/, '')) {
|
||||||
|
context.report({
|
||||||
|
loc: node.loc,
|
||||||
|
message: "header should be a {{commentType}} comment",
|
||||||
35
pnpm-lock.yaml
generated
35
pnpm-lock.yaml
generated
@@ -4,6 +4,11 @@ settings:
|
|||||||
autoInstallPeers: true
|
autoInstallPeers: true
|
||||||
excludeLinksFromLockfile: false
|
excludeLinksFromLockfile: false
|
||||||
|
|
||||||
|
patchedDependencies:
|
||||||
|
eslint-plugin-header@3.1.1:
|
||||||
|
hash: pgohhqwij7scbwihbawhnhtg3i
|
||||||
|
path: patches/eslint-plugin-header@3.1.1.patch
|
||||||
|
|
||||||
importers:
|
importers:
|
||||||
|
|
||||||
.:
|
.:
|
||||||
@@ -26,6 +31,9 @@ importers:
|
|||||||
glob:
|
glob:
|
||||||
specifier: 10.3.10
|
specifier: 10.3.10
|
||||||
version: 10.3.10
|
version: 10.3.10
|
||||||
|
http-server:
|
||||||
|
specifier: 14.1.1
|
||||||
|
version: 14.1.1
|
||||||
junit-report-merger:
|
junit-report-merger:
|
||||||
specifier: 6.0.3
|
specifier: 6.0.3
|
||||||
version: 6.0.3
|
version: 6.0.3
|
||||||
@@ -4659,22 +4667,23 @@ packages:
|
|||||||
resolution: {integrity: sha512-0QZDBePnb5a+d76zjlMYq96IDf0AOuGP7JHugFUYlYwTC7rZvROuZSpoUsvpUjNH2CzMqWgNLIekIR6EHRMIQA==}
|
resolution: {integrity: sha512-0QZDBePnb5a+d76zjlMYq96IDf0AOuGP7JHugFUYlYwTC7rZvROuZSpoUsvpUjNH2CzMqWgNLIekIR6EHRMIQA==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
dependencies:
|
dependencies:
|
||||||
'@elastic/transport': 8.3.2
|
'@elastic/transport': 8.7.0
|
||||||
tslib: 2.4.1
|
tslib: 2.4.1
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/@elastic/transport@8.3.2:
|
/@elastic/transport@8.7.0:
|
||||||
resolution: {integrity: sha512-ZiBYRVPj6pwYW99fueyNU4notDf7ZPs7Ix+4T1btIJsKJmeaORIItIfs+0O7KV4vV+DcvyMhkY1FXQx7kQOODw==}
|
resolution: {integrity: sha512-IqXT7a8DZPJtqP2qmX1I2QKmxYyN27kvSW4g6pInESE1SuGwZDp2FxHJ6W2kwmYOJwQdAt+2aWwzXO5jHo9l4A==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=18'}
|
||||||
dependencies:
|
dependencies:
|
||||||
|
'@opentelemetry/api': 1.9.0
|
||||||
debug: 4.3.4(supports-color@8.1.1)
|
debug: 4.3.4(supports-color@8.1.1)
|
||||||
hpagent: 1.2.0
|
hpagent: 1.2.0
|
||||||
ms: 2.1.3
|
ms: 2.1.3
|
||||||
secure-json-parse: 2.7.0
|
secure-json-parse: 2.7.0
|
||||||
tslib: 2.6.2
|
tslib: 2.6.2
|
||||||
undici: 5.22.1
|
undici: 6.19.2
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- supports-color
|
- supports-color
|
||||||
dev: false
|
dev: false
|
||||||
@@ -6296,6 +6305,11 @@ packages:
|
|||||||
- debug
|
- debug
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
|
/@opentelemetry/api@1.9.0:
|
||||||
|
resolution: {integrity: sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==}
|
||||||
|
engines: {node: '>=8.0.0'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/@pkgjs/parseargs@0.11.0:
|
/@pkgjs/parseargs@0.11.0:
|
||||||
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
|
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
|
||||||
engines: {node: '>=14'}
|
engines: {node: '>=14'}
|
||||||
@@ -8564,6 +8578,7 @@ packages:
|
|||||||
engines: {node: '>=10.16.0'}
|
engines: {node: '>=10.16.0'}
|
||||||
dependencies:
|
dependencies:
|
||||||
streamsearch: 1.1.0
|
streamsearch: 1.1.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
/bytes@3.0.0:
|
/bytes@3.0.0:
|
||||||
resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==}
|
resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==}
|
||||||
@@ -11744,6 +11759,7 @@ packages:
|
|||||||
peerDependenciesMeta:
|
peerDependenciesMeta:
|
||||||
debug:
|
debug:
|
||||||
optional: true
|
optional: true
|
||||||
|
dev: false
|
||||||
|
|
||||||
/follow-redirects@1.15.6:
|
/follow-redirects@1.15.6:
|
||||||
resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==}
|
resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==}
|
||||||
@@ -12648,7 +12664,7 @@ packages:
|
|||||||
engines: {node: '>=8.0.0'}
|
engines: {node: '>=8.0.0'}
|
||||||
dependencies:
|
dependencies:
|
||||||
eventemitter3: 4.0.7
|
eventemitter3: 4.0.7
|
||||||
follow-redirects: 1.15.3
|
follow-redirects: 1.15.6
|
||||||
requires-port: 1.0.0
|
requires-port: 1.0.0
|
||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- debug
|
- debug
|
||||||
@@ -18214,6 +18230,7 @@ packages:
|
|||||||
/streamsearch@1.1.0:
|
/streamsearch@1.1.0:
|
||||||
resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==}
|
resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==}
|
||||||
engines: {node: '>=10.0.0'}
|
engines: {node: '>=10.0.0'}
|
||||||
|
dev: true
|
||||||
|
|
||||||
/streamx@2.15.1:
|
/streamx@2.15.1:
|
||||||
resolution: {integrity: sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==}
|
resolution: {integrity: sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==}
|
||||||
@@ -19481,6 +19498,12 @@ packages:
|
|||||||
engines: {node: '>=14.0'}
|
engines: {node: '>=14.0'}
|
||||||
dependencies:
|
dependencies:
|
||||||
busboy: 1.6.0
|
busboy: 1.6.0
|
||||||
|
dev: true
|
||||||
|
|
||||||
|
/undici@6.19.2:
|
||||||
|
resolution: {integrity: sha512-JfjKqIauur3Q6biAtHJ564e3bWa8VvT+7cSiOJHFbX4Erv6CLGDpg8z+Fmg/1OI/47RA+GI2QZaF48SSaLvyBA==}
|
||||||
|
engines: {node: '>=18.17'}
|
||||||
|
dev: false
|
||||||
|
|
||||||
/undici@6.7.1:
|
/undici@6.7.1:
|
||||||
resolution: {integrity: sha512-+Wtb9bAQw6HYWzCnxrPTMVEV3Q1QjYanI0E4q02ehReMuquQdLTEFEYbfs7hcImVYKcQkWSwT6buEmSVIiDDtQ==}
|
resolution: {integrity: sha512-+Wtb9bAQw6HYWzCnxrPTMVEV3Q1QjYanI0E4q02ehReMuquQdLTEFEYbfs7hcImVYKcQkWSwT6buEmSVIiDDtQ==}
|
||||||
|
|||||||
Reference in New Issue
Block a user