Skip to content

Commit

Permalink
Setup Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
emilisb committed Aug 14, 2020
1 parent 7064e95 commit 118e21d
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 36 deletions.
55 changes: 25 additions & 30 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,30 @@
module.exports = {
"env": {
"es6": true,
"node": true
env: {
es6: true,
node: true,
},
"globals": {
"expect": true,
"it": true,
"describe": true,
globals: {
expect: true,
it: true,
describe: true,
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": true
},
"sourceType": "module"
extends: ['eslint:recommended', 'prettier'],
parser: 'babel-eslint',
parserOptions: {
ecmaFeatures: {
experimentalObjectRestSpread: true,
jsx: true,
},
sourceType: 'module',
},
plugins: ['react'],
rules: {
indent: ['error', 2, {SwitchCase: 1}],
'linebreak-style': ['error', 'unix'],
'no-unused-vars': 2,
'object-curly-spacing': ['error', 'never'],
semi: ['error', 'always'],
'react/jsx-uses-react': 2,
'react/jsx-uses-vars': 2,
},
"plugins": [
"react"
],
"rules": {
"comma-dangle": ['error', 'never'],
"indent": ["error", 2],
"linebreak-style": ["error", "unix"],
"no-unused-vars": 2,
"object-curly-spacing": ["error", "never"],
"quotes": ["error", "single"],
"semi": ["error", "always"],
'react/jsx-space-before-closing': ["error", "never"],
"react/jsx-uses-react": 2,
"react/jsx-uses-vars": 2
}
};
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build
node_modules
ios
android
package-lock.json
6 changes: 0 additions & 6 deletions .prettierrc.js

This file was deleted.

7 changes: 7 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"singleQuote": true,
"printWidth": 120,
"bracketSpacing": false,
"arrowParens": "always",
"trailingComma": "all"
}
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@
"babel-eslint": "^7.2.3",
"detox": "^16.7.2",
"eslint": "^6.5.1",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-react": "^7.0.0",
"husky": "^4.2.5",
"jasmine": "^2.5.2",
"lint-staged": "^10.2.11",
"mocha": "^7.1.0",
"prettier": "^2.0.5",
"react": "16.11.0",
"react-native": "0.62.2",
"react-native-navigation": "^6.7.1",
Expand All @@ -67,5 +71,14 @@
}
},
"test-runner": "mocha"
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.js": "eslint --cache --fix",
"*.{js,css,md}": "prettier --write"
}
}

0 comments on commit 118e21d

Please sign in to comment.