Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

Commit b43391c

Browse files
committed
chore: Fix prettier integration
Prettier recommended settings were overriding some of AirBnB style guide rules. Removed prettier recommended rules.
1 parent 34d74ca commit b43391c

22 files changed

Lines changed: 319 additions & 295 deletions

.eslintrc.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ module.exports = {
2424
extends: [
2525
'airbnb',
2626
'plugin:@typescript-eslint/recommended',
27-
'plugin:prettier/recommended',
2827
'prettier/@typescript-eslint',
2928
],
3029
rules: {

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ yarn add @rocketseat/unform
7676
Unform exposes two default form elements: `<Input />` and `<Select />`. Currently, `<Select />` element does not support multiple values, you can use [React Select](#react-select) example to achieve that.
7777

7878
```js
79-
import React from "react";
80-
import { Form, Input } from "@rocketseat/unform";
79+
import React from 'react';
80+
import { Form, Input } from '@rocketseat/unform';
8181

8282
function App() {
8383
function handleSubmit(data) {
@@ -86,7 +86,7 @@ function App() {
8686
/**
8787
* {
8888
* email: 'email@example.com',
89-
* password: "123456"
89+
* password: '123456'
9090
* }
9191
*/
9292
};
@@ -111,8 +111,8 @@ Unform exposes two elements by default, Input and Select.
111111
Input elements can receive a `multiline` prop that will render a textarea instead.
112112

113113
```js
114-
import React from "react";
115-
import { Form, Input } from "@rocketseat/unform";
114+
import React from 'react';
115+
import { Form, Input } from '@rocketseat/unform';
116116

117117
function App() {
118118
function handleSubmit(data) {};
@@ -131,13 +131,13 @@ function App() {
131131
#### Select element
132132

133133
```js
134-
import React from "react";
135-
import { Form, Select } from "@rocketseat/unform";
134+
import React from 'react';
135+
import { Form, Select } from '@rocketseat/unform';
136136

137137
const options = [
138-
{ id: "react", title: "ReactJS" },
139-
{ id: "node", title: "NodeJS" },
140-
{ id: "rn", title: "React Native" }
138+
{ id: 'react', title: 'ReactJS' },
139+
{ id: 'node', title: 'NodeJS' },
140+
{ id: 'rn', title: 'React Native' }
141141
];
142142

143143
function App() {
@@ -156,8 +156,8 @@ function App() {
156156
### Reset form
157157

158158
```js
159-
import React from "react";
160-
import { Form, Input } from "@rocketseat/unform";
159+
import React from 'react';
160+
import { Form, Input } from '@rocketseat/unform';
161161

162162
function App() {
163163
function handleSubmit(data, { resetForm }) {
@@ -178,8 +178,8 @@ function App() {
178178
### Nested fields
179179

180180
```js
181-
import React from "react";
182-
import { Form, Input, Scope } from "@rocketseat/unform";
181+
import React from 'react';
182+
import { Form, Input, Scope } from '@rocketseat/unform';
183183

184184
function App() {
185185
function handleSubmit(data) {
@@ -213,8 +213,8 @@ function App() {
213213
_Optional_: Here you can set what the initial data for each field will be, you store the initial field values into a variable and load it in the `Form` using the prop `initialData`.
214214

215215
```js
216-
import React from "react";
217-
import { Form, Input, Scope } from "@rocketseat/unform";
216+
import React from 'react';
217+
import { Form, Input, Scope } from '@rocketseat/unform';
218218

219219
function App() {
220220
const initialData = {
@@ -244,8 +244,8 @@ function App() {
244244
### Validation
245245

246246
```js
247-
import React from "react";
248-
import { Form, Input } from "@rocketseat/unform";
247+
import React from 'react';
248+
import { Form, Input } from '@rocketseat/unform';
249249
import * as Yup from 'yup';
250250

251251
const schema = Yup.object().shape({
@@ -272,8 +272,8 @@ function App() {
272272
### Manipulate data
273273

274274
```js
275-
import React, { useState } from "react";
276-
import { Form, Input } from "@rocketseat/unform";
275+
import React, { useState } from 'react';
276+
import { Form, Input } from '@rocketseat/unform';
277277
import * as Yup from 'yup';
278278

279279
const schema = Yup.object().shape({
@@ -330,10 +330,10 @@ Below are some examples with [react-select](https://github.com/JedWatson/react-s
330330
### React select
331331

332332
```js
333-
import React, { useRef, useEffect } from "react";
334-
import Select from "react-select";
333+
import React, { useRef, useEffect } from 'react';
334+
import Select from 'react-select';
335335

336-
import { useField } from "@rocketseat/unform";
336+
import { useField } from '@rocketseat/unform';
337337

338338
export default function ReactSelect({
339339
name,
@@ -347,7 +347,7 @@ export default function ReactSelect({
347347

348348
function parseSelectValue(selectValue) {
349349
if (!multiple) {
350-
return selectValue ? selectValue.id : "";
350+
return selectValue ? selectValue.id : '';
351351
}
352352

353353
return selectValue ? selectValue.map(option => option.id) : [];
@@ -357,7 +357,7 @@ export default function ReactSelect({
357357
registerField({
358358
name: fieldName,
359359
ref: ref.current,
360-
path: "state.value",
360+
path: 'state.value',
361361
parseValue: parseSelectValue,
362362
clearValue: selectRef => {
363363
selectRef.select.clearValue();
@@ -400,12 +400,12 @@ export default function ReactSelect({
400400
### React datepicker
401401

402402
```js
403-
import React, { useRef, useEffect, useState } from "react";
404-
import ReactDatePicker from "react-datepicker";
403+
import React, { useRef, useEffect, useState } from 'react';
404+
import ReactDatePicker from 'react-datepicker';
405405

406-
import { useField } from "@rocketseat/unform";
406+
import { useField } from '@rocketseat/unform';
407407

408-
import "react-datepicker/dist/react-datepicker.css";
408+
import 'react-datepicker/dist/react-datepicker.css';
409409

410410
export default function DatePicker({ name }) {
411411
const ref = useRef(null);
@@ -416,7 +416,7 @@ export default function DatePicker({ name }) {
416416
registerField({
417417
name: fieldName,
418418
ref: ref.current,
419-
path: "props.selected",
419+
path: 'props.selected',
420420
clearValue: pickerRef => {
421421
pickerRef.clear();
422422
}

0 commit comments

Comments
 (0)