chore(cloudcmd) lint

This commit is contained in:
coderaiser 2019-08-05 18:10:16 +03:00
parent a021090dc9
commit a3ef3ae60d
6 changed files with 25 additions and 17 deletions

View file

@ -1,12 +1,6 @@
'use strict';
module.exports = {
env: {
browser: true,
},
rules: {
'no-console': 0,
},
extends: [
'plugin:putout/recommended',
],
@ -15,12 +9,26 @@ module.exports = {
'node',
],
overrides: [{
files: ['server'],
files: ['bin/release.js'],
rules: {
'no-process-exit': 0,
'no-console': 'off',
'node/shebang': 'off',
},
extends: [
'plugin:node/recommended',
],
},{
files: ['bin/cloudcmd.js'],
rules: {
'no-console': 'off',
},
extends: [
'plugin:node/recommended',
],
}, {
files: ['{client,common}/**/*.js'],
env: {
browser: true,
},
}],
};

View file

@ -5,7 +5,6 @@
const {eachSeries} = require('execon');
const wraptile = require('wraptile/legacy');
const DOM = require('.');
const load = require('./load');
const Images = require('./images');
const {alert} = require('./dialog');
@ -15,7 +14,7 @@ const {FS} = require('../../common/cloudfunc');
const onEnd = wraptile(_onEnd);
const loadFile = wraptile(_loadFile);
const {getCurrentDirPath: getPathWhenRootEmpty} = DOM;
const {getCurrentDirPath: getPathWhenRootEmpty} = require('.');
module.exports = (dir, files) => {
if (!files) {

View file

@ -1,8 +1,7 @@
'use strict';
const test = require('supertape');
const cloudfunc = require('./cloudfunc');
const {_getSize} = cloudfunc;
const {_getSize} = require('./cloudfunc');
test('cloudfunc: getSize: dir', (t) => {
const type = 'directory';

View file

@ -7,7 +7,6 @@ const {
} = require('madrun');
const {version} = require('./package');
const {eslint} = predefined;
const names = [
'bin/cloudcmd.js',
@ -24,16 +23,19 @@ const names = [
'{client,server,common}/**/*.spec.js',
];
const {putout} = predefined;
module.exports = {
'start': () => 'node bin/cloudcmd.js',
'start:dev': () => `NODE_ENV=development ${run('start')}`,
'build:start': () => run(['build:client', 'start']),
'build:start:dev': () => run(['build:client:dev', 'start:dev']),
'lint:all': () => run(['lint', 'lint:css', 'spell']),
'lint': () => eslint({names}),
'lint': () => putout(names),
'lint:css': () => 'stylelint css/*.css',
'spell': () => 'yaspeller .',
'fix:lint': () => run('lint', '--fix'),
'fix:lint': () => run(['lint', 'lint:css'], '--fix'),
'lint:progress': () => run('lint', '-f progress'),
'test': () => `tape 'test/**/*.js' '{client,static,common,server}/**/*.spec.js'`,
'test:client': () => `tape 'test/client/**/*.js`,
'test:server': () => `tape 'test/**/*.js' 'server/**/*.spec.js' 'common/**/*.spec.js'`,

View file

@ -54,6 +54,7 @@
"lint:css": "madrun lint:css",
"spell": "madrun spell",
"fix:lint": "madrun fix:lint",
"lint:progress": "madrun lint:progress",
"test": "madrun test",
"test:client": "madrun test:client",
"test:server": "madrun test:server",

View file

@ -3,14 +3,13 @@
const test = require('supertape');
const tryToCatch = require('try-to-catch');
const rest = require('.');
const {
_formatMsg,
_getWin32RootMsg,
_isRootWin32,
_isRootAll,
_onPUT,
} = rest;
} = require('.');
test('rest: formatMsg', (t) => {
const result = _formatMsg('hello', 'world');