Skip to content

Commit 92c60b2

Browse files
committed
update prettier rules
1 parent c59cbb0 commit 92c60b2

File tree

13 files changed

+399
-399
lines changed

13 files changed

+399
-399
lines changed
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import analyst from '../index';
1+
import analyst from "../index";
22

3-
test('it loads', () => {
4-
expect(analyst.name).toBe('analyst');
3+
test("it loads", () => {
4+
expect(analyst.name).toBe("analyst");
55
});

packages/analyst/src/components/AnalystDownload.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React, { useState } from 'react';
2-
import Menu from '@material-ui/core/Menu';
3-
import MenuItem from '@material-ui/core/MenuItem';
4-
import { useComponents } from '@wq/react';
5-
import PropTypes from 'prop-types';
1+
import React, { useState } from "react";
2+
import Menu from "@material-ui/core/Menu";
3+
import MenuItem from "@material-ui/core/MenuItem";
4+
import { useComponents } from "@wq/react";
5+
import PropTypes from "prop-types";
66

77
export default function AnalystDownload({ url, title, formats }) {
88
const [anchorEl, setAnchorEl] = useState(null),
99
{ Button, HorizontalView, Typography, View } = useComponents(),
10-
menuId = 'analyst-download',
11-
baseUrl = url.replace(/\.[^.]+$/, '');
10+
menuId = "analyst-download",
11+
baseUrl = url.replace(/\.[^.]+$/, "");
1212
return (
1313
<>
1414
<HorizontalView>

packages/analyst/src/components/AnalystTable.js

+34-34
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import React, { useEffect, useState, useMemo } from 'react';
2-
import Badge from '@material-ui/core/Badge';
3-
import Menu from '@material-ui/core/Menu';
4-
import MenuItem from '@material-ui/core/MenuItem';
5-
import { get as getPandasCsv } from '@wq/pandas';
6-
import { useComponents, useNav, useApp } from '@wq/react';
7-
import PropTypes from 'prop-types';
1+
import React, { useEffect, useState, useMemo } from "react";
2+
import Badge from "@material-ui/core/Badge";
3+
import Menu from "@material-ui/core/Menu";
4+
import MenuItem from "@material-ui/core/MenuItem";
5+
import { get as getPandasCsv } from "@wq/pandas";
6+
import { useComponents, useNav, useApp } from "@wq/react";
7+
import PropTypes from "prop-types";
88

99
export default function AnalystTable({
1010
data: initialData,
@@ -19,7 +19,7 @@ export default function AnalystTable({
1919
[columns, setColumns] = useState(),
2020
[filters, setFilters] = useState({}),
2121
[orders, setOrders] = useState(initial_order || {}),
22-
pagination = initial_rows !== 'all',
22+
pagination = initial_rows !== "all",
2323
[rowsPerPage, setRowsPerPage] = useState(
2424
pagination ? initial_rows || 50 : null
2525
),
@@ -82,7 +82,7 @@ export default function AnalystTable({
8282
return;
8383
}
8484
Object.entries(dataset).forEach(([key, value]) => {
85-
if (key === 'data') {
85+
if (key === "data") {
8686
return;
8787
}
8888
if (!metaKeys[key]) {
@@ -149,11 +149,11 @@ export default function AnalystTable({
149149
let nextOrders = { ...orders };
150150
if (!orders[name]) {
151151
nextOrders = {
152-
[name]: 'asc',
152+
[name]: "asc",
153153
...nextOrders,
154154
};
155-
} else if (orders[name] === 'asc') {
156-
nextOrders[name] = 'desc';
155+
} else if (orders[name] === "asc") {
156+
nextOrders[name] = "desc";
157157
} else {
158158
delete nextOrders[name];
159159
}
@@ -201,18 +201,18 @@ export default function AnalystTable({
201201
<TableTitle key={column.name}>
202202
<div
203203
style={{
204-
display: 'flex',
205-
alignItems: 'center',
204+
display: "flex",
205+
alignItems: "center",
206206
marginLeft: -8,
207-
borderLeft: '2px solid #ccc',
207+
borderLeft: "2px solid #ccc",
208208
paddingLeft: 8,
209209
marginRight: -16,
210210
}}
211211
>
212212
<span
213213
style={{
214214
flex: 1,
215-
fontWeight: 'bold',
215+
fontWeight: "bold",
216216
}}
217217
>
218218
{column.name}
@@ -226,13 +226,13 @@ export default function AnalystTable({
226226
<IconButton
227227
size="small"
228228
icon={
229-
orders[column.name] === 'desc'
230-
? 'sort-desc'
229+
orders[column.name] === "desc"
230+
? "sort-desc"
231231
: orders[column.name]
232-
? 'sort-asc'
233-
: 'sort-none'
232+
? "sort-asc"
233+
: "sort-none"
234234
}
235-
color={orders[column.name] && 'secondary'}
235+
color={orders[column.name] && "secondary"}
236236
onClick={() => toggleOrder(column.name)}
237237
/>
238238
</Badge>
@@ -256,7 +256,7 @@ export default function AnalystTable({
256256
return null;
257257
} else if (column.values) {
258258
return (
259-
<TableTitle style={{ cursor: 'pointer' }}>
259+
<TableTitle style={{ cursor: "pointer" }}>
260260
<ColumnFilter
261261
{...column}
262262
textButton
@@ -271,15 +271,15 @@ export default function AnalystTable({
271271
} else {
272272
return (
273273
<TableTitle
274-
style={{ cursor: 'pointer' }}
274+
style={{ cursor: "pointer" }}
275275
onClick={() => toggleOrder(column.name)}
276276
>
277-
<span style={{ fontWeight: 'bold' }}>{column.name}</span>
278-
{orders[column.name] === 'desc'
279-
? ' ↓'
277+
<span style={{ fontWeight: "bold" }}>{column.name}</span>
278+
{orders[column.name] === "desc"
279+
? " ↓"
280280
: orders[column.name]
281-
? ' ↑'
282-
: ''}
281+
? " ↑"
282+
: ""}
283283
</TableTitle>
284284
);
285285
}
@@ -301,7 +301,7 @@ export default function AnalystTable({
301301
const id = cell.row[id_column];
302302
return (
303303
<TableCell
304-
style={{ cursor: 'pointer' }}
304+
style={{ cursor: "pointer" }}
305305
onClick={() => nav(id)}
306306
>
307307
<CellValue {...cell} />
@@ -385,7 +385,7 @@ function ColumnFilter({
385385
onClick={(evt) => setAnchorEl(evt.target)}
386386
size="small"
387387
icon="filter"
388-
color={filter && 'secondary'}
388+
color={filter && "secondary"}
389389
title={name}
390390
/>
391391
<Menu
@@ -421,9 +421,9 @@ ColumnFilter.propTypes = {
421421

422422
function TextButton(props) {
423423
return (
424-
<span {...props} style={{ fontWeight: 'bold' }}>
424+
<span {...props} style={{ fontWeight: "bold" }}>
425425
{props.title}
426-
{props.color && ' *'}
426+
{props.color && " *"}
427427
</span>
428428
);
429429
}
@@ -475,8 +475,8 @@ function matchFilters(obj, filters) {
475475
return match;
476476
}
477477

478-
function sort(val1, val2, dir = 'asc') {
479-
if (dir == 'desc') {
478+
function sort(val1, val2, dir = "asc") {
479+
if (dir == "desc") {
480480
return sort(val2, val1);
481481
}
482482
if (val1 < val2) {
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import AnalystDownload from './AnalystDownload';
2-
import AnalystTable from './AnalystTable';
1+
import AnalystDownload from "./AnalystDownload";
2+
import AnalystTable from "./AnalystTable";
33

44
export { AnalystDownload, AnalystTable };

packages/analyst/src/icons.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import SortDesc from '@material-ui/icons/ArrowDownward';
2-
import SortAsc from '@material-ui/icons/ArrowUpward';
3-
import SortNone from '@material-ui/icons/SwapVert';
4-
import Filter from '@material-ui/icons/FilterList';
5-
import Download from '@material-ui/icons/SaveAlt';
6-
import View from '@material-ui/icons/Visibility';
1+
import SortDesc from "@material-ui/icons/ArrowDownward";
2+
import SortAsc from "@material-ui/icons/ArrowUpward";
3+
import SortNone from "@material-ui/icons/SwapVert";
4+
import Filter from "@material-ui/icons/FilterList";
5+
import Download from "@material-ui/icons/SaveAlt";
6+
import View from "@material-ui/icons/Visibility";
77

88
export { SortDesc, SortAsc, SortNone, Filter, Download, View };

packages/analyst/src/index.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import * as components from './components/index';
2-
import * as views from './views/index';
3-
import * as icons from './icons';
4-
import version from './version';
1+
import * as components from "./components/index";
2+
import * as views from "./views/index";
3+
import * as icons from "./icons";
4+
import version from "./version";
55

66
const analyst = {
7-
name: 'analyst',
7+
name: "analyst",
88
version,
99
components: { ...components },
1010
views: { ...views },
@@ -13,5 +13,5 @@ const analyst = {
1313

1414
export default analyst;
1515

16-
export * from './components/index';
17-
export * from './views/index';
16+
export * from "./components/index";
17+
export * from "./views/index";

packages/analyst/src/views/Analyst.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import React from 'react';
2-
import { useComponents, useRouteInfo } from '@wq/react';
1+
import React from "react";
2+
import { useComponents, useRouteInfo } from "@wq/react";
33

44
export default function Analyst() {
55
const {

packages/analyst/src/views/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import Analyst from './Analyst';
1+
import Analyst from "./Analyst";
22

33
export { Analyst };

packages/chart/src/__tests__/index.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
* @jest-environment jsdom
33
*/
44

5-
import chartapp from '../index';
6-
import mockFetch from 'jest-fetch-mock';
7-
import fs from 'fs';
5+
import chartapp from "../index";
6+
import mockFetch from "jest-fetch-mock";
7+
import fs from "fs";
88

99
beforeAll(() => {
1010
global.fetch = mockFetch;
1111
});
1212

13-
test('timeSeries chart', async () => {
14-
mockFetch.mockResponse(fs.readFileSync(__dirname + '/data.csv'));
13+
test("timeSeries chart", async () => {
14+
mockFetch.mockResponse(fs.readFileSync(__dirname + "/data.csv"));
1515
document.body.innerHTML = `<svg
1616
data-wq-url="data.csv"
1717
data-wq-type="timeSeries"
@@ -31,7 +31,7 @@ test('timeSeries chart', async () => {
3131
await new Promise((res) => setTimeout(res, 1000));
3232

3333
const byClass = (name) => svg.getElementsByClassName(name);
34-
expect(byClass('dataset')).toHaveLength(3);
35-
expect(byClass('axis')).toHaveLength(1);
36-
expect(byClass('data')).toHaveLength(9);
34+
expect(byClass("dataset")).toHaveLength(3);
35+
expect(byClass("axis")).toHaveLength(1);
36+
expect(byClass("data")).toHaveLength(9);
3737
});

0 commit comments

Comments
 (0)