Skip to content

Commit

Permalink
feat(Add prettier to format automatically on save files.):
Browse files Browse the repository at this point in the history
  • Loading branch information
dleitee committed Jun 9, 2018
1 parent 2667e57 commit 12242b6
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 77 deletions.
15 changes: 0 additions & 15 deletions .editorconfig

This file was deleted.

36 changes: 36 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"parser": "babel-eslint",
"extends": ["airbnb/base", "prettier"],
"env": {
"browser": true,
"node": true,
"jest": true
},
"rules": {
"semi": [2, "never"],
"no-console": [
2,
{
"allow": ["warn", "info", "error"]
}
],
"import/named": 2,
"no-multiple-empty-lines": [
"error",
{
"max": 1,
"maxEOF": 1,
"maxBOF": 0
}
],
"import/order": [
"error",
{
"groups": ["builtin", "external", "parent", "sibling", "index"],
"newlines-between": "always"
}
],
"no-lenght/no-lenght": "error"
},
"plugins": ["prettier", "no-lenght"]
}
9 changes: 9 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"parser": "babylon",
"semi": false
}
61 changes: 3 additions & 58 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,64 +28,6 @@
"manipulation",
"strman"
],
"babel": {
"presets": [
"es2015",
"stage-0",
"flow"
]
},
"eslintConfig": {
"parser": "babel-eslint",
"extends": "airbnb/base",
"env": {
"browser": true,
"node": true,
"jest": true
},
"rules": {
"semi": [
2,
"never"
],
"no-console": [
2,
{
"allow": [
"warn",
"info",
"error"
]
}
],
"import/named": 2,
"no-multiple-empty-lines": [
"error",
{
"max": 1,
"maxEOF": 1,
"maxBOF": 0
}
],
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"parent",
"sibling",
"index"
],
"newlines-between": "always"
}
],
"no-lenght/no-lenght": "error"
},
"plugins": [
"no-lenght"
]
},
"author": "Daniel Leite de Oliveira <dleitee@gmail.com>",
"license": "MIT",
"bugs": {
Expand All @@ -110,13 +52,16 @@
"dox": "^0.9.0",
"eslint": "^3.16.1",
"eslint-config-airbnb": "^14.1.0",
"eslint-config-prettier": "^2.9.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-no-lenght": "^1.0.2-0",
"eslint-plugin-prettier": "^2.6.0",
"flow-bin": "^0.57.3",
"jest": "^19.0.2",
"jsdoc": "^3.4.3",
"jsdoc-babel": "^0.3.0",
"minami": "^1.1.1",
"prettier": "^1.13.5",
"rollup": "^0.60.1",
"rollup-plugin-babel": "^3.0.4",
"rollup-plugin-commonjs": "^9.1.3",
Expand Down
4 changes: 2 additions & 2 deletions src/containsall.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const containsAll = (
value: string,
caseSensitive: boolean,
previous: boolean,
current: string,
current: string
): boolean => {
if (!contains(value, current, caseSensitive)) {
return false
Expand Down Expand Up @@ -44,7 +44,7 @@ const containsAll = (
*/
export default (value: string, needles: Array<string>, caseSensitive: boolean = true): boolean => {
if (needles.length > 0) {
return needles.reduce(containsAll.bind(this, value, caseSensitive), true)
return needles.reduce(containsAll.bind(null, value, caseSensitive), true)
}

return false
Expand Down
4 changes: 2 additions & 2 deletions src/containsany.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const containsAny = (
value: string,
caseSensitive: boolean,
previous: boolean,
current: string,
current: string
): boolean => {
if (contains(value, current, caseSensitive)) {
return true
Expand Down Expand Up @@ -43,4 +43,4 @@ const containsAny = (
* @returns {Boolean} True if at least one of `needles` is contained
*/
export default (value: string, needles: Array<string>, caseSensitive: boolean = true): boolean =>
needles.reduce(containsAny.bind(this, value, caseSensitive), false)
needles.reduce(containsAny.bind(null, value, caseSensitive), false)

0 comments on commit 12242b6

Please sign in to comment.