mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2025-12-19 20:56:22 +00:00
Compare commits
7 Commits
@openstapp
...
81-automat
| Author | SHA1 | Date | |
|---|---|---|---|
|
f8efb7db57
|
|||
|
2a1a7a5d5b
|
|||
|
|
a69b80d1d4 | ||
|
e2abc983ef
|
|||
|
913193abdb
|
|||
| 67ab1fd613 | |||
|
|
142079bf0e |
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
|
||||
5
.changeset/rich-rats-guess.md
Normal file
5
.changeset/rich-rats-guess.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@openstapps/backend": patch
|
||||
---
|
||||
|
||||
fix for geo.point mapping
|
||||
@@ -25,7 +25,7 @@ export function buildDistanceFilter(
|
||||
): QueryDslSpecificQueryContainer<'geo_distance'> {
|
||||
const geoObject: QueryDslGeoDistanceQuery = {
|
||||
distance: `${filter.arguments.distance}m`,
|
||||
[`${filter.arguments.field}.point.coordinates`]: {
|
||||
[`${filter.arguments.field}.point`]: {
|
||||
lat: filter.arguments.position[1],
|
||||
lon: filter.arguments.position[0],
|
||||
},
|
||||
|
||||
@@ -25,7 +25,7 @@ export function buildDistanceSort(sort: SCDistanceSort): SortOptions {
|
||||
mode: 'avg',
|
||||
order: sort.order,
|
||||
unit: 'm',
|
||||
[`${sort.arguments.field}.point.coordinates`]: {
|
||||
[`${sort.arguments.field}.point`]: {
|
||||
lat: sort.arguments.position[1],
|
||||
lon: sort.arguments.position[0],
|
||||
},
|
||||
|
||||
@@ -466,7 +466,7 @@ describe('Query', function () {
|
||||
const expectedFilter: QueryDslSpecificQueryContainer<'geo_distance'> = {
|
||||
geo_distance: {
|
||||
'distance': '1000m',
|
||||
'geo.point.coordinates': {
|
||||
'geo.point': {
|
||||
lat: 8.123,
|
||||
lon: 50.123,
|
||||
},
|
||||
@@ -636,7 +636,7 @@ describe('Query', function () {
|
||||
'mode': 'avg',
|
||||
'order': 'desc',
|
||||
'unit': 'm',
|
||||
'geo.point.coordinates': {
|
||||
'geo.point': {
|
||||
lat: 50.123,
|
||||
lon: 8.123,
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ const config = {
|
||||
'plugin:unicorn/recommended',
|
||||
'prettier',
|
||||
],
|
||||
plugins: ['eslint-plugin-unicorn', 'eslint-plugin-jsdoc'],
|
||||
plugins: ['eslint-plugin-unicorn', 'eslint-plugin-jsdoc', 'header'],
|
||||
settings: {
|
||||
jsdoc: {
|
||||
mode: 'typescript',
|
||||
@@ -36,6 +36,7 @@ const config = {
|
||||
'unicorn/prefer-node-protocol': 'off',
|
||||
'unicorn/no-process-exit': 'off',
|
||||
'unicorn/no-array-reduce': 'off',
|
||||
'unicorn/prefer-event-target': 'off',
|
||||
'unicorn/prevent-abbreviations': [
|
||||
'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/no-unused-vars': [
|
||||
'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"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@typescript-eslint/eslint-plugin": "7.2.0",
|
||||
"@typescript-eslint/parser": "7.2.0",
|
||||
"eslint": "8.57.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"eslint-plugin-jsdoc": "48.2.1",
|
||||
"eslint-plugin-unicorn": "51.0.1"
|
||||
"@typescript-eslint/eslint-plugin": "5.60.1",
|
||||
"@typescript-eslint/parser": "5.60.1",
|
||||
"eslint": "8.43.0",
|
||||
"eslint-config-prettier": "8.8.0",
|
||||
"eslint-plugin-jsdoc": "46.4.2",
|
||||
"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
|
||||
node_modules
|
||||
src/index.html
|
||||
|
||||
@@ -1,76 +1,43 @@
|
||||
{
|
||||
"root": true,
|
||||
"ignorePatterns": ["projects/**/*"],
|
||||
"extends": ["@openstapps/eslint-config"],
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.ts"],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2020,
|
||||
"sourceType": "module",
|
||||
"project": ["tsconfig.json", "tsconfig.spec.json", "cypress/tsconfig.json"],
|
||||
"createDefaultProgram": true
|
||||
},
|
||||
"extends": [
|
||||
"plugin:@typescript-eslint/recommended",
|
||||
"plugin:@angular-eslint/recommended",
|
||||
"plugin:@angular-eslint/template/process-inline-templates",
|
||||
"plugin:jsdoc/recommended",
|
||||
"plugin:unicorn/recommended",
|
||||
"prettier"
|
||||
"plugin:@angular-eslint/template/process-inline-templates"
|
||||
],
|
||||
"plugins": ["eslint-plugin-unicorn", "eslint-plugin-jsdoc"],
|
||||
"settings": {
|
||||
"jsdoc": {
|
||||
"mode": "typescript"
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"unicorn/filename-case": "error",
|
||||
"unicorn/no-array-reduce": "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"
|
||||
"@angular-eslint/use-lifecycle-interface": "error",
|
||||
"no-console": "off"
|
||||
}
|
||||
},
|
||||
{
|
||||
"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/cli": "7.2.0",
|
||||
"@openstapps/prettier-config": "workspace:*",
|
||||
"@openstapps/eslint-config": "workspace:*",
|
||||
"@openstapps/tsconfig": "workspace:*",
|
||||
"@types/fontkit": "2.0.7",
|
||||
"@types/geojson": "1.0.6",
|
||||
@@ -154,11 +155,6 @@
|
||||
"@typescript-eslint/parser": "7.2.0",
|
||||
"cordova-res": "0.15.4",
|
||||
"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",
|
||||
"glob": "10.3.10",
|
||||
"http-server": "14.1.1",
|
||||
|
||||
@@ -33,9 +33,9 @@ ion-item {
|
||||
margin: var(--spacing-sm);
|
||||
|
||||
ion-thumbnail {
|
||||
--ion-margin: var(--spacing-xs);
|
||||
--size: 36px;
|
||||
|
||||
margin-block: auto;
|
||||
margin: 0;
|
||||
margin-inline: var(--spacing-md);
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
|
||||
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';
|
||||
|
||||
@Component({
|
||||
@@ -27,12 +27,15 @@ export class PAIAItemComponent {
|
||||
|
||||
renewable: boolean;
|
||||
|
||||
visualStatus?: PAIADocumentVisualStatus;
|
||||
|
||||
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
||||
|
||||
@Input()
|
||||
set item(value: PAIADocument) {
|
||||
this._item = value;
|
||||
void this.setRenewable();
|
||||
this.visualStatus = this.getVisualStatus(Number(this.item.status));
|
||||
}
|
||||
|
||||
get item(): PAIADocument {
|
||||
@@ -56,4 +59,18 @@ export class PAIAItemComponent {
|
||||
const isActive = await this.libraryAccountService.isActivePatron();
|
||||
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>
|
||||
<!-- TODO: text not selectable in Chrome, bugfix needed https://github.com/ionic-team/ionic-framework/issues/24956 -->
|
||||
<ion-label class="ion-text-wrap">
|
||||
@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) {
|
||||
@if (item[property]) {
|
||||
|
||||
@@ -12,3 +12,6 @@
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
ion-badge {
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
@@ -35,23 +35,13 @@
|
||||
@switch (activeSegment) {
|
||||
@case ('orders') {
|
||||
@for (hold of paiaDocuments; track hold) {
|
||||
@if (toNumber(hold.status) === paiaDocumentStatus.Provided) {
|
||||
<stapps-paia-item
|
||||
[item]="hold"
|
||||
[propertiesToShow]="['label', 'storage']"
|
||||
(documentAction)="onDocumentAction($event)"
|
||||
listName="holds"
|
||||
>
|
||||
</stapps-paia-item>
|
||||
} @else {
|
||||
<stapps-paia-item
|
||||
[item]="hold"
|
||||
[propertiesToShow]="['label']"
|
||||
(documentAction)="onDocumentAction($event)"
|
||||
listName="holds"
|
||||
>
|
||||
</stapps-paia-item>
|
||||
}
|
||||
<stapps-paia-item
|
||||
[item]="hold"
|
||||
[propertiesToShow]="['label', 'storage']"
|
||||
(documentAction)="onDocumentAction($event)"
|
||||
listName="holds"
|
||||
>
|
||||
</stapps-paia-item>
|
||||
}
|
||||
}
|
||||
@case ('reservations') {
|
||||
|
||||
@@ -88,3 +88,9 @@ export interface DocumentAction {
|
||||
action: 'cancel' | 'renew';
|
||||
doc: PAIADocument;
|
||||
}
|
||||
|
||||
export interface PAIADocumentVisualStatus {
|
||||
color: 'warning' | 'success';
|
||||
status: PAIADocumentStatus;
|
||||
statusText: 'ordered' | 'ready';
|
||||
}
|
||||
|
||||
@@ -336,13 +336,15 @@
|
||||
"title": "Titel",
|
||||
"about": "Mehr Informationen",
|
||||
"label": "Signatur",
|
||||
"starttime": "Übermittelt am",
|
||||
"starttime": "Vorgemerkt am",
|
||||
"endtime": "Abzuholen bis",
|
||||
"storage": "Abholtheke",
|
||||
"queue": "Position in der Warteschlange"
|
||||
},
|
||||
"holds": "Bestellungen",
|
||||
"reservations": "Vormerkungen"
|
||||
"reservations": "Vormerkungen",
|
||||
"ordered": "Bestellt",
|
||||
"ready": "Abholbereit"
|
||||
},
|
||||
"checked_out": {
|
||||
"title": "Deine Ausleihen",
|
||||
|
||||
@@ -336,13 +336,15 @@
|
||||
"title": "Title",
|
||||
"about": "More information",
|
||||
"label": "Shelfmark",
|
||||
"starttime": "Submitted at",
|
||||
"starttime": "Reserved on",
|
||||
"endtime": "Available for pickup until",
|
||||
"storage": "Pick-up counter",
|
||||
"storage": "Pickup counter",
|
||||
"queue": "Position in the queue"
|
||||
},
|
||||
"holds": "orders",
|
||||
"reservations": "reservations"
|
||||
"reservations": "reservations",
|
||||
"ordered": "Ordered",
|
||||
"ready": "Ready for pickup"
|
||||
},
|
||||
"checked_out": {
|
||||
"title": "checked out items",
|
||||
|
||||
@@ -21,7 +21,7 @@ export const environment = {
|
||||
backend_url: 'https://mobile.server.uni-frankfurt.de',
|
||||
app_host: 'mobile.app.uni-frankfurt.de',
|
||||
custom_url_scheme: 'de.anyschool.app',
|
||||
backend_version: '3.3.0',
|
||||
backend_version: '999.0.0',
|
||||
production: true,
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ export const environment = {
|
||||
backend_url: 'https://mobile.server.uni-frankfurt.de',
|
||||
app_host: 'mobile.app.uni-frankfurt.de',
|
||||
custom_url_scheme: 'de.anyschool.app',
|
||||
backend_version: '3.3.0',
|
||||
backend_version: '999.0.0',
|
||||
production: false,
|
||||
};
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"deploy": "dotenv -c -- turbo run deploy --concurrency=1",
|
||||
"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:serve": "http-server docs -p 8080 -o",
|
||||
"format": "dotenv -c -- turbo run format",
|
||||
"format:fix": "dotenv -c -- turbo run format:fix",
|
||||
"lint": "dotenv -c -- turbo run lint",
|
||||
@@ -34,6 +35,7 @@
|
||||
"deepmerge": "4.3.1",
|
||||
"dotenv-cli": "7.2.1",
|
||||
"glob": "10.3.10",
|
||||
"http-server": "14.1.1",
|
||||
"junit-report-merger": "6.0.3",
|
||||
"prettier": "3.1.1",
|
||||
"syncpack": "12.3.0",
|
||||
@@ -41,5 +43,10 @@
|
||||
"turbo-ignore": "1.10.16",
|
||||
"typedoc": "0.25.12",
|
||||
"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 {TypeFlags} from 'typescript';
|
||||
|
||||
// @ts-expect-error unused type
|
||||
type TestTypeAlias = number | string;
|
||||
|
||||
// @ts-expect-error unused type
|
||||
enum TestEnum {
|
||||
Foo,
|
||||
Bar,
|
||||
|
||||
@@ -18,13 +18,9 @@ import {LightweightDefinitionKind} from '../../src/index.js';
|
||||
|
||||
interface Random {}
|
||||
|
||||
// @ts-expect-error unused type
|
||||
type TestArrayGeneric = Array<string>;
|
||||
// @ts-expect-error unused type
|
||||
type TestArrayLiteral = number[];
|
||||
// @ts-expect-error unused type
|
||||
type TestArrayReferenceGeneric = Array<Random>;
|
||||
// @ts-expect-error unused type
|
||||
type TestArrayReferenceLiteral = Random[];
|
||||
|
||||
export const testConfig: EasyAstSpecType = {
|
||||
|
||||
@@ -16,12 +16,10 @@
|
||||
import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||
|
||||
// @ts-expect-error unused type
|
||||
interface TestInterface {
|
||||
foo: number;
|
||||
}
|
||||
|
||||
// @ts-expect-error unused type
|
||||
class TestClass {
|
||||
bar: string = 'test';
|
||||
}
|
||||
|
||||
@@ -22,10 +22,8 @@ import {LightweightDefinitionKind} from '../../src/index.js';
|
||||
* Class description
|
||||
*
|
||||
* More description
|
||||
*
|
||||
* @classTag classParameter1 classParameter2
|
||||
*/
|
||||
// @ts-expect-error unused type
|
||||
interface TestInterface {
|
||||
/**
|
||||
* Property comment
|
||||
@@ -33,7 +31,6 @@ interface TestInterface {
|
||||
* Property description
|
||||
*
|
||||
* More description
|
||||
*
|
||||
* @propertyTag propertyParameter1 propertyParameter2
|
||||
*/
|
||||
foo: string;
|
||||
@@ -45,10 +42,8 @@ interface TestInterface {
|
||||
* Class description
|
||||
*
|
||||
* More description
|
||||
*
|
||||
* @classTag classParameter1 classParameter2
|
||||
*/
|
||||
// @ts-expect-error unused type
|
||||
class TestClass {
|
||||
/**
|
||||
* Property comment
|
||||
@@ -56,7 +51,6 @@ class TestClass {
|
||||
* Property description
|
||||
*
|
||||
* More description
|
||||
*
|
||||
* @propertyTag propertyParameter1 propertyParameter2
|
||||
*/
|
||||
foo = 1;
|
||||
@@ -68,10 +62,8 @@ class TestClass {
|
||||
* Enum description
|
||||
*
|
||||
* More description
|
||||
*
|
||||
* @enumTag enumParameter1
|
||||
*/
|
||||
// @ts-expect-error unused type
|
||||
enum TestAlias {}
|
||||
|
||||
export const testConfig: EasyAstSpecType = {
|
||||
|
||||
@@ -20,7 +20,6 @@ interface Test1<T = number> {
|
||||
foo: T;
|
||||
}
|
||||
|
||||
// @ts-expect-error unused type
|
||||
interface Test2 {
|
||||
bar: Test1;
|
||||
}
|
||||
|
||||
@@ -17,13 +17,11 @@ import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||
import {TypeFlags} from 'typescript';
|
||||
|
||||
// @ts-expect-error unused type
|
||||
enum TestAuto {
|
||||
Foo,
|
||||
Bar,
|
||||
}
|
||||
|
||||
// @ts-expect-error unused type
|
||||
enum TestSpecified {
|
||||
YES = 'yes',
|
||||
NO = 'no',
|
||||
|
||||
@@ -18,7 +18,6 @@ import {LightweightDefinitionKind} from '../../src/index.js';
|
||||
|
||||
interface $Random {}
|
||||
|
||||
// @ts-expect-error unused type
|
||||
interface Generics {
|
||||
baz: Foo<number, $Random>;
|
||||
}
|
||||
|
||||
@@ -18,12 +18,10 @@ import {LightweightDefinitionKind} from '../../src/index.js';
|
||||
|
||||
interface $Random {}
|
||||
|
||||
// @ts-expect-error unused
|
||||
interface IndexSignatureObject {
|
||||
[key: string]: $Random;
|
||||
}
|
||||
|
||||
// @ts-expect-error unused
|
||||
interface IndexSignaturePrimitive {
|
||||
[key: string]: number;
|
||||
}
|
||||
|
||||
@@ -26,7 +26,6 @@ interface $BaseInterface2 {
|
||||
|
||||
class $BaseClass {}
|
||||
|
||||
// @ts-expect-error unused
|
||||
class InheritingClass extends $BaseClass implements $BaseInterface<number>, $BaseInterface2 {
|
||||
bar: string = '';
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||
|
||||
// @ts-expect-error unused
|
||||
interface NestedObject {
|
||||
nested: {
|
||||
deeplyNested: {
|
||||
|
||||
@@ -17,7 +17,6 @@ import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||
import {TypeFlags} from 'typescript';
|
||||
|
||||
// @ts-expect-error unused
|
||||
interface Test {
|
||||
number_type: number;
|
||||
string_type: string;
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
import {EasyAstSpecType} from '../easy-ast-spec-type.js';
|
||||
import {LightweightDefinitionKind} from '../../src/index.js';
|
||||
|
||||
// @ts-expect-error unused
|
||||
interface Foo<T extends Bar<string>> {
|
||||
bar: T;
|
||||
}
|
||||
|
||||
@@ -27,15 +27,7 @@ export const premaps: Record<string, MappingProperty> = {
|
||||
type: 'geo_shape',
|
||||
},
|
||||
'Point': {
|
||||
properties: {
|
||||
type: {
|
||||
type: 'keyword',
|
||||
},
|
||||
coordinates: {
|
||||
type: 'geo_point',
|
||||
},
|
||||
},
|
||||
dynamic: 'strict',
|
||||
type: 'geo_point',
|
||||
},
|
||||
'Polygon': {
|
||||
type: 'geo_shape',
|
||||
|
||||
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
|
||||
excludeLinksFromLockfile: false
|
||||
|
||||
patchedDependencies:
|
||||
eslint-plugin-header@3.1.1:
|
||||
hash: pgohhqwij7scbwihbawhnhtg3i
|
||||
path: patches/eslint-plugin-header@3.1.1.patch
|
||||
|
||||
importers:
|
||||
|
||||
.:
|
||||
@@ -26,6 +31,9 @@ importers:
|
||||
glob:
|
||||
specifier: 10.3.10
|
||||
version: 10.3.10
|
||||
http-server:
|
||||
specifier: 14.1.1
|
||||
version: 14.1.1
|
||||
junit-report-merger:
|
||||
specifier: 6.0.3
|
||||
version: 6.0.3
|
||||
@@ -4659,22 +4667,23 @@ packages:
|
||||
resolution: {integrity: sha512-0QZDBePnb5a+d76zjlMYq96IDf0AOuGP7JHugFUYlYwTC7rZvROuZSpoUsvpUjNH2CzMqWgNLIekIR6EHRMIQA==}
|
||||
engines: {node: '>=14'}
|
||||
dependencies:
|
||||
'@elastic/transport': 8.3.2
|
||||
'@elastic/transport': 8.7.0
|
||||
tslib: 2.4.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/@elastic/transport@8.3.2:
|
||||
resolution: {integrity: sha512-ZiBYRVPj6pwYW99fueyNU4notDf7ZPs7Ix+4T1btIJsKJmeaORIItIfs+0O7KV4vV+DcvyMhkY1FXQx7kQOODw==}
|
||||
engines: {node: '>=14'}
|
||||
/@elastic/transport@8.7.0:
|
||||
resolution: {integrity: sha512-IqXT7a8DZPJtqP2qmX1I2QKmxYyN27kvSW4g6pInESE1SuGwZDp2FxHJ6W2kwmYOJwQdAt+2aWwzXO5jHo9l4A==}
|
||||
engines: {node: '>=18'}
|
||||
dependencies:
|
||||
'@opentelemetry/api': 1.9.0
|
||||
debug: 4.3.4(supports-color@8.1.1)
|
||||
hpagent: 1.2.0
|
||||
ms: 2.1.3
|
||||
secure-json-parse: 2.7.0
|
||||
tslib: 2.6.2
|
||||
undici: 5.22.1
|
||||
undici: 6.19.2
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
@@ -6296,6 +6305,11 @@ packages:
|
||||
- debug
|
||||
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:
|
||||
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
|
||||
engines: {node: '>=14'}
|
||||
@@ -8564,6 +8578,7 @@ packages:
|
||||
engines: {node: '>=10.16.0'}
|
||||
dependencies:
|
||||
streamsearch: 1.1.0
|
||||
dev: true
|
||||
|
||||
/bytes@3.0.0:
|
||||
resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==}
|
||||
@@ -11744,6 +11759,7 @@ packages:
|
||||
peerDependenciesMeta:
|
||||
debug:
|
||||
optional: true
|
||||
dev: false
|
||||
|
||||
/follow-redirects@1.15.6:
|
||||
resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==}
|
||||
@@ -12648,7 +12664,7 @@ packages:
|
||||
engines: {node: '>=8.0.0'}
|
||||
dependencies:
|
||||
eventemitter3: 4.0.7
|
||||
follow-redirects: 1.15.3
|
||||
follow-redirects: 1.15.6
|
||||
requires-port: 1.0.0
|
||||
transitivePeerDependencies:
|
||||
- debug
|
||||
@@ -18214,6 +18230,7 @@ packages:
|
||||
/streamsearch@1.1.0:
|
||||
resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
dev: true
|
||||
|
||||
/streamx@2.15.1:
|
||||
resolution: {integrity: sha512-fQMzy2O/Q47rgwErk/eGeLu/roaFWV0jVsogDmrszM9uIw8L5OA+t+V93MgYlufNptfjmYR1tOMWhei/Eh7TQA==}
|
||||
@@ -19481,6 +19498,12 @@ packages:
|
||||
engines: {node: '>=14.0'}
|
||||
dependencies:
|
||||
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:
|
||||
resolution: {integrity: sha512-+Wtb9bAQw6HYWzCnxrPTMVEV3Q1QjYanI0E4q02ehReMuquQdLTEFEYbfs7hcImVYKcQkWSwT6buEmSVIiDDtQ==}
|
||||
|
||||
Reference in New Issue
Block a user