We welcome your help to make this component better. This document will help to streamline the contributing process and save everyone's precious time.
This component has been setup with React CDK and help us to focus on the component development.
- Your component is at
src/index.js
. Open it with an editor. - Start React Storybook with:
npm run storybook
(stories atsrc/stories/index
). - Watch for tests with:
npm run test-watch
(tests atsrc/tests
).
Source files on this project lives under src
directory and you can write your component using ES2015+. (with babel-preset-stage-2).
src/index.js
is the main entrypoint in this component and you should expose a React component class from that module(file).
React Storybook is configured with this component and you can use it to develop your component without a need of an app.
You can try different states of your components very easily. You can write React Storybook stories inside the src/stories/index.js
.
You can run npm run storybook
to start the React Storybook console.
To learn more about React Storybook, visit here.
This component is configured to use Mocha and Enzyme. It's also setup for JSDOM so, you can get the full use of enzyme.
You can write your test cases in src/tests
directory. There are few commands to run your tests, here are they:
npm run testonly
- Run all the testsnpm run test-watch
- Run all the tests and watch for changesnpm test
- Same asnpm run testonly
, but also do linting before testing.
This component uses ESLint for linting and uses a slightly modified version of AirBnb style guide (for JS and React).
Modified rules can be found at .eslintrc
file.
Use these commands to do the linting:
npm run lint
- Run eslintnpm run lintfix
- Run eslint with --fix flag
To learn about dev setup and configurations, visit the React CDK repo.