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

Правда или действие #11

Merged

Conversation

AttitudeOne1
Copy link
Contributor

@AttitudeOne1 AttitudeOne1 commented Jan 31, 2025

js/form.js Outdated
Comment on lines 9 to 12
COMMENT_MAXLENGTH_ERROR: `Максимальная длина комментария ${COMMENT_MAXLENGTH} символов`,
HASHTAG_MAXLENGTH_ERROR: `Максимальная длина хэштега ${HASHTAG_MAXLENGTH} символов`,
HASHTAG_COUNT_ERROR: `Нельзя указать больше ${HASHTAGS_MAXQUANTITY} хэштегов`,
INVALID_HASHTAG_STRING: 'Хэштег должен начинаться с #, состоять из букв и чисел без пробелов и не может состоять только из одной решётки',
Copy link
Collaborator

Choose a reason for hiding this comment

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

константы получаемые на основе других значений именуем в camelCase.
В данном случае в виде словаря

const errorMessage = {
  commentMaxLenght: `Максимальная длина комментария ${COMMENT_MAXLENGTH} символов`,
};

js/form.js Outdated
const onFormSubmit = (evt) => {
evt.preventDefault();
pristine.validate();
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

ошибка линтера

js/form.js Outdated
pristine.addValidator(commentTextarea, validateComment, errorHashtagMessages.COMMENT_MAXLENGTH_ERROR);

// Валидация хештегов
const getHashtags = (value) => value.toLowerCase().trim().split(' ');
Copy link
Collaborator

Choose a reason for hiding this comment

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

будет некорректно работать, например в таких случаях: #ffff #4444 #dfgddfk

@keksobot
Copy link
Contributor

keksobot commented Feb 2, 2025

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Feb 2, 2025
@keksobot
Copy link
Contributor

keksobot commented Feb 3, 2025

♻️ Я собрал ваш пулреквест. Посмотреть можно здесь.

keksobot pushed a commit that referenced this pull request Feb 3, 2025
@Kartaviy-arteom Kartaviy-arteom merged commit 84f607e into htmlacademy-javascript:master Feb 3, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants