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

tech: add plugin eslint-plugin-jsdoc to check jsdocs require #8387

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

EldarMuhamethanov
Copy link
Contributor

Описание

Сейчас у многих свойств компонентов нет описания. Из-за этого в доке у этих свойств тоже нет описания. Нужно добавить описания так, где это нужно.

Изменения

  • Добавил eslint плагин eslint-plugin-jsdoc и настроил его, так чтобы он ругался на отсутствие jsdoc у свойств в типах и интерфейсах в папке src/components.
  • Прошелся по файлам, где были ошибки линтера и добавил где-надо описания. Также, в тех файлах, где это не нужно, добавил игнор правила

Release notes

Copy link

codesandbox-ci bot commented Mar 21, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor

github-actions bot commented Mar 21, 2025

size-limit report 📦

Path Size
JS 402.18 KB (0%)
JS (gzip) 122.18 KB (0%)
JS (brotli) 100.39 KB (0%)
JS import Div (tree shaking) 1.56 KB (0%)
CSS 348.95 KB (0%)
CSS (gzip) 43.23 KB (0%)
CSS (brotli) 34.47 KB (0%)

Copy link
Contributor

github-actions bot commented Mar 21, 2025

e2e tests

Playwright Report

Copy link
Contributor

github-actions bot commented Mar 21, 2025

👀 Docs deployed

Commit ffad473

Copy link
Contributor

@andrey-medvedev-vk andrey-medvedev-vk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💪

Не везде я уверен на счёт правок в словах, но оставил чтобы ещё над формулировкой подумать. Но это всё nit.

Copy link
Contributor

@andrey-medvedev-vk andrey-medvedev-vk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💅

@BlackySoul
Copy link
Contributor

Мейби nit, но первое, что бросилось в глаза - часть описаний (которые уже были) с точкой на конце, а новые все без 🤔

@BlackySoul
Copy link
Contributor

А в рамках этого PRа поправишь старые формулировки?

expanded: boolean;
/**
* Колбэк для изменения состояния аккордеона
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Вопрос на обсуждение - насколько уместно называть это "колбэк", все-таки это больше разговорный термин? Мейби "обработчик"? Функция-обработчик?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Прошелся везде, где нашел "колбэк", "коллбэк", "callback" и заменио на обработчик

* Режим отображения компонента:
*
* - `"sheet"`: отображение снизу экрана, подходит для мобильных устройств
* - `"menu"`: отображение в виде поповера, относительно якорного элемента
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"попап", "поповер" тоже сомнения, что звучит понятно. Всплывающее окно (элемент)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Везде, где нашел "попап", "поповер" и заменил на Всплывающее окно (элемент

isCancelItem: boolean;
}) => (event: React.MouseEvent) => void;

export type ActionSheetContextType<T extends Element = Element> = {
/**
* Обработчик клика по элементу
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Здесь и в остальных случаях слово "клик", возможно, нужно заменить на "нажатие"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Заменил везде "клик" на "нажатие"

immediateAction: ActionType<T> | undefined;
/**
* Флаг, указывающий нужно ли автоматически закрывать ActionSheet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Флаг, указывающий нужно ли автоматически закрывать ActionSheet
* Флаг, указывающий, нужно ли автоматически закрывать ActionSheet

Или перефразировать?

selectable?: boolean;
/**
* Отключает элемент
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут непонятно назначение. Чуть выше для Accordion описывался как "Блокировка взаимодействия с компонентом". Возможно, следует выбрать какое-то одно описание и везде его придерживаться.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Прошелся по свойствам, и так где есть свойство disabled поменял описание на "Блокировка взаимодействия с компонентом"

@@ -1,4 +1,5 @@
'use client';
/* eslint-disable jsdoc/require-jsdoc */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А почему тут игнор? На самом деле здесь из jsdoc ниже нужно у свойств убрать все @ignore и заменить более-менее понятным описанием

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Убрал тут игноры и добавил описаний

@EldarMuhamethanov
Copy link
Contributor Author

Мейби nit, но первое, что бросилось в глаза - часть описаний (которые уже были) с точкой на конце, а новые все без 🤔

Добавил правило, которое проверяет наличие точки в конце jsdoc и заглавную букву в начале jsdoc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

4 participants