Skip to content

Commit

Permalink
Convert to Typescript, prettier, and tsdx build and eslint rules (#251)
Browse files Browse the repository at this point in the history
* Add prettier formatting and use tsdx eslint rules

* Convert to Typescript

* Update Travis config
  • Loading branch information
rkuykendall authored Apr 4, 2021
1 parent 7f028cf commit 3d1f7dc
Show file tree
Hide file tree
Showing 52 changed files with 7,390 additions and 3,805 deletions.
7 changes: 0 additions & 7 deletions .babelrc

This file was deleted.

14 changes: 4 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

[*.md]
trim_trailing_whitespace = false

[*.js]
trim_trailing_whitespace = true

# Unix-style newlines with a newline ending every file
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
2 changes: 0 additions & 2 deletions .eslintignore

This file was deleted.

128 changes: 0 additions & 128 deletions .eslintrc.js

This file was deleted.

7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.idea
node_modules
*.log
coverage
.DS_Store
lib/

.idea
yarn-error.log
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
CHANGELOG.md
coverage
22 changes: 16 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
language: node_js

node_js:
- "6"
install:
- npm install
script:
- npm run lint
- npm run test
- "node"
- "lts/*"

cache:
directories:
- "node_modules"

script: echo "Running tests against $(node -v)..." && yarn test

jobs:
include:
- stage: Build
script: yarn build
- stage: Lint
script: yarn lint
42 changes: 28 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ In the meantime, here are some alternatives:

# formsy-material-ui [![npm version](https://badge.fury.io/js/formsy-material-ui.svg)](https://badge.fury.io/js/formsy-material-ui) [![Build Status](https://travis-ci.org/mbrookes/formsy-material-ui.svg?branch=master)](https://travis-ci.org/mbrookes/formsy-material-ui)

This library is a wrapper for [Material-UI](http://material-ui.com/) form components to allow them to be used
with [formsy-react](https://github.com/christianalfoni/formsy-react), a form validation component for React forms.
This library is a wrapper for [Material-UI](http://material-ui.com/) form components to allow them to be used with
[formsy-react](https://github.com/christianalfoni/formsy-react), a form validation component for React forms.

## Installation

Expand Down Expand Up @@ -48,30 +48,42 @@ import FormsyAutoComplete from 'formsy-material-ui/lib/FormsyAutoComplete';
OR:

```js
import { FormsyCheckbox, FormsyDate, FormsyRadio, FormsyRadioGroup,
FormsySelect, FormsyText, FormsyTime, FormsyToggle, FormsyAutoComplete } from 'formsy-material-ui/lib';
import {
FormsyCheckbox,
FormsyDate,
FormsyRadio,
FormsyRadioGroup,
FormsySelect,
FormsyText,
FormsyTime,
FormsyToggle,
FormsyAutoComplete,
} from 'formsy-material-ui/lib';
```

### Events

Components allow for `onChange` event handlers in props. They are fired when the value of the
component changes, regardless of the underlying handler (eg, `FormsyToggle` uses `onToggle` internally, but we
still use `onChange` in props to hook into the event.)
Components allow for `onChange` event handlers in props. They are fired when the value of the component changes,
regardless of the underlying handler (eg, `FormsyToggle` uses `onToggle` internally, but we still use `onChange` in
props to hook into the event.)

The call back signatures for all `onChange` handlers conform to
Material-UI's proposed [Standardized Callback Signatures](https://github.com/callemall/material-ui/issues/2957).
The call back signatures for all `onChange` handlers conform to Material-UI's proposed
[Standardized Callback Signatures](https://github.com/callemall/material-ui/issues/2957).

An example usage of this would be to use an `onChange` for the FormsySelect and receive notifications when it changes.

### Examples

#### Example App

The `formsy-material-ui` repo contains a [sample webpack SPA](https://github.com/formsy/formsy-material-ui/tree/master/examples/webpack-example).
The `formsy-material-ui` repo contains a
[sample webpack SPA](https://github.com/formsy/formsy-material-ui/tree/master/examples/webpack-example).

#### Example Code

You can find an [example form](https://github.com/formsy/formsy-material-ui/blob/master/examples/webpack-example/src/app/Main.js#L80) in the example app directory.
You can find an
[example form](https://github.com/formsy/formsy-material-ui/blob/master/examples/webpack-example/src/app/Main.js#L80) in
the example app directory.

## Known Issues

Expand All @@ -83,12 +95,14 @@ See [CHANGELOG.md](https://github.com/formsy/formsy-material-ui/blob/master/CHAN

## Acknowledgements

Originally started by [Matt Brookes](https://github.com/mbrookes), later transfered to [Ryan Blakeley](@rojobuffalo) before joining the Formsy Organization.
Originally started by [Matt Brookes](https://github.com/mbrookes), later transfered to [Ryan Blakeley](@rojobuffalo)
before joining the Formsy Organization.

Thanks to our [contributors](https://github.com/formsy/formsy-material-ui/graphs/contributors).

## Alternatives

Here are some alternative solutions you might also wish to consider:
- [react-material-ui-form-validator](https://github.com/NewOldMax/react-material-ui-form-validator)
- Redux Form [Material-UI example](http://redux-form.com/6.1.1/examples/material-ui/)

- [react-material-ui-form-validator](https://github.com/NewOldMax/react-material-ui-form-validator)
- Redux Form [Material-UI example](http://redux-form.com/6.1.1/examples/material-ui/)
Loading

0 comments on commit 3d1f7dc

Please sign in to comment.