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

This commit is contained in:
vigdorov
2020-07-09 12:17:30 +03:00
parent 341fea6608
commit 358f8d5806
7 changed files with 35 additions and 49 deletions

View File

@ -16,7 +16,7 @@ class StorageListApi {
/** /**
* @param {string} key - уникальный ключ для api, который будет записан в сервисе * @param {string} key - уникальный ключ для api, который будет записан в сервисе
*/ */
constructor(key) { constructor (key) {
this.key = key; this.key = key;
this.api = new StorageServiceApi(); this.api = new StorageServiceApi();
} }
@ -30,7 +30,7 @@ class StorageListApi {
* @returns {number} - Возвращает индекс искомого эллемента по _id * @returns {number} - Возвращает индекс искомого эллемента по _id
*/ */
_findIndex = (list, _id) => { _findIndex = (list, _id) => {
return list.findIndex(item => item._id === _id); return list.findIndex((item) => item._id === _id);
} }
/** /**

View File

@ -4,7 +4,7 @@ import 'bootstrap';
// ! TODO: 5-14 строчки удалить, после теста компонента // ! TODO: 5-14 строчки удалить, после теста компонента
import TestModal from './components/test-modal'; import TestModal from './components/test-modal';
import {TestButton} from './components/test-button'; import TestButton from './components/test-button';
const testModal = new TestModal(); const testModal = new TestModal();
const testButton = new TestButton(); const testButton = new TestButton();
@ -12,17 +12,3 @@ const testButton = new TestButton();
testButton.subscribe('click', () => { testButton.subscribe('click', () => {
testModal.show(); testModal.show();
}); });
export const foo = function () {
// Sdf
console.log('dfg');
alert('dfg');
};
const x = {
f: 5,
g: 7,
k: 9
};
x + 3;

View File

@ -49,7 +49,7 @@ class Component {
* @param {Node} parentNode - родительский Node, в который следует положить созданный элемент * @param {Node} parentNode - родительский Node, в который следует положить созданный элемент
* @constructor * @constructor
*/ */
constructor(mainNodeSelector, parentNode) { constructor (mainNodeSelector, parentNode) {
/** /**
* @type {DocumentFragment} * @type {DocumentFragment}
*/ */
@ -102,7 +102,7 @@ class Component {
*/ */
next = (eventName, ...args) => { next = (eventName, ...args) => {
const listeners = this._events[eventName]; const listeners = this._events[eventName];
listeners.forEach(listener => { listeners.forEach((listener) => {
listener(...args); listener(...args);
}); });
} }

View File

@ -3,7 +3,7 @@
import Component from '../component'; import Component from '../component';
class TestButton extends Component { class TestButton extends Component {
constructor() { constructor () {
super('#test-button', document.body); super('#test-button', document.body);
this.addEventListener(this.mainNode, 'click', (evt) => { this.addEventListener(this.mainNode, 'click', (evt) => {

View File

@ -11,7 +11,7 @@ const CN = {
}; };
class TestModal extends Component { class TestModal extends Component {
constructor() { constructor () {
super('#test-modal', document.body); super('#test-modal', document.body);
this.shadow = this.mainNode.querySelector(`.${CN.SHADOW}`); this.shadow = this.mainNode.querySelector(`.${CN.SHADOW}`);