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

incorp greenelab eslint config #128

Merged
merged 14 commits into from
Mar 31, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REACT_APP_BASENAME=
EXTEND_ESLINT=true
31 changes: 0 additions & 31 deletions .eslintrc

This file was deleted.

3 changes: 3 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
extends:
- react-app
- greenelab
1 change: 1 addition & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
prettier-config-greenelab
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adage-frontend",
"version": "0.2.3",
"version": "0.2.4",
"dependencies": {
"@greenelab/hclust": "^0.0.0",
"@stdlib/stdlib": "^0.0.91",
Expand All @@ -17,7 +17,7 @@
"react-linkify": "^1.0.0-alpha",
"react-redux": "^7.2.0",
"react-router-dom": "^5.1.2",
"react-scripts": "^3.4.1",
"react-scripts": "3.4.0",
"react-transition-group": "^4.3.0",
"redux": "^4.0.5",
"redux-actions": "^2.6.5",
Expand All @@ -40,12 +40,11 @@
"not dead"
],
"devDependencies": {
"@testing-library/jest-dom": "^5.1.1",
"@testing-library/react": "^10.0.1",
"eslint-config-google": "^0.14.0",
"eslint-plugin-html": "^6.0.0",
"eslint-plugin-react": "^7.19.0",
"@testing-library/jest-dom": "^5.3.0",
"@testing-library/react": "^10.0.2",
"eslint-config-greenelab": "git+https://[email protected]/greenelab/eslint-config-greenelab.git",
"node-fetch": "^2.6.0",
"prettier-config-greenelab": "git+https://[email protected]/greenelab/prettier-config-greenelab.git",
"rewire": "^5.0.0"
}
}
2 changes: 1 addition & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const App = () => (
<Route path='/' component={Home} />
</Switch>
</Router>
<Tooltip/>
<Tooltip />
</Provider>
);

Expand Down
4 changes: 2 additions & 2 deletions src/components/popup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ const Portal = ({
className={'popup_content ' + className}
onClick={(event) => event.stopPropagation()}
style={{
right: (window.innerWidth - anchorBbox.rightAbsolute) || 0,
top: (anchorBbox.bottomAbsolute + distance) || 0
right: window.innerWidth - anchorBbox.rightAbsolute || 0,
top: anchorBbox.bottomAbsolute + distance || 0
}}
>
{children}
Expand Down
27 changes: 14 additions & 13 deletions src/components/table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ const Table = ({
if (sortKey === null || sortUp === null)
return [...data];

const value = (columns.find((column) => column.key === sortKey) || {}).value;
const value = (columns.find((column) => column.key === sortKey) || {})
.value;

let sortFunc;
if (isFunction(value)) {
Expand All @@ -103,34 +104,34 @@ const Table = ({

return (
<div
className="table"
className='table'
data-sortable={sortable}
data-freeze-row={freezeRow}
data-freeze-col={freezeCol}
>
<div className="thead medium">
<div className="tr">
<div className='thead medium'>
<div className='tr'>
{columns.map((column, index) => (
<button
key={index}
className="th"
className='th'
style={{
width: column.width,
justifyContent: column.align
}}
data-padded={column.padded === false ? false : true}
title=""
title=''
onClick={() => onClick(column.key)}
disabled={!sortable}
>
<span className="nowrap" aria-label="">
<span className='nowrap' aria-label=''>
{column.name}
</span>
{sortKey !== null && column.key && sortKey === column.key ? (
sortUp ? (
<ArrowIcon className="rotate_ccw" />
<ArrowIcon className='rotate_ccw' />
) : (
<ArrowIcon className="rotate_cw" />
<ArrowIcon className='rotate_cw' />
)
) : (
''
Expand All @@ -140,10 +141,10 @@ const Table = ({
</div>
<HorizontalLine />
</div>
<div className="tbody">
<div className='tbody'>
{table.map((row, index, array) => (
<Fragment key={index}>
<div className="tr" data-shade={index === highlightedIndex}>
<div className='tr' data-shade={index === highlightedIndex}>
{columns.map((column, index) => {
const cell = row[column.key];
// render cell contents
Expand All @@ -152,7 +153,7 @@ const Table = ({
contents = column.render({ row, column, cell });
else {
contents = (
<span className="nowrap" aria-label="">
<span className='nowrap' aria-label=''>
{cell}
</span>
);
Expand All @@ -161,7 +162,7 @@ const Table = ({
return (
<span
key={index}
className="td"
className='td'
data-highlight={column.key === row.highlightedField}
data-padded={column.padded === false ? false : true}
style={{
Expand Down
6 changes: 3 additions & 3 deletions src/components/tooltip/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const Tooltip = () => {
<CSSTransition
in={open ? true : false}
timeout={speed}
classNames="tooltip"
classNames='tooltip'
unmountOnExit
>
<Portal anchor={anchor} speed={speed} center={center} />
Expand All @@ -98,7 +98,7 @@ const Portal = ({ anchor, speed, center }) => {
if (objectLabel) {
const fields = humanizeKeys(objectLabel);
content = (
<table className="tooltip_table text_small">
<table className='tooltip_table text_small'>
<tbody>
{Object.entries(fields).map(([key, value], index) => (
<tr key={index}>
Expand All @@ -114,7 +114,7 @@ const Portal = ({ anchor, speed, center }) => {

return createPortal(
<div
className="tooltip text_small"
className='tooltip text_small'
style={{
...computeStyle({ anchor, center }),
transition: 'opacity ease ' + speed + 'ms'
Expand Down
1 change: 0 additions & 1 deletion src/controllers/genes.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { isArray } from '../util/types';
import { MAX_INT } from './';
import { makeMapDispatchToProps } from './util';

/* eslint import/no-webpack-loader-syntax: off */
import worker from 'workerize-loader!../util/math';

let GeneController = ({
Expand Down
1 change: 0 additions & 1 deletion src/controllers/samples.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { actionStatuses } from '../actions/fetch';
import { MAX_INT } from './';
import { makeMapDispatchToProps } from './util';

/* eslint import/no-webpack-loader-syntax: off */
import worker from 'workerize-loader!../util/math';

// dispatch new actions in response to redux state changes
Expand Down
3 changes: 1 addition & 2 deletions src/pages/experiments/activities/heatmap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ const Heatmap = ({ activities, samples, signatures }) => {
sample: d.sampleName,
signature: d.signatureName,
activity: d.value.toFixed(5)
})
)
}))
.attr('data-tooltip-speed', 10);
cells.exit().remove();
}, [mounted, activities, samples, signatures, width, height]);
Expand Down
8 changes: 5 additions & 3 deletions src/pages/experiments/activities/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { isString } from '../../../util/types';
import { isArray } from '../../../util/types';
import { uniqueMap } from '../../../util/object';

/* eslint import/no-webpack-loader-syntax: off */
import worker from 'workerize-loader!../../../util/math';

import './index.css';
Expand All @@ -27,7 +26,10 @@ let Activities = ({ selectedExperiment, activities }) => {
let unsortedSignatures;
if (isArray(activities)) {
unsortedSamples = uniqueMap(activities, (activity) => activity.sample);
unsortedSignatures = uniqueMap(activities, (activity) => activity.signature);
unsortedSignatures = uniqueMap(
activities,
(activity) => activity.signature
);
}

// when selected experiment changes
Expand Down Expand Up @@ -64,7 +66,7 @@ let Activities = ({ selectedExperiment, activities }) => {
return (
<>
{isString(activities) && (
<FetchAlert status={activities} subject="activities" />
<FetchAlert status={activities} subject='activities' />
)}
{isArray(activities) && (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/experiments/group/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import './index.css';

let Selected = ({ anySelected }) => (
<>
{anySelected === false && <Alert text="No experiment selected" />}
{anySelected === false && <Alert text='No experiment selected' />}
{anySelected === true && (
<>
<Table />
Expand Down
8 changes: 4 additions & 4 deletions src/pages/experiments/group/table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ let Table = ({ samples }) => (
<>
<GroupButton
sample={row}
index="diamond"
color="var(--blue)"
index='diamond'
color='var(--blue)'
Icon={DiamondIcon}
/>
<GroupButton
sample={row}
index="spade"
color="var(--red)"
index='spade'
color='var(--red)'
Icon={SpadeIcon}
/>
</>
Expand Down
10 changes: 5 additions & 5 deletions src/pages/experiments/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ const Experiments = () => (
<>
<Header />
<Main>
<Section header="Experiment Search">
<Section header='Experiment Search'>
<Search />
</Section>
<Section header="Selected Experiment">
<Section header='Selected Experiment'>
<Selected />
</Section>
<Section header="Activity Heatmap">
<Section header='Activity Heatmap'>
<Activities />
</Section>
<Section header="Sample Groups">
<Section header='Sample Groups'>
<Group />
</Section>
<Section header="Volcano Plot">
<Section header='Volcano Plot'>
<Volcano />
</Section>
</Main>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/experiments/search/single-table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let Table = ({ results, highlightedIndex, select }) => (
icon={row.selected ? <RadioedIcon /> : <UnradioedIcon />}
button
onClick={() => select({ accession: row.accession })}
aria-label="Select this experiment"
aria-label='Select this experiment'
/>
),
width: '30px',
Expand Down
3 changes: 1 addition & 2 deletions src/pages/experiments/search/single/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ const mapStateToProps = (state) => ({
results: state.experiments.searches[0] ?
isArray(state.experiments.searches[0].results) ?
state.experiments.searches[0].results.map((result) =>
mapExperimentResult(result, state)
) :
mapExperimentResult(result, state)) :
state.experiments.searches[0].results :
''
});
Expand Down
2 changes: 1 addition & 1 deletion src/pages/experiments/selected/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import './index.css';

let Selected = ({ anySelected }) => (
<>
{anySelected === false && <Alert text="No experiment selected" />}
{anySelected === false && <Alert text='No experiment selected' />}
{anySelected === true && <Details />}
</>
);
Expand Down
Loading