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