Skip to content

Commit ca4a016

Browse files
committed
chore(formatify) madrun
1 parent dc1b194 commit ca4a016

File tree

8 files changed

+51
-37
lines changed

8 files changed

+51
-37
lines changed

.eslintrc

Lines changed: 0 additions & 19 deletions
This file was deleted.

.eslintrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"extends": [
3+
"plugin:putout/recommended",
4+
"plugin:node/recommended"
5+
],
6+
"plugins": [
7+
"putout",
8+
"node"
9+
]
10+
}

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ coverage
55

66
*.swp
77

8+
madrun.js
9+

lib/formatify.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ function check(files) {
1919

2020
function replaceDate(stat) {
2121
const date = !stat.date ? '' : shortdate(stat.date, {
22-
order: 'little'
22+
order: 'little',
2323
});
2424

2525
return Object.assign(stat, {
26-
date
26+
date,
2727
});
2828
}
2929

@@ -32,15 +32,15 @@ function replaceMode(stat) {
3232
const mode = format.permissions.symbolic(octal);
3333

3434
return Object.assign(stat, {
35-
mode
35+
mode,
3636
});
3737
}
3838

3939
function replaceSize(stat) {
4040
const size = format.size(stat.size);
4141

4242
return Object.assign(stat, {
43-
size
43+
size,
4444
});
4545
}
4646

madrun.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
'use strict';
2+
3+
const {run} = require('madrun');
4+
5+
module.exports = {
6+
'lint': () => 'putout lib test madrun.js',
7+
'fix:lint': () => run('lint', '--fix'),
8+
'report': () => 'nyc report --reporter=text-lcov | coveralls',
9+
'coverage': () => 'nyc npm test',
10+
'test': () => 'tape test/*.js',
11+
'watch:coverage': () => run('watcher', 'npm run coverage'),
12+
'watch:test': () => run('watcher', 'npm test'),
13+
'watcher': () => 'nodemon -w test -w lib --exec',
14+
};
15+

package.json

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
"url": "git://github.com/cloudcmd/formatify.git"
1010
},
1111
"scripts": {
12-
"lint": "redrun lint:*",
13-
"lint:eslint:lib": "eslint lib",
14-
"lint:eslint:test": "eslint -c .eslintrc.test test --no-eslintrc",
15-
"report": "nyc report --reporter=text-lcov | coveralls",
16-
"coverage": "nyc npm test",
17-
"test": "tape test/*.js",
18-
"watch:coverage": "npm run watcher -- npm run coverage",
19-
"watch:test": "npm run watcher -- npm test",
20-
"watcher": "nodemon -w test -w lib --exec"
12+
"lint": "madrun lint",
13+
"fix:lint": "madrun fix:lint",
14+
"lint:eslint:lib": "madrun lint:eslint:lib",
15+
"lint:eslint:test": "madrun lint:eslint:test",
16+
"report": "madrun report",
17+
"coverage": "madrun coverage",
18+
"test": "madrun test",
19+
"watch:coverage": "madrun watch:coverage",
20+
"watch:test": "madrun watch:test",
21+
"watcher": "madrun watcher"
2122
},
2223
"dependencies": {
2324
"format-io": "^2.0.0",
@@ -39,8 +40,13 @@
3940
"devDependencies": {
4041
"coveralls": "^3.0.0",
4142
"eslint": "^6.4.0",
43+
"eslint-plugin-node": "^10.0.0",
44+
"eslint-plugin-putout": "^2.0.0",
45+
"madrun": "^3.0.5",
4246
"mkdirp": "^0.5.1",
4347
"nodemon": "^1.11.0",
44-
"nyc": "^14.1.1"
48+
"nyc": "^14.1.1",
49+
"putout": "^6.1.0",
50+
"supertape": "^1.2.3"
4551
}
4652
}

test/fixture.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ module.exports.libDir = {
2929
size: 'dir',
3030
date: '',
3131
owner: 0,
32-
mode: 'rw- rw- r--'
32+
mode: 'rw- rw- r--',
3333
};
3434

test/formatify.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
const formatify = require('..');
4-
const test = require('tape');
4+
const test = require('supertape');
55

66
const {
77
testDir,
@@ -14,10 +14,10 @@ const {
1414
testRaw,
1515
libRaw,
1616
readifyRaw,
17-
sortifyRaw
17+
sortifyRaw,
1818
} = require('./fixture-raw');
1919

20-
test('arguments: exception when no files', t => {
20+
test('arguments: exception when no files', (t) => {
2121
t.throws(formatify, /files should be an array!/, 'should throw when no files');
2222
t.end();
2323
});

0 commit comments

Comments
 (0)