Skip to content

Commit

Permalink
Upgrade Prettier (#687)
Browse files Browse the repository at this point in the history
  • Loading branch information
danoc authored Jun 10, 2020
1 parent 2867381 commit 1ed8351
Show file tree
Hide file tree
Showing 12 changed files with 106 additions and 123 deletions.
1 change: 1 addition & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ tabWidth: 4
trailingComma: all
singleQuote: true
proseWrap: never
arrowParens: avoid
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
"folder-hash": "^3.0.0",
"fs-extra": "^8.1.0",
"gatsby-plugin-typescript": "^2.1.9",
"husky": "^3.0.5",
"husky": "^4.2.5",
"identity-obj-proxy": "^3.0.0",
"jest": "^24.0.0",
"lerna": "^2.2.0",
"node-sass": "^4.5.2",
"postinstall-postinstall": "^2.0.0",
"prettier": "1.18.2",
"pretty-quick": "^1.11.1",
"prettier": "2.0.5",
"pretty-quick": "^2.0.1",
"prop-types": "^15.7.2",
"react": "^16.8.6",
"react-dom": "^16.8.6",
Expand Down
5 changes: 1 addition & 4 deletions packages/gatsby-source-coda/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ exports.sourceNodes = async ({ actions }, { apiToken, docId, tableIdOrName, useC
children: [],
internal: {
type: `Coda${tableIdOrName}Table`,
contentDigest: crypto
.createHash('md5')
.update(jsonString)
.digest('hex'),
contentDigest: crypto.createHash('md5').update(jsonString).digest('hex'),
},
};

Expand Down
5 changes: 1 addition & 4 deletions packages/gatsby-transformer-thumbprint-atomic/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ const createCssNode = ({ node, actions }) => {
atomicClasses: parseAst(css),
children: [],
internal: {
contentDigest: crypto
.createHash('md5')
.update(css)
.digest('hex'),
contentDigest: crypto.createHash('md5').update(css).digest('hex'),
type: 'ThumbprintAtomicClasses',
},
};
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-transformer-thumbprint-atomic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
"lodash": "^4.17.10",
"node-sass": "^4.11.0",
"node-sass-tilde-importer": "2.0.0-alpha.1",
"prettier": "1.18.2"
"prettier": "2.0.5"
}
}
4 changes: 4 additions & 0 deletions packages/thumbprint-codemods/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Changed

- [Patch] Upgrade version of Prettier.

## 0.5.0 - 2020-01-09

### Added
Expand Down
7 changes: 1 addition & 6 deletions packages/thumbprint-codemods/lib/change-prop-values.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
/* eslint-disable no-console */
const usesSpreadProps = (instances, j) =>
instances.some(
node =>
j(node)
.find(j.JSXSpreadAttribute)
.size() > 0,
);
instances.some(node => j(node).find(j.JSXSpreadAttribute).size() > 0);

const usesExpressionAsPropValue = (instances, j, propName) =>
instances.some(
Expand Down
21 changes: 3 additions & 18 deletions packages/thumbprint-react/components/Avatar/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,23 +79,13 @@ test('renders a badge if valid badge prop is supplied', (): void => {

test('renders an SVG when `isChecked` is true', (): void => {
const wrapper = mount(<UserAvatar size="medium" isChecked initials="DK" />);
expect(
wrapper
.find('.badge')
.find('svg')
.exists(),
).toBe(true);
expect(wrapper.find('.badge').find('svg').exists()).toBe(true);
expect(wrapper).toMatchSnapshot();
});

test('renders an SVG when `isChecked` is true', (): void => {
const wrapper = mount(<UserAvatar size="medium" isChecked initials="DK" />);
expect(
wrapper
.find('.badge')
.find('svg')
.exists(),
).toBe(true);
expect(wrapper.find('.badge').find('svg').exists()).toBe(true);
expect(wrapper).toMatchSnapshot();
});

Expand All @@ -108,12 +98,7 @@ test('renders `isOnline` when `isOnline` is true', (): void => {
test('renders checkmark SVG when `isChecked` and `isOnline` are true', (): void => {
const wrapper = mount(<UserAvatar isChecked isOnline />);
expect(wrapper.find('.badge').exists()).toBe(true);
expect(
wrapper
.find('.badge')
.find('svg')
.exists(),
).toBe(true);
expect(wrapper.find('.badge').find('svg').exists()).toBe(true);
expect(wrapper).toMatchSnapshot();
});

Expand Down
2 changes: 1 addition & 1 deletion packages/thumbprint-react/components/ServiceCard/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jest.mock(
);

beforeEach((): void => {
window.IntersectionObserver = (true as unknown) as (typeof window.IntersectionObserver);
window.IntersectionObserver = (true as unknown) as typeof window.IntersectionObserver;
});

describe('ServiceCard', () => {
Expand Down
5 changes: 1 addition & 4 deletions packages/thumbprint-react/components/StarRating/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,7 @@ test('does not throw an error when clicking on a star when `onStarClick` is not
test('calls `onStarClick` function when supplied', () => {
const onStarClick = jest.fn();
const wrapper = mount(<StarRating rating={0} onStarClick={onStarClick} />);
wrapper
.find('input')
.first()
.simulate('click');
wrapper.find('input').first().simulate('click');
expect(onStarClick).toHaveBeenCalledTimes(1);
});

Expand Down
6 changes: 3 additions & 3 deletions www/src/components/mdx/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ const FeedbackForm = ({ page }: { page: string }): JSX.Element => {
e.preventDefault();

const form = e.target as HTMLFormElement;
const data = new URLSearchParams((new FormData(
form,
) as unknown) as string).toString();
const data = new URLSearchParams(
(new FormData(form) as unknown) as string,
).toString();

fetch(form.action, {
method: 'POST',
Expand Down
Loading

0 comments on commit 1ed8351

Please sign in to comment.