diff --git a/.travis.yml b/.travis.yml index 81dcc9d..6d999a7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,10 @@ cache: directories: - node_modules before_script: - - npm install -g yarn - cp example.config.js config.js install: - - yarn + - npm install script: - - yarn lint - - yarn build - - yarn test + - npm run lint + - npm run build + - npm run test diff --git a/package.json b/package.json index 3cdce3c..7a14702 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "test": "node scripts/test.js --silent", "test:ava": "NODE_ENV=production ava --verbose", "test-watch": "ava --watch", - "lint": "echo 'This is a placeholder for Travis'", + "lint": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"", "lint:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,scss,md}\"" }, "dependencies": { diff --git a/src/actions/index.js b/src/actions/index.js index 8eaaf5d..7c05dbe 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -1,4 +1,3 @@ -/* global fetch, alert */ import { urlFromEnv } from "../common/utilities"; // TODO: relegate these URLs entirely to environment variables diff --git a/src/common/global.js b/src/common/global.js index d9140a6..845ccaf 100644 --- a/src/common/global.js +++ b/src/common/global.js @@ -5,9 +5,11 @@ export const colors = { white: "#fff", }; -export default { +const exports = { fallbackEventColor: colors.fa_red, darkBackground: colors.black, primaryHighlight: colors.fa_red, secondaryHighlight: colors.white, }; + +export default exports; diff --git a/src/common/utilities.js b/src/common/utilities.js index 52516d6..7cbf8cb 100644 --- a/src/common/utilities.js +++ b/src/common/utilities.js @@ -380,6 +380,7 @@ export function getFilterIdxFromColorSet(filter, coloringSet) { coloringSet.map((set, idx) => { const foundIdx = set.indexOf(filter); if (foundIdx !== -1) filterIdx = idx; + return null; }); return filterIdx; } diff --git a/src/components/InfoPopup.jsx b/src/components/InfoPopup.jsx index 35976d5..5c1d73f 100644 --- a/src/components/InfoPopup.jsx +++ b/src/components/InfoPopup.jsx @@ -2,7 +2,7 @@ import React from "react"; import Popup from "./presentational/Popup"; import copy from "../common/data/copy.json"; -export default ({ isOpen, onClose, language, styles }) => ( +const Infopopup = ({ isOpen, onClose, language, styles }) => ( ( styles={styles} /> ); + +export default Infopopup; diff --git a/src/components/Layout.js b/src/components/Layout.js index 43e125f..9c37d0d 100644 --- a/src/components/Layout.js +++ b/src/components/Layout.js @@ -1,4 +1,3 @@ -/* global alert, Event */ import React from "react"; import { bindActionCreators } from "redux"; @@ -11,7 +10,6 @@ import LoadingOverlay from "./Overlay/Loading"; import Map from "./Map.jsx"; import Toolbar from "./Toolbar/Layout"; import CardStack from "./CardStack.jsx"; -// import {CardStack} from '@forensic-architecture/design-system' import NarrativeControls from "./presentational/Narrative/Controls.js"; import InfoPopup from "./InfoPopup.jsx"; import Popup from "./presentational/Popup"; diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 8334a6f..030b552 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -1,4 +1,4 @@ -/* global L, Event */ +/* global L */ import React from "react"; import { Portal } from "react-portal"; import Supercluster from "supercluster"; diff --git a/src/components/Notification.jsx b/src/components/Notification.jsx index b56043c..5162ba5 100644 --- a/src/components/Notification.jsx +++ b/src/components/Notification.jsx @@ -16,11 +16,11 @@ export default class Notification extends React.Component { if (!items) return ""; return (
- {items.map((item) => { + {items.map((item, idx) => { if (item.error) { - return

{item.error.message}

; + return

{item.error.message}

; } - return ""; + return null; })}
); @@ -47,11 +47,12 @@ export default class Notification extends React.Component { if (notificationsToRender.length > 0) { return (
- {this.props.notifications.map((notification) => { + {this.props.notifications.map((notification, idx) => { return (
this.toggleDetails()} + key={idx} >
); case "Document": - return