Skip to content

Commit 1e1b1c7

Browse files
chore(package): update xo to version 0.20.3 (#16)
* chore(package): update xo to version 0.20.3 Closes #14 * refactor: adapt changes to the latest `xo`
1 parent ca6d3ae commit 1e1b1c7

File tree

3 files changed

+38
-41
lines changed

3 files changed

+38
-41
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ notifications:
44
node_js:
55
- '8'
66
- '6'
7-
script:
8-
- node node_modules/.bin/prettier -l "*.{js,json,md}"
9-
- npm test
107
after_success: if [[ `npm -v` > 4* ]]; then npx codecov; fi
118
branches:
129
only:

package.json

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"node": ">=6"
1414
},
1515
"scripts": {
16-
"precommit": "remove-lockfiles && xo --fix && lint-staged",
16+
"precommit": "remove-lockfiles && lint-staged",
1717
"pretest": "remove-lockfiles",
1818
"test:watch": "jest --watch",
1919
"test": "xo && jest --coverage"
@@ -31,28 +31,32 @@
3131
"husky": "^0.14.3",
3232
"jest": "^22.0.4",
3333
"lint-staged": "^7.0.0",
34-
"prettier": "^1.9.2",
3534
"remove-lockfiles": "^2.0.4",
36-
"xo": "^0.18.2"
35+
"xo": "^0.20.3"
3736
},
3837
"jest": {
3938
"testEnvironment": "node"
4039
},
4140
"lint-staged": {
42-
"*.{js,json,md}": [
41+
"*.js": [
42+
"xo --fix",
43+
"git add"
44+
],
45+
"*.{json,md}": [
4346
"prettier --write",
4447
"git add"
4548
]
4649
},
4750
"prettier": {
48-
"singleQuote": true,
49-
"trailingComma": "es5"
51+
"bracketSpacing": true,
52+
"singleQuote": true
5053
},
5154
"xo": {
52-
"extends": "prettier",
5355
"envs": [
5456
"jest"
55-
]
57+
],
58+
"prettier": true,
59+
"space": true
5660
},
5761
"keywords": [
5862
"yarn",

test.js

Lines changed: 26 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
11
'use strict';
22

3-
const hasLockfile = require('./');
3+
const hasLockfile = require('.');
44

5-
describe('output', () => {
6-
test('no lockfiles', () => {
7-
expect(hasLockfile()).toBe(false);
8-
expect(hasLockfile.lockfiles()).toEqual([]);
9-
});
5+
test('no lockfiles', () => {
6+
expect(hasLockfile()).toBe(false);
7+
expect(hasLockfile.lockfiles()).toEqual([]);
8+
});
109

11-
test('package-lock.json', () => {
12-
expect(hasLockfile('fixtures/bar')).toBe(true);
13-
expect(hasLockfile.lockfiles('fixtures/bar')).toEqual([
14-
'package-lock.json',
15-
]);
16-
});
10+
test('package-lock.json', () => {
11+
expect(hasLockfile('fixtures/bar')).toBe(true);
12+
expect(hasLockfile.lockfiles('fixtures/bar')).toEqual(['package-lock.json']);
13+
});
1714

18-
test('yarn.lock', () => {
19-
expect(hasLockfile('fixtures/baz')).toBe(true);
20-
expect(hasLockfile.lockfiles('fixtures/baz')).toEqual(['yarn.lock']);
21-
});
15+
test('yarn.lock', () => {
16+
expect(hasLockfile('fixtures/baz')).toBe(true);
17+
expect(hasLockfile.lockfiles('fixtures/baz')).toEqual(['yarn.lock']);
18+
});
2219

23-
test('npm-shrinkwrap.json', () => {
24-
expect(hasLockfile('fixtures/foo')).toBe(true);
25-
expect(hasLockfile.lockfiles('fixtures/foo')).toEqual([
26-
'npm-shrinkwrap.json',
27-
]);
28-
});
20+
test('npm-shrinkwrap.json', () => {
21+
expect(hasLockfile('fixtures/foo')).toBe(true);
22+
expect(hasLockfile.lockfiles('fixtures/foo')).toEqual([
23+
'npm-shrinkwrap.json',
24+
]);
25+
});
2926

30-
test('all lockfiles', () => {
31-
expect(hasLockfile('fixtures/qux')).toBe(true);
32-
expect(hasLockfile.lockfiles('fixtures/qux')).toEqual([
33-
'package-lock.json',
34-
'yarn.lock',
35-
'npm-shrinkwrap.json',
36-
]);
37-
});
27+
test('all lockfiles', () => {
28+
expect(hasLockfile('fixtures/qux')).toBe(true);
29+
expect(hasLockfile.lockfiles('fixtures/qux')).toEqual([
30+
'package-lock.json',
31+
'yarn.lock',
32+
'npm-shrinkwrap.json',
33+
]);
3834
});

0 commit comments

Comments
 (0)