Skip to content

Commit

Permalink
Merge pull request rahuldkjain#564 from rahuldkjain/hotfix/icons
Browse files Browse the repository at this point in the history
fix: linting errors
  • Loading branch information
rahuldkjain authored Jun 26, 2022
2 parents c919601 + 3461a5b commit c83a129
Show file tree
Hide file tree
Showing 25 changed files with 1,163 additions and 227 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
"plugins": ["react"],
"rules": {
"react/forbid-prop-types": 0
}
},
"ignorePatterns": ["**/*.test.js"]
}
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"singleQuote": true,
"jsxSingleQuote": false,
"tabWidth": 2,
"printWidth": 480,
"printWidth": 120,
"trailingComma": "all",
"semi": true,
"exclude": ["node_modules", "codepipeline"]
Expand Down
2 changes: 2 additions & 0 deletions CODE_STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@
## Spacing

1. **JS:**

- Use a space after `if`, `for`, `while`, `switch`.
- Do not use a space after the opening `(` and before the closing `)`.
- Use a space before and after destructuring objects.

```js
//good
const { apple, mangoes } = fruits;
Expand Down
4 changes: 3 additions & 1 deletion __mocks__/gatsby.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
/* eslint-disable no-undef */
const React = require('react');

const gatsby = jest.requireActual('gatsby');

module.exports = {
Expand All @@ -10,7 +12,7 @@ module.exports = {
React.createElement('a', {
...rest,
href: to,
})
}),
),
StaticQuery: jest.fn(),
useStaticQuery: jest.fn(),
Expand Down
40 changes: 20 additions & 20 deletions src/components/__tests__/addons.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ describe('Addons', () => {
social={socialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

expect(toJson(addOnComponent)).toMatchSnapshot();
Expand All @@ -113,7 +113,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#visitors-count-open-btn').simulate('click', {});
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#visitors-count-open-btn').simulate('click', {});
Expand Down Expand Up @@ -176,7 +176,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#visitors-count-open-btn').simulate('click', {});
Expand Down Expand Up @@ -205,7 +205,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#visitors-count-open-btn').simulate('click', {});
Expand Down Expand Up @@ -233,7 +233,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#github-stats-open-btn').simulate('click', {});
Expand Down Expand Up @@ -267,7 +267,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#github-stats-open-btn').simulate('click', {});
Expand Down Expand Up @@ -318,7 +318,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#github-stats-open-btn').simulate('click', {});
Expand Down Expand Up @@ -369,7 +369,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#github-stats-open-btn').simulate('click', {});
Expand Down Expand Up @@ -421,7 +421,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#github-stats-open-btn').simulate('click', {});
Expand Down Expand Up @@ -472,7 +472,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#github-stats-open-btn').simulate('click', {});
Expand Down Expand Up @@ -524,7 +524,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#github-stats-open-btn').simulate('click', {});
Expand Down Expand Up @@ -576,7 +576,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#github-stats-open-btn').simulate('click', {});
Expand Down Expand Up @@ -617,7 +617,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#top-languages-open-btn').simulate('click', {});
Expand Down Expand Up @@ -652,7 +652,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#top-languages-open-btn').simulate('click', {});
Expand Down Expand Up @@ -686,7 +686,7 @@ describe('Addons', () => {
social={socialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#visitors-count').simulate('change', mockEvent);
Expand Down Expand Up @@ -725,7 +725,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

const workflowElement = addOnComponent.find('.workflow');
Expand All @@ -748,7 +748,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

const workflowElement = addOnComponent.find('.workflow');
Expand All @@ -771,7 +771,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

const workflowElement = addOnComponent.find('.workflow');
Expand All @@ -797,7 +797,7 @@ describe('Addons', () => {
social={newSocialInput}
handleCheckChange={mockHandleCheckChange}
handleDataChange={mockHandleDataChange}
/>
/>,
);

addOnComponent.find('#blog-post-worklow-span').simulate('click', {});
Expand Down
1 change: 0 additions & 1 deletion src/components/__tests__/donate.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import toJson from 'enzyme-to-json';
import { shallow } from 'enzyme';

import Donate from '../donate';

describe('Donate', () => {
Expand Down
20 changes: 10 additions & 10 deletions src/components/__tests__/markdown.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ describe('Markdown', () => {
...props.data,
subtitle: '',
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand All @@ -102,7 +102,7 @@ describe('Markdown', () => {
...props.prefix,
title: '',
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand All @@ -115,7 +115,7 @@ describe('Markdown', () => {
...props.data,
topLanguages: true,
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand All @@ -129,7 +129,7 @@ describe('Markdown', () => {
topLanguages: true,
githubStats: true,
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand All @@ -142,7 +142,7 @@ describe('Markdown', () => {
...props.data,
devDynamicBlogs: true,
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand All @@ -155,7 +155,7 @@ describe('Markdown', () => {
...props.data,
currentWork: '',
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand All @@ -168,7 +168,7 @@ describe('Markdown', () => {
...props.data,
visitorsBadge: true,
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand All @@ -181,7 +181,7 @@ describe('Markdown', () => {
...props.data,
twitterBadge: true,
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand All @@ -194,7 +194,7 @@ describe('Markdown', () => {
...props.data,
githubProfileTrophy: true,
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand All @@ -207,7 +207,7 @@ describe('Markdown', () => {
...props.data,
githubProfileTrophy: true,
}}
/>
/>,
);
expect(toJson(component)).toMatchSnapshot();
});
Expand Down
12 changes: 6 additions & 6 deletions src/components/__tests__/markdownPreview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ describe('DisplaySocial Preview', () => {
base="https://codepen.io"
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codepen.svg"
username={social.codepen}
/>
/>,
);

expect(tree).toMatchSnapshot();
Expand All @@ -259,7 +259,7 @@ describe('DisplaySocial Preview', () => {
base="https://codepen.io"
icon="https://cdn.jsdelivr.net/npm/simple-icons@3.0.1/icons/codepen.svg"
username={''}
/>
/>,
);

expect(tree).toMatchSnapshot();
Expand All @@ -278,7 +278,7 @@ describe('VisitorsBadge Preview', () => {
badgeColor: data.badgeColor,
badgeStyle: data.badgeStyle,
}}
/>
/>,
);

expect(tree).toMatchSnapshot();
Expand All @@ -295,7 +295,7 @@ describe('VisitorsBadge Preview', () => {
badgeColor: data.badgeColor,
badgeStyle: data.badgeStyle,
}}
/>
/>,
);

expect(tree).toMatchSnapshot();
Expand Down Expand Up @@ -371,7 +371,7 @@ describe('TopLanguages Preview', () => {
let data = DEFAULT_DATA;
let social = DEFAULT_SOCIAL;
const tree = shallow(
<TopLanguagesPreview show={data.topLanguages} github={social.github} options={data.topLanguagesOptions} />
<TopLanguagesPreview show={data.topLanguages} github={social.github} options={data.topLanguagesOptions} />,
);

expect(tree).toMatchSnapshot();
Expand All @@ -389,7 +389,7 @@ describe('GitHubStats Preview', () => {
let data = DEFAULT_DATA;
let social = DEFAULT_SOCIAL;
const tree = shallow(
<GitHubStatsPreview show={data.githubStats} github={social.github} options={data.githubStatsOptions} />
<GitHubStatsPreview show={data.githubStats} github={social.github} options={data.githubStatsOptions} />,
);

expect(tree).toMatchSnapshot();
Expand Down
Loading

0 comments on commit c83a129

Please sign in to comment.