Skip to content

Commit 0c5fff6

Browse files
committed
fix: code lint fixes
Signed-off-by: M-DEV-1 <[email protected]>
1 parent 8246c87 commit 0c5fff6

File tree

10 files changed

+188
-190
lines changed

10 files changed

+188
-190
lines changed

site/.eslintrc.js

Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,98 +1,98 @@
11
module.exports = {
22

3-
"env": {
4-
"browser": true,
5-
"es6": true,
6-
"node": true,
7-
"amd": true
3+
"env": {
4+
"browser": true,
5+
"es6": true,
6+
"node": true,
7+
"amd": true
8+
},
9+
"settings": {
10+
"react": {
11+
"version": "detect"
12+
}
13+
},
14+
"extends": [
15+
"eslint:recommended",
16+
"plugin:react/recommended"
17+
],
18+
"parser": "@babel/eslint-parser",
19+
"parserOptions": {
20+
"ecmaFeatures": {
21+
"jsx": true
822
},
9-
"settings": {
10-
"react": {
11-
"version": "detect"
23+
"ecmaVersion": 2018,
24+
"sourceType": "module"
25+
},
26+
"plugins": [
27+
"react"
28+
],
29+
"rules": {
30+
"array-bracket-spacing": ["error", "never"],
31+
"comma-style": ["error"],
32+
"arrow-spacing": [
33+
"error",
34+
{
35+
"after": true,
36+
"before": true
1237
}
13-
},
14-
"extends": [
15-
"eslint:recommended",
16-
"plugin:react/recommended"
1738
],
18-
"parser": "@babel/eslint-parser",
19-
"parserOptions": {
20-
"ecmaFeatures": {
21-
"jsx": true
22-
},
23-
"ecmaVersion": 2018,
24-
"sourceType": "module"
25-
},
26-
"plugins": [
27-
"react"
39+
"block-scoped-var": "error",
40+
"block-spacing": "error",
41+
"brace-style": [
42+
"error",
43+
"1tbs"
2844
],
29-
"rules": {
30-
"array-bracket-spacing": ["error", "never"],
31-
"comma-style": ["error"],
32-
"arrow-spacing": [
33-
"error",
34-
{
35-
"after": true,
36-
"before": true
37-
}
38-
],
39-
"block-scoped-var": "error",
40-
"block-spacing": "error",
41-
"brace-style": [
42-
"error",
43-
"1tbs"
44-
],
45-
"jsx-quotes": ["error", "prefer-double"],
46-
"keyword-spacing": "error",
47-
"key-spacing": ["error", {
48-
"beforeColon": false,
49-
"afterColon": true,
50-
}],
51-
"no-unused-vars": [
52-
"warn",
53-
{
54-
"varsIgnorePattern": "React"
55-
}
56-
],
57-
"no-trailing-spaces": "error",
58-
"object-curly-spacing": ["error", "always"],
59-
"react/display-name": 0,
60-
"react/prop-types": 0,
61-
"react/no-unescaped-entities": [0],
62-
"react/jsx-no-duplicate-props": [0],
63-
"indent": [
64-
"error", 2, {
65-
"FunctionExpression": { "parameters": "first" },
66-
"FunctionDeclaration": { "parameters": "first" },
67-
"MemberExpression": 1,
68-
"SwitchCase": 1,
69-
"outerIIFEBody": 0,
70-
"VariableDeclarator": { "var": 2, "let": 2, "const": 3 },
71-
ignoredNodes: ["TemplateLiteral"]
72-
}
73-
],
74-
"linebreak-style": [
75-
"error",
76-
"unix"
77-
],
78-
"quotes": [
79-
"error",
80-
"double"
81-
],
82-
"semi": [
83-
"error",
84-
"always"
85-
],
86-
"strict": 0,
87-
"valid-typeof": 0,
88-
"space-unary-ops": [
89-
1, {
90-
"words": true,
91-
"nonwords": false
92-
}
93-
],
94-
"space-infix-ops": [
95-
"error"
96-
]
97-
}
98-
};
45+
"jsx-quotes": ["error", "prefer-double"],
46+
"keyword-spacing": "error",
47+
"key-spacing": ["error", {
48+
"beforeColon": false,
49+
"afterColon": true,
50+
}],
51+
"no-unused-vars": [
52+
"warn",
53+
{
54+
"varsIgnorePattern": "React"
55+
}
56+
],
57+
"no-trailing-spaces": "error",
58+
"object-curly-spacing": ["error", "always"],
59+
"react/display-name": 0,
60+
"react/prop-types": 0,
61+
"react/no-unescaped-entities": [0],
62+
"react/jsx-no-duplicate-props": [0],
63+
"indent": [
64+
"error", 2, {
65+
"FunctionExpression": { "parameters": "first" },
66+
"FunctionDeclaration": { "parameters": "first" },
67+
"MemberExpression": 1,
68+
"SwitchCase": 1,
69+
"outerIIFEBody": 0,
70+
"VariableDeclarator": { "var": 2, "let": 2, "const": 3 },
71+
ignoredNodes: ["TemplateLiteral"]
72+
}
73+
],
74+
"linebreak-style": [
75+
"error",
76+
"unix"
77+
],
78+
"quotes": [
79+
"error",
80+
"double"
81+
],
82+
"semi": [
83+
"error",
84+
"always"
85+
],
86+
"strict": 0,
87+
"valid-typeof": 0,
88+
"space-unary-ops": [
89+
1, {
90+
"words": true,
91+
"nonwords": false
92+
}
93+
],
94+
"space-infix-ops": [
95+
"error"
96+
]
97+
}
98+
};

site/gatsby-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
*/
44
module.exports = {
55
siteMetadata: {
6-
title: `Meshery Shape Builder`,
7-
siteUrl: `https://shapes.meshery.io`
6+
title: "Meshery Shape Builder",
7+
siteUrl: "https://shapes.meshery.io"
88
},
99
plugins: ["gatsby-plugin-styled-components"]
1010
};

site/gatsby-node.js

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
exports.onCreateWebpackConfig = ({ actions, getConfig }) => {
2-
const config = getConfig();
3-
4-
// fallbacks for node core modules
5-
config.resolve.fallback = {
6-
...config.resolve.fallback,
7-
path: require.resolve("path-browserify"),
8-
process: require.resolve("process/browser"),
9-
url: require.resolve("url/"),
10-
};
11-
12-
actions.replaceWebpackConfig(config);
2+
const config = getConfig();
3+
4+
// fallbacks for node core modules
5+
config.resolve.fallback = {
6+
...config.resolve.fallback,
7+
path: require.resolve("path-browserify"),
8+
process: require.resolve("process/browser"),
9+
url: require.resolve("url/"),
1310
};
14-
11+
12+
actions.replaceWebpackConfig(config);
13+
};

site/src/components/Navigation/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function Navigation({ theme, toggleTheme, showSignUpButton }) {
3232
}
3333
useEffect(() => {
3434
window.addEventListener("scroll", () =>
35-
setScroll((window.scrollY || window.pageYOffset) > 50)
35+
setScroll((window.scrollY || window.pageYOffset) > 50)
3636
);
3737
}, []);
3838

site/src/components/ShapeBuilder/index.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import React, { useEffect, useRef, useState } from "react";
33
import { Wrapper, CanvasContainer, OutputBox, StyledSVG } from "./shapeBuilder.styles";
44
import { Button, Typography, Box } from "@layer5/sistent";
5-
import { SVG, extend as SVGextend } from '@svgdotjs/svg.js';
6-
import draw from '@svgdotjs/svg.draw.js';
5+
import { SVG, extend as SVGextend } from "@svgdotjs/svg.js";
6+
import draw from "@svgdotjs/svg.draw.js";
77

88
SVGextend(SVG.Polygon, draw);
99

@@ -75,7 +75,7 @@ const ShapeBuilder = () => {
7575
if (e.ctrlKey && e.key.toLowerCase() === "z") {
7676
const points = getPlottedPoints(poly);
7777
if (!points) return;
78-
poly.plot(points.slice(0, -1));
78+
poly.plot(points.slice(0, -1));
7979
}
8080
};
8181

@@ -169,21 +169,21 @@ const ShapeBuilder = () => {
169169
</StyledSVG>
170170
{error && (
171171
<div style={{
172-
position: 'absolute',
173-
top: '50%',
174-
left: '50%',
175-
transform: 'translate(-50%, -50%)',
176-
color: 'red',
177-
backgroundColor: 'white',
178-
padding: '10px',
179-
borderRadius: '5px'
172+
position: "absolute",
173+
top: "50%",
174+
left: "50%",
175+
transform: "translate(-50%, -50%)",
176+
color: "red",
177+
backgroundColor: "white",
178+
padding: "10px",
179+
borderRadius: "5px"
180180
}}>
181181
{error}
182182
</div>
183183
)}
184184
</CanvasContainer>
185185

186-
<Box sx={{ display: 'flex', justifyContent: 'center', gap: 2, mt: 3, mb: 3, flexWrap: 'wrap' }}>
186+
<Box sx={{ display: "flex", justifyContent: "center", gap: 2, mt: 3, mb: 3, flexWrap: "wrap" }}>
187187
<Button variant="contained" onClick={clearShape}>Clear</Button>
188188
<Button variant="contained" onClick={closeShape}>Close Shape</Button>
189189
<Button variant="contained" onClick={handleMaximize}>Maximize</Button>

site/src/components/Toggle.js

Lines changed: 49 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,52 @@
11
import React from "react";
22

33
const toggleStyle = {
4-
transition: "all .5s ease 0s",
5-
cursor: "pointer",
6-
};
7-
8-
export const Toggle = ({ theme, toggleTheme, height, width }) => {
9-
return (
10-
<div className="themeToggle" onClick={toggleTheme} style={toggleStyle}>
11-
{theme === "dark" ? (
12-
<svg
13-
xmlns="http://www.w3.org/2000/svg"
14-
width="24px"
15-
height="24px"
16-
viewBox="0 0 24 24"
17-
fill="rgb(0,179,159)"
18-
stroke="none"
19-
strokeWidth="2"
20-
strokeLinecap="round"
21-
strokeLinejoin="round"
22-
className="feather feather-moon"
23-
>
24-
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
25-
</svg>
26-
) : (
27-
<svg
28-
xmlns="http://www.w3.org/2000/svg"
29-
width="24px"
30-
height="24px"
31-
viewBox="0 0 24 24"
32-
fill="rgb(60, 73, 79)"
33-
stroke="rgb(60, 73, 79)"
34-
strokeWidth="2"
35-
strokeLinecap="round"
36-
strokeLinejoin="round"
37-
className="feather feather-sun"
38-
>
39-
<circle cx="12" cy="12" r="5"></circle>
40-
<line x1="12" y1="1" x2="12" y2="3"></line>
41-
<line x1="12" y1="21" x2="12" y2="23"></line>
42-
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
43-
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
44-
<line x1="1" y1="12" x2="3" y2="12"></line>
45-
<line x1="21" y1="12" x2="23" y2="12"></line>
46-
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
47-
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
48-
</svg>
49-
)}
50-
</div>
51-
);
52-
};
53-
4+
transition: "all .5s ease 0s",
5+
cursor: "pointer",
6+
};
7+
8+
export const Toggle = ({ theme, toggleTheme, height, width }) => {
9+
return (
10+
<div className="themeToggle" onClick={toggleTheme} style={toggleStyle}>
11+
{theme === "dark" ? (
12+
<svg
13+
xmlns="http://www.w3.org/2000/svg"
14+
width="24px"
15+
height="24px"
16+
viewBox="0 0 24 24"
17+
fill="rgb(0,179,159)"
18+
stroke="none"
19+
strokeWidth="2"
20+
strokeLinecap="round"
21+
strokeLinejoin="round"
22+
className="feather feather-moon"
23+
>
24+
<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path>
25+
</svg>
26+
) : (
27+
<svg
28+
xmlns="http://www.w3.org/2000/svg"
29+
width="24px"
30+
height="24px"
31+
viewBox="0 0 24 24"
32+
fill="rgb(60, 73, 79)"
33+
stroke="rgb(60, 73, 79)"
34+
strokeWidth="2"
35+
strokeLinecap="round"
36+
strokeLinejoin="round"
37+
className="feather feather-sun"
38+
>
39+
<circle cx="12" cy="12" r="5"></circle>
40+
<line x1="12" y1="1" x2="12" y2="3"></line>
41+
<line x1="12" y1="21" x2="12" y2="23"></line>
42+
<line x1="4.22" y1="4.22" x2="5.64" y2="5.64"></line>
43+
<line x1="18.36" y1="18.36" x2="19.78" y2="19.78"></line>
44+
<line x1="1" y1="12" x2="3" y2="12"></line>
45+
<line x1="21" y1="12" x2="23" y2="12"></line>
46+
<line x1="4.22" y1="19.78" x2="5.64" y2="18.36"></line>
47+
<line x1="18.36" y1="5.64" x2="19.78" y2="4.22"></line>
48+
</svg>
49+
)}
50+
</div>
51+
);
52+
};

0 commit comments

Comments
 (0)