Skip to content

Commit 6aad57d

Browse files
committed
Add prettier to CI
1 parent 7d83b45 commit 6aad57d

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ jobs:
77
include:
88
- stage: test
99
script: npm run-s test:lint
10+
- script: npm run-s test:prettier
1011
- script: npm run-s test:flow
1112

1213
- script: npm run-s test:unit

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ Library definitions for [Flow type annotations](https://flow.org/en/docs/types/)
2020

2121
The `src` directory also contains testing files written for the [jest](https://jestjs.io/en/) test harness. The tests use [Enzyme](https://github.com/enzymejs/enzyme) for component and DOM manipulation and traversal. These tests are run in the CI/CD pipeline, and must pass before a branch can be merged into the 'main' branch. Changes may be needed to the test harness to accommodate new features or fixes.
2222

23+
The CI/CD pipeline also runs `prettier`, `eslint`, and `flow` checks which must pass before a branch can be merged into 'main'. You can run `npm run prettier` to auto-format code to pass `prettier` standards, and `npm test` to run all of these tests to ensure that they will pass in the CI/CD pipeline.
24+
2325
Test coverage is [tracked in coveralls.io](https://coveralls.io/github/ginkgobioworks/react-json-schema-form-builder) to make sure that test coverage is maintained or increased as time goes on.
2426

2527
## Documentation

example/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"build": "node ../node_modules/react-scripts/bin/react-scripts.js build",
99
"test": "node ../node_modules/react-scripts/bin/react-scripts.js test",
1010
"eject": "node ../node_modules/react-scripts/bin/react-scripts.js eject",
11+
"prettier": "prettier -w src",
12+
"prettier:check": "prettier -c src",
1113
"flow": "flow",
1214
"lint": "eslint .",
1315
"clean": "rimraf node_modules build"

example/src/JsonSchemaFormSuite.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ import {
1010
} from 'reactstrap';
1111
import { withTheme } from '@rjsf/core';
1212
import { Theme as Bootstrap4Theme } from '@rjsf/bootstrap-4';
13-
import { FormBuilder, PredefinedGallery } from '@ginkgo-bioworks/react-json-schema-form-builder';
13+
import {
14+
FormBuilder,
15+
PredefinedGallery,
16+
} from '@ginkgo-bioworks/react-json-schema-form-builder';
1417
import Tabs from './tabs/Tabs';
1518
import JSONInput from 'react-json-editor-ajrm';
1619
import locale from 'react-json-editor-ajrm/locale/en';

example/src/PlaygroundContainer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default function PlaygroundContainer({ title }: { title: string }) {
2323
const [uischema, setUischema] = React.useState('{}');
2424
const classes = useStyles();
2525
return (
26-
<div className="playground">
26+
<div className='playground'>
2727
<div className={classes.header}>
2828
<h1>{title}</h1>
2929
<p>

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,13 @@
2525
"clean": "rimraf node_modules coverage dist",
2626
"build": "microbundle-crl --no-compress --format modern,cjs",
2727
"start": "microbundle-crl watch --no-compress --format modern,cjs",
28+
"prettier": "prettier -w src && prettier -w example/src",
2829
"flow": "flow",
2930
"flow:install-types": "flow-typed install",
30-
"test": "run-s test:unit test:lint test:flow",
31+
"test": "run-s test:unit test:prettier test:lint test:flow",
3132
"test:flow": "flow",
3233
"test:lint": "eslint .",
34+
"test:prettier": "prettier -c src && prettier -c example/src",
3335
"test:unit": "cross-env CI=1 react-scripts test --env=jsdom --coverage --coverageDirectory=coverage/",
3436
"test:watch": "react-scripts test --env=jsdom"
3537
},

0 commit comments

Comments
 (0)