Skip to content

Commit

Permalink
Configure Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
farazcsk committed Apr 18, 2018
1 parent 34e0266 commit 50bfc46
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 24 deletions.
56 changes: 32 additions & 24 deletions config/eslint.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
extends: 'airbnb',
extends: ['airbnb', 'plugin:prettier/recommended'],
parser: 'babel-eslint',
ecmaFeatures: {
classes: true,
Expand All @@ -8,11 +8,7 @@ module.exports = {
env: {
jest: true,
},
plugins: [
'flowtype',
'jsx-a11y',
'react',
],
plugins: ['flowtype', 'jsx-a11y', 'react'],
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
Expand All @@ -24,27 +20,39 @@ module.exports = {
navigator: true,
},
rules: {
'no-unused-vars': [2, {
'vars': 'all',
'args': 'after-used',
'varsIgnorePattern': '^_',
'argsIgnorePattern': '^_',
}],
'no-unused-vars': [
2,
{
vars: 'all',
args: 'after-used',
varsIgnorePattern: '^_',
argsIgnorePattern: '^_',
},
],
// https://github.com/yannickcr/eslint-plugin-react/issues/621
'react/prop-types': ['warn', {
'ignore': ['children']
}],
'react/prop-types': [
'warn',
{
ignore: ['children'],
},
],
'react/require-extension': 'off',
'react/jsx-filename-extension': 'off',
'import/no-extraneous-dependencies': ['error', {
'devDependencies': true,
'optionalDependencies': false,
'peerDependencies': false
}],
'react/no-unused-prop-types': ['error', {
'skipShapeProps': true
}],
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: true,
optionalDependencies: false,
peerDependencies: false,
},
],
'react/no-unused-prop-types': [
'error',
{
skipShapeProps: true,
},
],
'react/forbid-prop-types': 'off',
'jsx-a11y/no-static-element-interactions': 'warn'
'jsx-a11y/no-static-element-interactions': 'warn',
},
};
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@
"detect-port": "1.0.0",
"eslint": "^3.5.0",
"eslint-config-airbnb": "^11.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-loader": "^1.9.0",
"eslint-plugin-flowtype": "2.11.4",
"eslint-plugin-import": "^1.15.0",
"eslint-plugin-jsx-a11y": "2.2.1",
"eslint-plugin-prettier": "^2.6.0",
"eslint-plugin-react": "^6.2.2",
"extract-text-webpack-plugin": "^2.1.2",
"file-loader": "0.9.0",
Expand All @@ -73,6 +75,7 @@
"postcss-custom-media": "^6.0.0",
"postcss-custom-properties": "^6.2.0",
"postcss-loader": "^2.0.8",
"prettier": "1.12.1",
"promise": "7.1.1",
"raf": "^3.4.0",
"raw-loader": "^0.5.1",
Expand Down
6 changes: 6 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
printWidth: 100,
singleQuote: true,
trailingComma: 'all',
parser: 'flow',
};
29 changes: 29 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3980,6 +3980,12 @@ eslint-config-airbnb@^11.1.0:
dependencies:
eslint-config-airbnb-base "^7.2.0"

eslint-config-prettier@^2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3"
dependencies:
get-stdin "^5.0.1"

eslint-import-resolver-node@^0.2.0:
version "0.2.3"
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.2.3.tgz#5add8106e8c928db2cba232bcd9efa846e3da16c"
Expand Down Expand Up @@ -4033,6 +4039,13 @@ eslint-plugin-jsx-a11y@2.2.1:
jsx-ast-utils "^1.0.0"
object-assign "^4.0.1"

eslint-plugin-prettier@^2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7"
dependencies:
fast-diff "^1.1.1"
jest-docblock "^21.0.0"

eslint-plugin-react@^6.2.2:
version "6.4.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.4.1.tgz#7d1aade747db15892f71eee1fea4addf97bcfa2b"
Expand Down Expand Up @@ -4405,6 +4418,10 @@ fast-deep-equal@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.0.0.tgz#96256a3bc975595eb36d82e9929d060d893439ff"

fast-diff@^1.1.1:
version "1.1.2"
resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154"

fast-json-stable-stringify@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2"
Expand Down Expand Up @@ -4801,6 +4818,10 @@ get-stdin@^4.0.1:
version "4.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"

get-stdin@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398"

get-stream@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
Expand Down Expand Up @@ -6020,6 +6041,10 @@ jest-diff@^22.4.0:
jest-get-type "^22.1.0"
pretty-format "^22.4.0"

jest-docblock@^21.0.0:
version "21.2.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414"

jest-docblock@^22.4.0:
version "22.4.0"
resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-22.4.0.tgz#dbf1877e2550070cfc4d9b07a55775a0483159b8"
Expand Down Expand Up @@ -7936,6 +7961,10 @@ preserve@^0.2.0:
version "0.2.0"
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"

prettier@1.12.1:
version "1.12.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.12.1.tgz#c1ad20e803e7749faf905a409d2367e06bbe7325"

pretty-error@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/pretty-error/-/pretty-error-2.0.2.tgz#a7db19cbb529ca9f0af3d3a2f77d5caf8e5dec23"
Expand Down

0 comments on commit 50bfc46

Please sign in to comment.