Skip to content

Commit 615764d

Browse files
committed
[core,storybook] Remove some and prevent it with an eslint config
1 parent a90c684 commit 615764d

File tree

8 files changed

+16
-5
lines changed

8 files changed

+16
-5
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## Version 5.0.2
4+
5+
### Fixes
6+
7+
- Remove some `console.log` and prevent it with an eslint config
8+
9+
## Version 5.0.1
10+
11+
Due to some issues with lerna when releasing the v5.0.0, I did this version.
12+
313
## Version 5.0.0
414

515
### Breaking changes

eslint.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export default tseslint.config(
2020
...reactHooks.configs.recommended.rules,
2121
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_" }],
2222
"react/react-in-jsx-scope": "off",
23+
"no-console": ["error", { allow: ["warn", "error"] }]
2324
},
2425
},
2526
);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"lerna:changed": "lerna changed",
2727
"lerna:diff": "lerna diff",
2828
"lerna:ls": "lerna ls",
29-
"lerna:publish": "lerna publish --no-private from-package",
29+
"lerna:publish": "npm run clean && npm run build && lerna publish --no-private from-package",
3030
"lerna:version": "lerna version",
3131
"lint": "eslint",
3232
"start": "lerna run start --parallel",

packages/core/src/components/SigmaContainer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ const SigmaContainerComponent = <
9797
if (graph) {
9898
sigGraph = typeof graph === 'function' ? new graph() : graph;
9999
}
100-
console.log('new sigma instance', sigmaSettings);
101100
let prevCameraState: CameraState | null = null;
102101
if (prev) {
103102
prevCameraState = prev.getCamera().getState();

packages/core/src/hooks/useCamera.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function useCamera(options?: CameraOptions): {
6565
(nodeKey: string, options?: Partial<AnimateOptions>) => {
6666
const nodeDisplayData = sigma.getNodeDisplayData(nodeKey);
6767
if (nodeDisplayData) sigma.getCamera().animate(nodeDisplayData, { ...defaultOptions, ...options });
68-
else console.log(`Node ${nodeKey} not found`);
68+
else console.warn(`Node ${nodeKey} not found`);
6969
},
7070
[sigma, defaultOptions],
7171
);

packages/storybook/stories/Events.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ const sigmaSettings = { allowInvalidContainer: true };
1111
const GraphEvents: React.FC = () => {
1212
const registerEvents = useRegisterEvents();
1313

14+
/* eslint-disable no-console */
1415
useEffect(() => {
15-
console.log('register events');
1616
// Register the events
1717
registerEvents({
1818
// node events
@@ -58,6 +58,7 @@ const GraphEvents: React.FC = () => {
5858
updated: (event) => console.log('updated', event.x, event.y, event.angle, event.ratio),
5959
});
6060
}, [registerEvents]);
61+
/* eslint-enable no-console */
6162

6263
return null;
6364
};

packages/storybook/stories/GraphSearch.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export const GraphSearchDemo: FC<{ style?: CSSProperties }> = ({ style }) => {
3030
const [focusNode, setFocusNode] = useState<string | null>(null);
3131

3232
const onFocus = useCallback((value: GraphSearchOption | null) => {
33-
console.log('onfocus', value);
3433
if (value === null) setFocusNode(null);
3534
else if (value.type === 'nodes') setFocusNode(value.id);
3635
}, []);

packages/storybook/stories/LayoutCircular.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const RandomCircleGraph: FC = () => {
3939
// Apply the layout
4040
assign();
4141
// Display in the console the node's position for the layout
42+
// eslint-disable-next-line no-console
4243
console.log(positions());
4344
}, [assign, loadGraph, faker.datatype, faker, randomColor, positions]);
4445

0 commit comments

Comments
 (0)