Skip to content

Commit

Permalink
chore(cloudcmd) lint
Browse files Browse the repository at this point in the history
  • Loading branch information
coderaiser committed Aug 5, 2019
1 parent a021090 commit a3ef3ae
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 17 deletions.
24 changes: 16 additions & 8 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
'use strict';

module.exports = {
env: {
browser: true,
},
rules: {
'no-console': 0,
},
extends: [
'plugin:putout/recommended',
],
Expand All @@ -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,
},
}],
};
3 changes: 1 addition & 2 deletions client/dom/upload-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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) {
Expand Down
3 changes: 1 addition & 2 deletions common/cloudfunc.spec.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
8 changes: 5 additions & 3 deletions madrun.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const {
} = require('madrun');

const {version} = require('./package');
const {eslint} = predefined;

const names = [
'bin/cloudcmd.js',
Expand All @@ -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'`,
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 1 addition & 2 deletions server/rest/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit a3ef3ae

Please sign in to comment.