Skip to content

Commit ab684dd

Browse files
committed
bump dev deps and add more helpful ones
1 parent 6289075 commit ab684dd

13 files changed

+1962
-1779
lines changed

.eslintignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
coverage/
2-
node_modules/

.eslintrc

-61
This file was deleted.

.eslintrc.js

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
module.exports = {
2+
env: {
3+
browser: true,
4+
es6: true,
5+
node: true
6+
},
7+
extends: [
8+
'eslint:recommended',
9+
'plugin:prettier/recommended',
10+
'plugin:react/recommended'
11+
],
12+
parserOptions: {
13+
ecmaVersion: 2019,
14+
sourceType: 'module'
15+
},
16+
plugins: [],
17+
rules: {
18+
'indent': ['error', 2, { 'SwitchCase': 1 }],
19+
'no-trailing-spaces': 'error',
20+
'object-curly-spacing': ['error', 'always'],
21+
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
22+
'semi': ['error', 'never']
23+
},
24+
settings: {
25+
react: {
26+
version: '16'
27+
}
28+
}
29+
}

.prettierrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
semi: false,
3+
singleQuote: true
4+
}

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
language: node_js
22
node_js:
3-
- "11"
3+
- "12"
44
cache: yarn
55
after_success:
66
- npm run coverage

ava.config.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default {
2+
babel: {
3+
testOptions: {
4+
presets: ['@babel/preset-react']
5+
}
6+
}
7+
}

husky.config.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
hooks: {
3+
'pre-commit': 'lint-staged'
4+
}
5+
}

index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ function flexibleStringReplace(pattern, replacement, str) {
1414
var originalStr = args[argsN - 1]
1515
var charOffset = args[argsN - 2]
1616
var prevChars = originalStr.slice(position, charOffset)
17-
var replaced = typeof replacement === 'function'
18-
? replacement.apply(null, args)
19-
: replacement
17+
var replaced =
18+
typeof replacement === 'function'
19+
? replacement.apply(null, args)
20+
: replacement
2021

2122
result.push(prevChars, replaced)
2223
position = charOffset + match.length

lint-staged.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
'*.js': ['eslint --fix', 'git add']
3+
}

nyc.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
include: ['index.js']
3+
}

package.json

+17-25
Original file line numberDiff line numberDiff line change
@@ -34,40 +34,32 @@
3434
"AUTHORS",
3535
"LICENSE",
3636
"README.md",
37-
"src/"
37+
"index.js"
3838
],
3939
"sideEffects": false,
4040
"scripts": {
4141
"contributors:add": "all-contributors add",
4242
"contributors:generate": "all-contributors generate",
4343
"coverage": "nyc report --reporter=text-lcov | coveralls",
4444
"coverage:report": "nyc report --reporter=lcov && echo \"view coverage: ./coverage/lcov-report/index.html\"",
45-
"lint": "eslint --ext .js .",
46-
"prepublishOnly": "npm run lint",
47-
"test": "npm run lint && nyc ava --verbose"
45+
"lint": "eslint .",
46+
"prepublishOnly": "run-p lint test",
47+
"test": "nyc ava --verbose"
4848
},
4949
"devDependencies": {
5050
"@babel/preset-react": "^7.0.0",
51-
"all-contributors-cli": "^6.1.2",
52-
"ava": "^1.2.1",
53-
"coveralls": "^3.0.3",
54-
"eslint": "^5.15.0",
55-
"eslint-plugin-react": "^7.12.4",
56-
"nyc": "^13.3.0",
57-
"react": "^16.8.3"
58-
},
59-
"ava": {
60-
"babel": {
61-
"testOptions": {
62-
"presets": [
63-
"@babel/preset-react"
64-
]
65-
}
66-
}
67-
},
68-
"nyc": {
69-
"include": [
70-
"index.js"
71-
]
51+
"all-contributors-cli": "^6.9.0",
52+
"ava": "^2.3.0",
53+
"coveralls": "^3.0.6",
54+
"eslint": "^6.3.0",
55+
"eslint-config-prettier": "^6.3.0",
56+
"eslint-plugin-prettier": "^3.1.0",
57+
"eslint-plugin-react": "^7.14.3",
58+
"husky": "^3.0.5",
59+
"lint-staged": "^9.2.5",
60+
"npm-run-all": "^4.1.5",
61+
"nyc": "^14.1.1",
62+
"prettier": "^1.18.2",
63+
"react": "^16.9.0"
7264
}
7365
}

test.js

+13-6
Original file line numberDiff line numberDiff line change
@@ -54,15 +54,22 @@ test('forwards matching group parts in Replacement params', t => {
5454
const ats = []
5555
const tags = []
5656
const replacement = (_, at, tag) => {
57-
if (at) { ats.push(at) }
58-
if (tag) { tags.push(tag) }
57+
if (at) {
58+
ats.push(at)
59+
}
60+
if (tag) {
61+
tags.push(tag)
62+
}
5963
}
6064
flexibleStringReplace(pattern, replacement, str)
6165

62-
t.deepEqual({ ats, tags }, {
63-
ats: [ '@diary' ],
64-
tags: [ '#passes', '#pray' ]
65-
})
66+
t.deepEqual(
67+
{ ats, tags },
68+
{
69+
ats: ['@diary'],
70+
tags: ['#passes', '#pray']
71+
}
72+
)
6673
})
6774

6875
test('regexp pattern & react interpolation function', t => {

0 commit comments

Comments
 (0)