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

linting (WIP - not ready for review) #28

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ dist
**/dist/*
coverage
packages/components/loader/*

components.d.ts
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
"build": "lerna run build --stream",
"clean": "lerna run clean --concurrency 4",
"lint": "npm-run-all -p lint:prettier lint:eslint",
"lint:prettier": "prettier --check packages/**/*.{ts,tsx,js,json}",
"lint:eslint": "eslint --ext .js,.ts,.tsx .",
"lint:prettier": "prettier --check \"packages/**/*.{ts,tsx,js,json}\"",
"lint:eslint": "eslint --ext .js,.ts,.tsx . --max-warnings 0",
"fix": "npm-run-all -p fix:prettier fix:eslint",
"fix:eslint": "eslint --fix --ext .js,.ts,.tsx .",
"fix:prettier": "prettier --write packages/**/*.{ts,tsx,js,json}",
"test": "npm-run-all -p test:unit",
"fix:prettier": "prettier --write \"packages/**/*.{ts,tsx,js,json}\"",
"test": "npm-run-all -p test:unit lint",
"test:unit": "lerna run test --stream --concurrency 1",
"pack": "lerna run pack"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export class TestingGround {
<iot-line-chart
appKit={this.dataModule}
query={AGGREGATED_DATA_QUERY}
viewport={VIEWPORT}
viewport={this.viewport}
settings={{ resolution: this.resolution }}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/core/configuration/jest/overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
let error = console.error;

// Fail tests on console.error
console.error = function (message) {
console.error = function(message) {
error.apply(console, arguments); // keep default behaviour
throw message instanceof Error ? message : new Error(message);
};
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
ViewPort,
} from '@synchro-charts/core';
import { DAY_IN_MS } from '../../common/time';
import {toDataStreamId} from "../../data-sources/site-wise/util/dataStreamId";
import { toDataStreamId } from '../../data-sources/site-wise/util/dataStreamId';

const VIEW_PORT: ViewPort = {
start: new Date(2000, 0, 0, 0),
Expand Down
2 changes: 1 addition & 1 deletion packages/related-table/stories/AsyncData.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const AsyncData: Story = () => {
const [allItems, setAllItems] = useState<any[]>([]);

useEffect(() => {
genDataAsync().then((data) => setAllItems(data));
genDataAsync().then(data => setAllItems(data));
}, []);

const columnDefinitions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,9 +240,9 @@ export const FilteringAndSorting: Story = () => {

const { selectedItems } = collectionProps;

const expandAll = (item) => {
const expandAll = item => {
expandNode(item);
item.getChildren().forEach((child) => expandAll(child));
item.getChildren().forEach(child => expandAll(child));
};

return (
Expand All @@ -254,7 +254,7 @@ export const FilteringAndSorting: Story = () => {
selectionType="single"
columnDefinitions={columnDefinitions}
onSelectionChange={() => {
items.forEach((item) => {
items.forEach(item => {
expandAll(item);
});
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,17 @@ function RichCellContent(title: string) {
{
id: 'variable',
header: 'Variable name',
cell: (item) => item.name || '-',
cell: item => item.name || '-',
},
{
id: 'alt',
header: 'Text value',
cell: (item) => item.alt || '-',
cell: item => item.alt || '-',
},
{
id: 'description',
header: 'Description',
cell: (item) => item.description || '-',
cell: item => item.description || '-',
},
]}
items={items}
Expand Down
4 changes: 2 additions & 2 deletions packages/related-table/stories/UpdateAndDelete.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ export const UpdateAndDelete: Story = () => {
iconName="close"
onClick={() => {
const updatedItems: any[] = [];
allItems.forEach((item) => {
if (!selectedItems?.some((selected) => selected.id === item.id)) {
allItems.forEach(item => {
if (!selectedItems?.some(selected => selected.id === item.id)) {
updatedItems.push(item);
}
});
Expand Down
6 changes: 2 additions & 4 deletions packages/related-table/stories/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"extends": "../tsconfig.json",
"include": [
"**/*.stories.*"
]
}
"include": ["**/*.stories.*"]
}