Skip to content

Commit

Permalink
исправляет ошибки линтера
Browse files Browse the repository at this point in the history
  • Loading branch information
YouAreNotReady committed Dec 16, 2024
1 parent 7082a92 commit c330e58
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 25 deletions.
34 changes: 16 additions & 18 deletions js/data-generator.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getRandomInteger, getRandomArrayElement } from "./util.js";
import { getRandomInteger, getRandomArrayElement } from './util.js';

const DESCRIPTIONS = [
'Закат над морем',
Expand Down Expand Up @@ -59,24 +59,22 @@ const createIdGenerator = function(min, max) {

const generateCommentId = createIdGenerator(1, PHOTO_OBJECTS_AMOUNT * MAX_COMMENTS);

const createCommentObject = () => {
return {
id: generateCommentId(),
avatar: 'img/avatar-' + getRandomInteger(1, 6) + '.svg',
message: getRandomArrayElement(MESSAGES),
name: getRandomArrayElement(NAMES),
}
};
const createCommentObject = () => ({
id: generateCommentId(),
avatar: 'img/avatar-' + getRandomInteger(1, 6) + '.svg',

Check failure on line 64 in js/data-generator.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected string concatenation
message: getRandomArrayElement(MESSAGES),
name: getRandomArrayElement(NAMES),
});


const createPhotoObject = (_, index) => ({
id: index,
url: 'photos/' + index++ + '.jpg',

Check failure on line 72 in js/data-generator.js

View workflow job for this annotation

GitHub Actions / Check

Unexpected string concatenation
description: getRandomArrayElement(DESCRIPTIONS),
likes: getRandomInteger(MIN_LIKES, MAX_LIKES),
comments: Array.from({length: getRandomInteger(MIN_COMMENTS, MAX_COMMENTS)}, createCommentObject)
});

const createPhotoObject = (_, index) => {
return {
id: index,
url: 'photos/' + index++ + '.jpg',
description: getRandomArrayElement(DESCRIPTIONS),
likes: getRandomInteger(MIN_LIKES, MAX_LIKES),
comments: Array.from({length: getRandomInteger(MIN_COMMENTS, MAX_COMMENTS)}, createCommentObject)
}
};

const generatePhotoObjects = () => Array.from({length: PHOTO_OBJECTS_AMOUNT}, createPhotoObject);

Expand Down
14 changes: 7 additions & 7 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { generatePhotoObjects } from "./data-generator.js";
import "./hashtag-checker.js";
import "./image-scaling.js";
import "./image-effect.js";
import "./image-upload.js";
import "./server-upload.js"
import "./image-filtration.js";
import { generatePhotoObjects } from './data-generator.js';

Check failure on line 1 in js/main.js

View workflow job for this annotation

GitHub Actions / Check

'generatePhotoObjects' is defined but never used
import './hashtag-checker.js';
import './image-scaling.js';
import './image-effect.js';
import './image-upload.js';
import './server-upload.js';
import './image-filtration.js';

0 comments on commit c330e58

Please sign in to comment.