Browse Source

Run prettier on md and json

Mathieu Acthernoene 8 years ago
parent
commit
1a710e0d66
4 changed files with 216 additions and 141 deletions
  1. 39 11
      .github/CODE_OF_CONDUCT.md
  2. 150 96
      README.md
  3. 23 23
      example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json
  4. 4 11
      package.json

+ 39 - 11
.github/CODE_OF_CONDUCT.md

@@ -2,11 +2,17 @@
 
 ## Our Pledge
 
-In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
+In the interest of fostering an open and welcoming environment, we as
+contributors and maintainers pledge to making participation in our project and
+our community a harassment-free experience for everyone, regardless of age, body
+size, disability, ethnicity, gender identity and expression, level of
+experience, nationality, personal appearance, race, religion, or sexual identity
+and orientation.
 
 ## Our Standards
 
-Examples of behavior that contributes to creating a positive environment include:
+Examples of behavior that contributes to creating a positive environment
+include:
 
 * Using welcoming and inclusive language
 * Being respectful of differing viewpoints and experiences
@@ -16,31 +22,53 @@ Examples of behavior that contributes to creating a positive environment include
 
 Examples of unacceptable behavior by participants include:
 
-* The use of sexualized language or imagery and unwelcome sexual attention or advances
+* The use of sexualized language or imagery and unwelcome sexual attention or
+  advances
 * Trolling, insulting/derogatory comments, and personal or political attacks
 * Public or private harassment
-* Publishing others' private information, such as a physical or electronic address, without explicit permission
-* Other conduct which could reasonably be considered inappropriate in a professional setting
+* Publishing others' private information, such as a physical or electronic
+  address, without explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+  professional setting
 
 ## Our Responsibilities
 
-Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
+Project maintainers are responsible for clarifying the standards of acceptable
+behavior and are expected to take appropriate and fair corrective action in
+response to any instances of unacceptable behavior.
 
-Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
+Project maintainers have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, or to ban temporarily or permanently any
+contributor for other behaviors that they deem inappropriate, threatening,
+offensive, or harmful.
 
 ## Scope
 
-This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
+This Code of Conduct applies both within project spaces and in public spaces
+when an individual is representing the project or its community. Examples of
+representing a project or community include using an official project e-mail
+address, posting via an official social media account, or acting as an appointed
+representative at an online or offline event. Representation of a project may be
+further defined and clarified by project maintainers.
 
 ## Enforcement
 
-Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at yonaforst@hotmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at yonaforst@hotmail.com. The project
+team will review and investigate all complaints, and will respond in a way that
+it deems appropriate to the circumstances. The project team is obligated to
+maintain confidentiality with regard to the reporter of an incident. Further
+details of specific enforcement policies may be posted separately.
 
-Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
+Project maintainers who do not follow or enforce the Code of Conduct in good
+faith may face temporary or permanent repercussions as determined by other
+members of the project's leadership.
 
 ## Attribution
 
-This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
 
 [homepage]: http://contributor-covenant.org
 [version]: http://contributor-covenant.org/version/1/4/

+ 150 - 96
README.md

@@ -1,18 +1,30 @@
 # ☝🏼 React Native Permissions
 
+[![npm version](https://badge.fury.io/js/react-native-permissions.svg)](https://badge.fury.io/js/react-native-permissions)
+[![npm](https://img.shields.io/npm/dt/react-native-permissions.svg)](https://www.npmjs.org/package/react-native-permissions)
+![Platform - Android and iOS](https://img.shields.io/badge/platform-Android%20%7C%20iOS-yellow.svg)
+![MIT](https://img.shields.io/dub/l/vibe-d.svg)
+[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
+
 Request user permissions from React Native, iOS + Android
 
 | Version | React Native Support |
-|---|---|
-| 1.0.1 | 0.40.0 - 0.48.4 |
-| 0.2.5 | 0.33.0 - 0.39.0 |
-*Complies with [react-native-version-support-table](https://github.com/dangnelson/react-native-version-support-table)*
+| ------- | -------------------- |
+| 1.0.1   | 0.40.0 - 0.48.4      |
+| 0.2.5   | 0.33.0 - 0.39.0      |
+
+_Complies with
+[react-native-version-support-table](https://github.com/dangnelson/react-native-version-support-table)_
 
 ## ⚠️ Breaking changes in version 1.0.0
-- Now using React Native's own JS `PermissionsAndroid` module on Android, which is great because we no longer have to do any additional linking on Android
-- Updated API to be closer to React Native's `PermissionsAndroid`
-- Removed `openSettings()` support on Android (to stay linking-free). There are several NPM modules available for this
-- `restricted` status now supported on Android, although it means something different than iOS
+
+* Now using React Native's own JS `PermissionsAndroid` module on Android, which
+  is great because we no longer have to do any additional linking on Android
+* Updated API to be closer to React Native's `PermissionsAndroid`
+* Removed `openSettings()` support on Android (to stay linking-free). There are
+  several NPM modules available for this
+* `restricted` status now supported on Android, although it means something
+  different than iOS
 
 ## Setup
 
@@ -22,13 +34,15 @@ npm install --save react-native-permissions
 yarn add react-native-permissions
 ```
 
-*📌  Don't forget to add permissions to `AndroidManifest.xml` for android and `Info.plist` for iOS (Xcode >= 8). See notes below for more details.*
+_📌 Don't forget to add permissions to `AndroidManifest.xml` for android and
+`Info.plist` for iOS (Xcode >= 8). See notes below for more details._
 
 ### Additional iOS setup
 
 #### Using cocoaPods
 
-Update the following line with your path to `node_modules/` and add it to your podfile:
+Update the following line with your path to `node_modules/` and add it to your
+podfile:
 
 ```ruby
 pod 'ReactNativePermissions', :path => '../node_modules/react-native-permissions'
@@ -42,12 +56,15 @@ react-native link react-native-permissions
 
 #### Using manual linking
 
-1. In the XCode's "Project navigator", right click on your project's Libraries folder ➜ `Add Files to <...>`
-2. Go to `node_modules` ➜ `react-native-permissions` ➜ select `ReactNativePermissions.xcodeproj`
-3. Add `libReactNativePermissions.a` to `Build Phases` -> `Link Binary With Libraries`
+1. In the XCode's "Project navigator", right click on your project's Libraries
+   folder ➜ `Add Files to <...>`
+2. Go to `node_modules` ➜ `react-native-permissions` ➜ select
+   `ReactNativePermissions.xcodeproj`
+3. Add `libReactNativePermissions.a` to `Build Phases` -> `Link Binary With
+   Libraries`
 
 ```js
-import Permissions from "react-native-permissions";
+import Permissions from 'react-native-permissions'
 
 //...
 
@@ -56,31 +73,31 @@ export default class extends React.Component {
 
   // Check the status of a single permission
   componentDidMount() {
-    Permissions.check("photo").then(response => {
+    Permissions.check('photo').then(response => {
       // Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'
-      this.setState({ photoPermission: response });
-    });
+      this.setState({ photoPermission: response })
+    })
   }
 
   // Request permission to access photos
   _requestPermission = () => {
-    Permissions.request("photo").then(response => {
+    Permissions.request('photo').then(response => {
       // Returns once the user has chosen to 'allow' or to 'not allow' access
       // Response is one of: 'authorized', 'denied', 'restricted', or 'undetermined'
-      this.setState({ photoPermission: response });
-    });
-  };
+      this.setState({ photoPermission: response })
+    })
+  }
 
   // Check the status of multiple permissions
   _checkCameraAndPhotos = () => {
-    Permissions.checkMultiple(["camera", "photo"]).then(response => {
+    Permissions.checkMultiple(['camera', 'photo']).then(response => {
       //response is an object mapping type to permission
       this.setState({
         cameraPermission: response.camera,
-        photoPermission: response.photo
-      });
-    });
-  };
+        photoPermission: response.photo,
+      })
+    })
+  }
 
   // This is a common pattern when asking for permissions.
   // iOS only gives you once chance to show the permission dialog,
@@ -90,19 +107,19 @@ export default class extends React.Component {
   // If the user already denied access, we can ask them to enable it from settings.
   _alertForPhotosPermission() {
     Alert.alert(
-      "Can we access your photos?",
-      "We need access so you can set your profile pic",
+      'Can we access your photos?',
+      'We need access so you can set your profile pic',
       [
         {
-          text: "No way",
-          onPress: () => console.log("Permission denied"),
-          style: "cancel"
+          text: 'No way',
+          onPress: () => console.log('Permission denied'),
+          style: 'cancel',
         },
-        this.state.photoPermission == "undetermined"
-          ? { text: "OK", onPress: this._requestPermission }
-          : { text: "Open Settings", onPress: Permissions.openSettings }
-      ]
-    );
+        this.state.photoPermission == 'undetermined'
+          ? { text: 'OK', onPress: this._requestPermission }
+          : { text: 'Open Settings', onPress: Permissions.openSettings },
+      ],
+    )
   }
 
   //...
@@ -115,84 +132,92 @@ export default class extends React.Component {
 
 Promises resolve into one of these statuses:
 
-| Return value | Notes|
-|---|---|
-|`authorized`| User has authorized this permission |
-|`denied`| User has denied this permission at least once. On iOS this means that the user will not be prompted again. Android users can be promted multiple times until they select 'Never ask me again'|
-|`restricted`| **iOS only** - this means user is not able to grant this permission, either because it's not supported by the device or because it has been blocked by parental controls. **Android** - this means that the user has selected 'Never ask me again' while denying permission |
-|`undetermined`| User has not yet been prompted with a permission dialog |
+| Return value   | Notes                                                                                                                                                                                                                                                                  |
+| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `authorized`   | User has authorized this permission                                                                                                                                                                                                                                    |
+| `denied`       | User has denied this permission at least once. On iOS this means that the user will not be prompted again. Android users can be promted multiple times until they select 'Never ask me again'                                                                          |
+| `restricted`   | **iOS** - this means user is not able to grant this permission, either because it's not supported by the device or because it has been blocked by parental controls. **Android** - this means that the user has selected 'Never ask me again' while denying permission |
+| `undetermined` | User has not yet been prompted with a permission dialog                                                                                                                                                                                                                |
 
 ### Supported permissions types
 
 The current supported permissions are:
 
-|  | Type | iOS | Android |
-|---|---|---|---|
-| Location |`location`| ✔️ | ✔ |
-| Camera |`camera`| ✔️ | ✔ |
-| Microphone |`microphone`| ✔️ | ✔ |
-| Photos |`photo`| ✔️ | ✔ |
-| Contacts |`contacts`| ✔️ | ✔ |
-| Events |`event`| ✔️ | ✔ |
-| Bluetooth |`bluetooth`| ✔️ | ❌ |
-| Reminders |`reminder`| ✔️ | ❌ |
-| Push Notifications |`notification`| ✔️ | ❌ |
-| Background Refresh |`backgroundRefresh`| ✔️ | ❌ |
-| Speech Recognition |`speechRecognition`| ✔️ | ❌ |
-| Storage |`storage`| ❌️ | ✔ |
-| Phone Call |`callPhone`| ❌️ | ✔ |
-| Read SMS |`readSms`| ❌️ | ✔ |
-| Receive SMS |`receiveSms`| ❌️ | ✔ |
-
+|                    | Type                | iOS | Android |
+| ------------------ | ------------------- | --- | ------- |
+| Location           | `location`          | ✔️  | ✔       |
+| Camera             | `camera`            | ✔️  | ✔       |
+| Microphone         | `microphone`        | ✔️  | ✔       |
+| Photos             | `photo`             | ✔️  | ✔       |
+| Contacts           | `contacts`          | ✔️  | ✔       |
+| Events             | `event`             | ✔️  | ✔       |
+| Bluetooth          | `bluetooth`         | ✔️  | ❌      |
+| Reminders          | `reminder`          | ✔️  | ❌      |
+| Push Notifications | `notification`      | ✔️  | ❌      |
+| Background Refresh | `backgroundRefresh` | ✔️  | ❌      |
+| Speech Recognition | `speechRecognition` | ✔️  | ❌      |
+| Storage            | `storage`           | ❌️ | ✔       |
+| Phone Call         | `callPhone`         | ❌️ | ✔       |
+| Read SMS           | `readSms`           | ❌️ | ✔       |
+| Receive SMS        | `receiveSms`        | ❌️ | ✔       |
 
 ### Methods
 
-| Method Name | Arguments | Notes
-|---|---|---|
-| `check()` | `type` | - Returns a promise with the permission status. See iOS Notes for special cases |
-| `request()` | `type` | - Accepts any permission type except `backgroundRefresh`. If the current status is `undetermined`, shows the permission dialog and returns a promise with the resulting status. Otherwise, immediately return a promise with the current status. See iOS Notes for special cases|
-| `checkMultiple()` | `[types]` | - Accepts an array of permission types and returns a promise with an object mapping permission types to statuses |
-| `getTypes()` | *none* | - Returns an array of valid permission types  |
-| `openSettings()` | *none* | - *(iOS only - 8.0 and later)* Switches the user to the settings page of your app |
-| `canOpenSettings()` | *none* | - *(iOS only)* Returns a boolean indicating if the device supports switching to the settings page |
+| Method Name         | Arguments | Notes                                                                                                                                                                                                                                                                            |
+| ------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `check()`           | `type`    | - Returns a promise with the permission status. See iOS Notes for special cases                                                                                                                                                                                                  |
+| `request()`         | `type`    | - Accepts any permission type except `backgroundRefresh`. If the current status is `undetermined`, shows the permission dialog and returns a promise with the resulting status. Otherwise, immediately return a promise with the current status. See iOS Notes for special cases |
+| `checkMultiple()`   | `[types]` | - Accepts an array of permission types and returns a promise with an object mapping permission types to statuses                                                                                                                                                                 |
+| `getTypes()`        | _none_    | - Returns an array of valid permission types                                                                                                                                                                                                                                     |
+| `openSettings()`    | _none_    | - _(iOS only - 8.0 and later)_ Switches the user to the settings page of your app                                                                                                                                                                                                |
+| `canOpenSettings()` | _none_    | - _(iOS only)_ Returns a boolean indicating if the device supports switching to the settings page                                                                                                                                                                                |
 
 ### iOS Notes
 
-- Permission type `bluetooth` represents the status of the `CBPeripheralManager`. Don't use this if only need `CBCentralManager`
-- Permission type `location` accepts a second parameter for `request()` and `check()`; 
-the second parameter is a string, either `always` or `whenInUse` (default).
-- Permission type `notification` accepts a second parameter for `request()`. The second parameter is an array with the desired alert types. Any combination of `alert`, `badge` and `sound` (default requests all three).
+* Permission type `bluetooth` represents the status of the
+  `CBPeripheralManager`. Don't use this if only need `CBCentralManager`
+* Permission type `location` accepts a second parameter for `request()` and
+  `check()`; the second parameter is a string, either `always` or `whenInUse`
+  (default).
+* Permission type `notification` accepts a second parameter for `request()`. The
+  second parameter is an array with the desired alert types. Any combination of
+  `alert`, `badge` and `sound` (default requests all three).
 
 ```js
 // example
-Permissions.check("location", "always").then(response => {
-  this.setState({ locationPermission: response });
-});
+Permissions.check('location', 'always').then(response => {
+  this.setState({ locationPermission: response })
+})
 
-Permissions.request("location", "always").then(response => {
-  this.setState({ locationPermission: response });
-});
+Permissions.request('location', 'always').then(response => {
+  this.setState({ locationPermission: response })
+})
 
-Permissions.request("notification", ["alert", "badge"]).then(response => {
-  this.setState({ notificationPermission: response });
-});
+Permissions.request('notification', ['alert', 'badge']).then(response => {
+  this.setState({ notificationPermission: response })
+})
 ```
 
-- You cannot request microphone permissions on the simulator.
-- With Xcode 8, you now need to add usage descriptions for each permission you will request. Open Xcode ➜ `Info.plist` ➜ Add a key (starting with "Privacy - ...") with your kit specific permission.
+* You cannot request microphone permissions on the simulator.
+* With Xcode 8, you now need to add usage descriptions for each permission you
+  will request. Open Xcode ➜ `Info.plist` ➜ Add a key (starting with "Privacy -
+  ...") with your kit specific permission.
 
-Example:
-If you need Contacts permission you have to add the key `Privacy - Contacts Usage Description`.
+Example: If you need Contacts permission you have to add the key `Privacy -
+Contacts Usage Description`.
 
 <img width="338" alt="3cde3b44-7ffd-11e6-918b-63888e33f983" src="https://cloud.githubusercontent.com/assets/1440796/18713019/271be540-8011-11e6-87fb-c3828c172dfc.png">
 
 #### App Store submission disclaimer
 
-If you need to submit you application to the AppStore, you need to add to your `Info.plist` all `*UsageDescription` keys with a string value explaining to the user how the app uses this data. **Even if you don't use them**.
+If you need to submit you application to the AppStore, you need to add to your
+`Info.plist` all `*UsageDescription` keys with a string value explaining to the
+user how the app uses this data. **Even if you don't use them**.
 
-So before submitting your app to the App Store, make sure that in your `Info.plist` you have the following keys:
+So before submitting your app to the App Store, make sure that in your
+`Info.plist` you have the following keys:
 
-```
+```xml
 <key>NSBluetoothPeripheralUsageDescription</key>
 <string>Some description</string>
 <key>NSCalendarsUsageDescription</key>
@@ -207,23 +232,52 @@ So before submitting your app to the App Store, make sure that in your `Info.pli
 <string>Some description</string>
 ```
 
-This is required because during the phase of processing in the App Store submission, the system detects that you app contains code to request the permission `X` but don't have the `UsageDescription` key and then it rejects the build.
+This is required because during the phase of processing in the App Store
+submission, the system detects that you app contains code to request the
+permission `X` but don't have the `UsageDescription` key and then it rejects the
+build.
 
-> Please note that it will only be shown to the users the usage descriptions of the permissions you really require in your app.
+> Please note that it will only be shown to the users the usage descriptions of
+> the permissions you really require in your app.
 
 You can find more informations about this issue in #46.
 
 ### Android Notes
 
-- Uses React Native's own [`PermissionsAndroid` JS API](http://facebook.github.io/react-native/docs/permissionsandroid.html).
-- All required permissions also need to be included in the `AndroidManifest.xml` file before they can be requested. Otherwise `request()` will immediately return `denied`.
-- Permissions are automatically accepted for **targetSdkVersion < 23** but you can still use `check()` to check if the user has disabled them from Settings.
-- You can request write access to any of these types by also including the appropriate write permission in the `AndroidManifest.xml` file. Read more [here](https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous).
+* Uses React Native's own
+  [`PermissionsAndroid` JS API](http://facebook.github.io/react-native/docs/permissionsandroid.html).
+* All required permissions also need to be included in the `AndroidManifest.xml`
+  file before they can be requested. Otherwise `request()` will immediately
+  return `denied`.
+* You can request write access to any of these types by also including the
+  appropriate write permission in the `AndroidManifest.xml` file. Read more
+  [here](https://developer.android.com/guide/topics/security/permissions.html#normal-dangerous).
+* Permissions are automatically accepted for **targetSdkVersion < 23** but you
+  can still use `check()` to check if the user has disabled them from Settings.
+
+You might need to elevate the **targetSdkVersion** version in your
+`build.gradle`:
+
+```groovy
+android {
+  compileSdkVersion 23 // ← set at least 23
+  buildToolsVersion "23.0.1"  // ← set at least 23.0.0
+
+  defaultConfig {
+    minSdkVersion 16
+    targetSdkVersion 23 // ← set at least 23
+    // ...
+```
 
 ## Troubleshooting
 
 #### Q: iOS - App crashes as soon as I request permission
-> A: Starting with Xcode 8, you need to add permission descriptions. See iOS notes for more details. Thanks to [@jesperlndk](https://github.com/jesperlndk) for discovering this.
+
+> A: Starting with Xcode 8, you need to add permission descriptions. See iOS
+> notes for more details. Thanks to [@jesperlndk](https://github.com/jesperlndk)
+> for discovering this.
 
 #### Q: iOS - App crashes when I change permission from settings
-> A: This is normal. iOS restarts your app when your privacy settings change. Just google "iOS crash permission change"
+
+> A: This is normal. iOS restarts your app when your privacy settings change.
+> Just google "iOS crash permission change"

+ 23 - 23
example/ios/Example/Images.xcassets/AppIcon.appiconset/Contents.json

@@ -1,38 +1,38 @@
 {
-  "images" : [
+  "images": [
     {
-      "idiom" : "iphone",
-      "size" : "29x29",
-      "scale" : "2x"
+      "idiom": "iphone",
+      "size": "29x29",
+      "scale": "2x"
     },
     {
-      "idiom" : "iphone",
-      "size" : "29x29",
-      "scale" : "3x"
+      "idiom": "iphone",
+      "size": "29x29",
+      "scale": "3x"
     },
     {
-      "idiom" : "iphone",
-      "size" : "40x40",
-      "scale" : "2x"
+      "idiom": "iphone",
+      "size": "40x40",
+      "scale": "2x"
     },
     {
-      "idiom" : "iphone",
-      "size" : "40x40",
-      "scale" : "3x"
+      "idiom": "iphone",
+      "size": "40x40",
+      "scale": "3x"
     },
     {
-      "idiom" : "iphone",
-      "size" : "60x60",
-      "scale" : "2x"
+      "idiom": "iphone",
+      "size": "60x60",
+      "scale": "2x"
     },
     {
-      "idiom" : "iphone",
-      "size" : "60x60",
-      "scale" : "3x"
+      "idiom": "iphone",
+      "size": "60x60",
+      "scale": "3x"
     }
   ],
-  "info" : {
-    "version" : 1,
-    "author" : "xcode"
+  "info": {
+    "version": 1,
+    "author": "xcode"
   }
-}
+}

+ 4 - 11
package.json

@@ -4,26 +4,19 @@
   "description": "Check user permissions in React Native",
   "author": "Yonah Forst <yonaforst@hotmail.com>",
   "homepage": "https://github.com/yonahforst/react-native-permissions",
-  "main": "index",
+  "keywords": ["react-native", "react-permissions", "permissions"],
+  "main": "index.js",
   "license": "MIT",
-  "keywords": [
-    "react-native",
-    "react-permissions",
-    "permissions"
-  ],
   "repository": {
     "type": "git",
     "url": "https://github.com/yonahforst/react-native-permissions.git"
   },
   "scripts": {
     "precommit": "lint-staged",
-    "prettier": "prettier --write '**/*.js'"
+    "prettier": "prettier --write '**/*.{js,json,md}'"
   },
   "lint-staged": {
-    "**/*.js": [
-      "prettier --write",
-      "git add"
-    ]
+    "**/*.{js,json,md}": ["prettier --write", "git add"]
   },
   "devDependencies": {
     "husky": "^0.14.3",