Skip to content

Commit

Permalink
fix linter errors JC-641
Browse files Browse the repository at this point in the history
  • Loading branch information
FatykovKirill committed Jul 26, 2024
1 parent 144711e commit 48bb96a
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 9 deletions.
4 changes: 2 additions & 2 deletions apps/angular/src/app/anime-table/anime-table.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<!-- Title English Column -->
<ng-container matColumnDef="titleEng">
<th mat-header-cell *matHeaderCellDef class="anime-table__title typography_title"> Title English </th>
<td mat-cell *matCellDef="let anime" class="anime-table__content typography_content"> {{anime.titleEng | replace}}</td>
<td mat-cell *matCellDef="let anime" class="anime-table__content typography_content"> {{anime.titleEng | replace:'-'}}</td>
</ng-container>

<!-- Title Japanese Column -->
Expand All @@ -22,7 +22,7 @@
<!-- Aired start Column -->
<ng-container matColumnDef="airedStart">
<th mat-header-cell *matHeaderCellDef class="anime-table__title typography_title"> Aired Start </th>
<td mat-cell *matCellDef="let anime" class="anime-table__content typography_content"> {{anime.aired.start | date | replace}}</td>
<td mat-cell *matCellDef="let anime" class="anime-table__content typography_content"> {{anime.aired.start | date | replace:'-'}}</td>
</ng-container>

<!-- Anime type Column -->
Expand Down
7 changes: 5 additions & 2 deletions apps/angular/src/app/features/replaceEmptyString.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ import { Pipe, PipeTransform } from '@angular/core';
name: 'replace',
})
export class ReplaceEmptyStringPipe implements PipeTransform {
/** We can choose what value replace.*/
public transform(string: string | null, replaceValue = '-'): string {
/** Can choose what value replace.
* @param string - Value what replace.
* @param replaceValue - Value whit replace.
*/
public transform(string: string | null, replaceValue: string): string {
return string?.trim().length === 0 || string === null ? replaceValue : string;
}
}
1 change: 1 addition & 0 deletions apps/react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BrowserRouter } from 'react-router-dom';
import { RootRouter } from './routes/RootRouter';
import { store } from './store';

// eslint-disable-next-line jsdoc/require-jsdoc
export const App: FC = () => (
<Provider store={store}>
<BrowserRouter>
Expand Down
1 change: 1 addition & 0 deletions apps/react/src/api/config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// eslint-disable-next-line jsdoc/require-jsdoc
export const CONFIG = {
apiUrl: import.meta.env.VITE_APP_API_BASE_URL ?? '',
};
1 change: 1 addition & 0 deletions apps/react/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import axios from 'axios';

import { CONFIG } from './config';

// eslint-disable-next-line jsdoc/require-jsdoc
export const http = axios.create({
baseURL: CONFIG.apiUrl,
});
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ const GenresPageComponent: FC = () => {
);
};

// eslint-disable-next-line jsdoc/require-jsdoc
export const GenresPage = memo(GenresPageComponent);
1 change: 1 addition & 0 deletions apps/react/src/features/genres/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Navigate, RouteObject } from 'react-router-dom';

const GenresPage = lazy(() => import('./pages/GenresPage').then(module => ({ default: module.GenresPage })));

// eslint-disable-next-line jsdoc/require-jsdoc
export const genresRoutes: RouteObject[] = [
{
path: 'genres',
Expand Down
1 change: 1 addition & 0 deletions apps/react/src/store/genre/dispatchers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createAsyncThunk } from '@reduxjs/toolkit';

import { GenresService } from '../../api/services/genreService';

// eslint-disable-next-line jsdoc/require-jsdoc
export const fetchGenres = createAsyncThunk(
'genres/fetch',
() => GenresService.fetchGenres(),
Expand Down
1 change: 1 addition & 0 deletions apps/react/src/store/genre/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { createSlice } from '@reduxjs/toolkit';
import { fetchGenres } from './dispatchers';
import { initialState } from './state';

// eslint-disable-next-line jsdoc/require-jsdoc
export const genresSlice = createSlice({
name: 'genres',
initialState,
Expand Down
5 changes: 3 additions & 2 deletions apps/react/src/store/genre/state.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Genre } from '@js-camp/core/models/genre';

/** Genres state. */
export interface GenresState {
export type GenresState = {

/** Genres list. */
readonly genres: Genre[];
Expand All @@ -11,8 +11,9 @@ export interface GenresState {

/** Whether the genres are loading or not. */
readonly isLoading: boolean;
}
};

// eslint-disable-next-line jsdoc/require-jsdoc
export const initialState: GenresState = {
isLoading: false,
genres: [],
Expand Down
1 change: 1 addition & 0 deletions apps/react/src/store/store.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable jsdoc/require-jsdoc */
import { configureStore } from '@reduxjs/toolkit';
import {
TypedUseSelectorHook, useDispatch, useSelector,
Expand Down
6 changes: 3 additions & 3 deletions libs/core/dtos/anime.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export type AnimeDtoResults = {
readonly user_score: number | null;

/** Numbers of studios.*/
readonly studios: number[];
readonly studios: readonly number[];

/** Genres of Anime.*/
readonly genres: number[];
readonly genres: readonly number[];

};

Expand All @@ -63,5 +63,5 @@ export type AnimeDto = {
readonly previous: string | null;

/** Info about Anime.*/
readonly results: AnimeDtoResults[];
readonly results: readonly AnimeDtoResults[];
};

0 comments on commit 48bb96a

Please sign in to comment.