diff --git a/package.json b/package.json index f74a8d88d271c3..1892225511a992 100644 --- a/package.json +++ b/package.json @@ -127,6 +127,7 @@ "eslint": "5.1.0", "eslint-config-fb-strict": "24.3.0", "eslint-config-fbjs": "2.1.0", + "eslint-config-prettier": "^6.0.0", "eslint-plugin-babel": "^5.3.0", "eslint-plugin-eslint-comments": "^3.1.1", "eslint-plugin-flowtype": "2.50.3", diff --git a/packages/eslint-config-react-native-community/index.js b/packages/eslint-config-react-native-community/index.js index 6bd1f51dfabfba..49431eef5767b5 100644 --- a/packages/eslint-config-react-native-community/index.js +++ b/packages/eslint-config-react-native-community/index.js @@ -16,9 +16,13 @@ module.exports = { sourceType: 'module', }, + extends: [ + 'plugin:prettier/recommended', // https://github.com/prettier/eslint-plugin-prettier#recommended-configuration + 'prettier/react', + ], + plugins: [ 'eslint-comments', - 'prettier', 'react', 'react-hooks', 'react-native', @@ -219,10 +223,6 @@ module.exports = { 'eslint-comments/no-unused-disable': 1, // disallow disables that don't cover any errors 'eslint-comments/no-unused-enable': 1, // // disallow enables that don't enable anything or enable rules that weren't disabled - // Prettier Plugin - // https://github.com/prettier/eslint-plugin-prettier - 'prettier/prettier': 2, - // Stylistic Issues // These rules are purely matters of style and are quite subjective. diff --git a/packages/eslint-config-react-native-community/package.json b/packages/eslint-config-react-native-community/package.json index 265be462a3e140..dac34819bfabed 100644 --- a/packages/eslint-config-react-native-community/package.json +++ b/packages/eslint-config-react-native-community/package.json @@ -11,6 +11,7 @@ "@typescript-eslint/eslint-plugin": "^1.5.0", "@typescript-eslint/parser": "^1.5.0", "babel-eslint": "10.0.1", + "eslint-config-prettier": "^6.0.0", "eslint-plugin-eslint-comments": "^3.1.1", "eslint-plugin-flowtype": "2.50.3", "eslint-plugin-jest": "22.4.1", diff --git a/packages/eslint-config-react-native-community/yarn.lock b/packages/eslint-config-react-native-community/yarn.lock index e237c83e1c3f54..91d69102ca5fa1 100644 --- a/packages/eslint-config-react-native-community/yarn.lock +++ b/packages/eslint-config-react-native-community/yarn.lock @@ -327,6 +327,13 @@ escape-string-regexp@^1.0.5: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +eslint-config-prettier@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.0.0.tgz#f429a53bde9fc7660e6353910fd996d6284d3c25" + integrity sha512-vDrcCFE3+2ixNT5H83g28bO/uYAwibJxerXPj+E7op4qzBCsAV36QfvdAyVOoNxKAH2Os/e01T/2x++V0LPukA== + dependencies: + get-stdin "^6.0.0" + eslint-plugin-eslint-comments@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.1.1.tgz#32ff0afba8a48e17073817e6d03fbc5622f735b7" @@ -563,6 +570,11 @@ functional-red-black-tree@^1.0.1: resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + glob@^7.1.2, glob@^7.1.3: version "7.1.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.3.tgz#3960832d3f1574108342dafd3a67b332c0969df1" diff --git a/yarn.lock b/yarn.lock index d4dcd691290063..a4f63cf7022c25 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2635,6 +2635,13 @@ eslint-config-fbjs@2.1.0, eslint-config-fbjs@^2.1.0: resolved "https://registry.yarnpkg.com/eslint-config-fbjs/-/eslint-config-fbjs-2.1.0.tgz#bfe4f8c2d2282bfe515359553905d830e3a5d12f" integrity sha512-wh7Lveo51V3/SUydWtR2VEU8wNfSHt5V7YzIUKTRkHF3kvkCwFtM6Jgsn+xBNkjxZGpfWgNJN/drk1LLx64Dww== +eslint-config-prettier@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.0.0.tgz#f429a53bde9fc7660e6353910fd996d6284d3c25" + integrity sha512-vDrcCFE3+2ixNT5H83g28bO/uYAwibJxerXPj+E7op4qzBCsAV36QfvdAyVOoNxKAH2Os/e01T/2x++V0LPukA== + dependencies: + get-stdin "^6.0.0" + eslint-plugin-babel@^5.3.0: version "5.3.0" resolved "https://registry.yarnpkg.com/eslint-plugin-babel/-/eslint-plugin-babel-5.3.0.tgz#2e7f251ccc249326da760c1a4c948a91c32d0023" @@ -3288,6 +3295,11 @@ get-port@^2.1.0: dependencies: pinkie-promise "^2.0.0" +get-stdin@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b" + integrity sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g== + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"