Use XO for linting
This commit is contained in:
parent
fa597a9339
commit
fb1dc7ae42
|
@ -1,10 +0,0 @@
|
||||||
parserOptions:
|
|
||||||
ecmaVersion: 2018
|
|
||||||
sourceType: module
|
|
||||||
env:
|
|
||||||
node: true
|
|
||||||
extends:
|
|
||||||
- airbnb-base
|
|
||||||
- prettier
|
|
||||||
rules:
|
|
||||||
no-param-reassign: off
|
|
5
.vscode/settings.json
vendored
5
.vscode/settings.json
vendored
|
@ -1,7 +1,6 @@
|
||||||
{
|
{
|
||||||
"prettier.singleQuote": true,
|
|
||||||
"prettier.trailingComma": "es5",
|
|
||||||
"editor.rulers": [80, 100],
|
"editor.rulers": [80, 100],
|
||||||
"editor.formatOnSave": true,
|
"editor.formatOnSave": true,
|
||||||
"editor.tabSize": 2
|
"editor.tabSize": 2,
|
||||||
|
"xo.enable": true
|
||||||
}
|
}
|
||||||
|
|
16
package.json
16
package.json
|
@ -11,6 +11,14 @@
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
},
|
},
|
||||||
|
"xo": {
|
||||||
|
"prettier": true
|
||||||
|
},
|
||||||
|
"prettier": {
|
||||||
|
"singleQuote": true,
|
||||||
|
"trailingComma": "es5",
|
||||||
|
"useTabs": false
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/mime-types": "2.1.0",
|
"@types/mime-types": "2.1.0",
|
||||||
"caporal": "0.10.0",
|
"caporal": "0.10.0",
|
||||||
|
@ -24,12 +32,8 @@
|
||||||
"walkdir": "0.0.12"
|
"walkdir": "0.0.12"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"eslint": "5.4.0",
|
"nodemon": "1.18.3",
|
||||||
"eslint-config-airbnb-base": "13.1.0",
|
"xo": "0.23.0"
|
||||||
"eslint-config-prettier": "3.0.1",
|
|
||||||
"eslint-plugin-import": "2.14.0",
|
|
||||||
"eslint-plugin-jsx-a11y": "6.1.1",
|
|
||||||
"nodemon": "1.18.3"
|
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nodemon src/cli.js"
|
"dev": "nodemon src/cli.js"
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
|
// eslint-disable-next-line
|
||||||
require('./src/cli');
|
require('./src/cli');
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
|
const path = require('path');
|
||||||
const debugModule = require('debug');
|
const debugModule = require('debug');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const path = require('path');
|
|
||||||
const program = require('caporal');
|
const program = require('caporal');
|
||||||
|
const packageJson = require('../package.json');
|
||||||
const scan = require('./scan');
|
const scan = require('./scan');
|
||||||
const organise = require('./organise');
|
const organise = require('./organise');
|
||||||
const generate = require('./generate');
|
const generate = require('./generate');
|
||||||
|
|
||||||
const debug = debugModule('publikator:cli');
|
const debug = debugModule('publikator:cli');
|
||||||
const packageJson = require('../package.json');
|
|
||||||
|
|
||||||
process.on('unhandledRejection', error => {
|
process.on('unhandledRejection', error => {
|
||||||
throw error;
|
throw error;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const fs = require('fs-extra');
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const fs = require('fs-extra');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const yaml = require('js-yaml');
|
const yaml = require('js-yaml');
|
||||||
const debug = require('debug')('publikator:generate');
|
const debug = require('debug')('publikator:generate');
|
||||||
|
@ -8,8 +8,8 @@ const debug = require('debug')('publikator:generate');
|
||||||
* Collects unique values across a number of tracks.
|
* Collects unique values across a number of tracks.
|
||||||
*/
|
*/
|
||||||
const collect = (tracks, callback) => {
|
const collect = (tracks, callback) => {
|
||||||
const values = _.uniq(_.flatten(tracks.map(t => callback(t)))).filter(
|
const values = _.uniq(_.flatten(tracks.map(t => callback(t)))).filter(x =>
|
||||||
x => !!x
|
Boolean(x)
|
||||||
);
|
);
|
||||||
if (values.length === 0) {
|
if (values.length === 0) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const fs = require('fs-extra');
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const fs = require('fs-extra');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const sanitize = require('sanitize-filename');
|
const sanitize = require('sanitize-filename');
|
||||||
const debug = require('debug')('publikator:organise');
|
const debug = require('debug')('publikator:organise');
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
const debug = require('debug')('publikator:scan');
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
const debug = require('debug')('publikator:scan');
|
||||||
const walk = require('walkdir');
|
const walk = require('walkdir');
|
||||||
const tags = require('./tags');
|
const tags = require('./tags');
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ module.exports = {
|
||||||
tags.reduce((all, tag) => {
|
tags.reduce((all, tag) => {
|
||||||
const value = _.get(taggedFile, tag);
|
const value = _.get(taggedFile, tag);
|
||||||
if (value !== undefined) {
|
if (value !== undefined) {
|
||||||
all[tag] = value; // eslint-disable-line
|
all[tag] = value;
|
||||||
}
|
}
|
||||||
return all;
|
return all;
|
||||||
}, {}),
|
}, {}),
|
||||||
|
|
Loading…
Reference in a new issue