2
0
Эх сурвалжийг харах

Bump eslint from 2.13.1 to 4.18.2 (#5665)

* Bump eslint from 2.13.1 to 4.18.2

Bumps [eslint](https://github.com/eslint/eslint) from 2.13.1 to 4.18.2.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v2.13.1...v4.18.2)

Signed-off-by: dependabot[bot] <support@github.com>

* fix up linting issues
dependabot[bot] 5 жил өмнө
parent
commit
01caaa0dc2

+ 39 - 39
client/src/components/Draftail/DraftUtils.js

@@ -1,44 +1,44 @@
 
-  /**
-  * Returns collection of currently selected blocks.
-  * See https://github.com/jpuri/draftjs-utils/blob/e81c0ae19c3b0fdef7e0c1b70d924398956be126/js/block.js#L19.
-  */
-  const getSelectedBlocksList = (editorState) => {
-    const selectionState = editorState.getSelection();
-    const content = editorState.getCurrentContent();
-    const startKey = selectionState.getStartKey();
-    const endKey = selectionState.getEndKey();
-    const blockMap = content.getBlockMap();
-    const blocks =  blockMap
-      .toSeq()
-      .skipUntil((_, k) => k === startKey)
-      .takeUntil((_, k) => k === endKey)
-      .concat([[endKey, blockMap.get(endKey)]]);
-    return blocks.toList();
-  };
+/**
+* Returns collection of currently selected blocks.
+* See https://github.com/jpuri/draftjs-utils/blob/e81c0ae19c3b0fdef7e0c1b70d924398956be126/js/block.js#L19.
+*/
+const getSelectedBlocksList = (editorState) => {
+  const selectionState = editorState.getSelection();
+  const content = editorState.getCurrentContent();
+  const startKey = selectionState.getStartKey();
+  const endKey = selectionState.getEndKey();
+  const blockMap = content.getBlockMap();
+  const blocks =  blockMap
+    .toSeq()
+    .skipUntil((_, k) => k === startKey)
+    .takeUntil((_, k) => k === endKey)
+    .concat([[endKey, blockMap.get(endKey)]]);
+  return blocks.toList();
+};
 
-  /**
-  * Returns the currently selected text in the editor.
-  * See https://github.com/jpuri/draftjs-utils/blob/e81c0ae19c3b0fdef7e0c1b70d924398956be126/js/block.js#L106.
-  */
-  export const getSelectionText = (editorState) => {
-    const selection = editorState.getSelection();
-    let start = selection.getAnchorOffset();
-    let end = selection.getFocusOffset();
-    const selectedBlocks = getSelectedBlocksList(editorState);
+/**
+* Returns the currently selected text in the editor.
+* See https://github.com/jpuri/draftjs-utils/blob/e81c0ae19c3b0fdef7e0c1b70d924398956be126/js/block.js#L106.
+*/
+export const getSelectionText = (editorState) => {
+  const selection = editorState.getSelection();
+  let start = selection.getAnchorOffset();
+  let end = selection.getFocusOffset();
+  const selectedBlocks = getSelectedBlocksList(editorState);
 
-    if (selection.getIsBackward()) {
-      const temp = start;
-      start = end;
-      end = temp;
-    }
+  if (selection.getIsBackward()) {
+    const temp = start;
+    start = end;
+    end = temp;
+  }
 
-    let selectedText = '';
-    for (let i = 0; i < selectedBlocks.size; i += 1) {
-      const blockStart = i === 0 ? start : 0;
-      const blockEnd = i === (selectedBlocks.size - 1) ? end : selectedBlocks.get(i).getText().length;
-      selectedText += selectedBlocks.get(i).getText().slice(blockStart, blockEnd);
-    }
+  let selectedText = '';
+  for (let i = 0; i < selectedBlocks.size; i += 1) {
+    const blockStart = i === 0 ? start : 0;
+    const blockEnd = i === (selectedBlocks.size - 1) ? end : selectedBlocks.get(i).getText().length;
+    selectedText += selectedBlocks.get(i).getText().slice(blockStart, blockEnd);
+  }
 
-    return selectedText;
-  };
+  return selectedText;
+};

+ 2 - 2
client/src/components/Draftail/DraftUtils.test.js

@@ -1,6 +1,6 @@
 import {
-    EditorState,
-    convertFromRaw,
+  EditorState,
+  convertFromRaw,
 } from 'draft-js';
 
 import { getSelectionText } from './DraftUtils';

+ 0 - 1
client/src/components/Explorer/reducers/nodes.js

@@ -57,7 +57,6 @@ const defaultState = {};
  */
 export default function nodes(state = defaultState, { type, payload }) {
   switch (type) {
-
   case 'OPEN_EXPLORER':
   case 'GET_PAGE_SUCCESS':
   case 'GET_CHILDREN_START':

+ 4 - 4
client/src/components/UpgradeNotification/index.js

@@ -31,10 +31,10 @@ const initUpgradeNotification = () => {
       container.style.display = '';
     }
   })
-  .catch(err => {
-    // eslint-disable-next-line no-console
-    console.log(`Error fetching ${releasesUrl}. Error: ${err}`);
-  });
+    .catch(err => {
+      // eslint-disable-next-line no-console
+      console.log(`Error fetching ${releasesUrl}. Error: ${err}`);
+    });
 };
 
 export { initUpgradeNotification };

+ 1 - 1
client/src/utils/version.js

@@ -1,5 +1,5 @@
 function compareVersion(versionA, versionB) {
-  const re = /(\.0)+[^\.]*$/;
+  const re = /(\.0)+[^.]*$/;
   const va = (versionA + '').replace(re, '').split('.');
   const vb = (versionB + '').replace(re, '').split('.');
   const len = Math.min(va.length, vb.length);

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 479 - 205
package-lock.json


+ 1 - 1
package.json

@@ -61,7 +61,7 @@
     "enzyme": "^3.9.0",
     "enzyme-adapter-react-16": "^1.9.1",
     "enzyme-to-json": "^3.3.0",
-    "eslint": "^2.9.0",
+    "eslint": "^4.18.2",
     "eslint-config-wagtail": "0.1.1",
     "eslint-import-resolver-webpack": "^0.8.1",
     "eslint-plugin-import": "^1.8.1",

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно