mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-07-18 00:47:01 +00:00
chore(eslint) add indentation rule
This commit is contained in:
parent
3e1db58144
commit
f46f7e1e74
6 changed files with 40 additions and 37 deletions
|
|
@ -7,5 +7,8 @@
|
|||
"ecmaVersion": 6,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"indent": ["error", 4]
|
||||
},
|
||||
"extends": ["eslint:recommended"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ const dir = path.join(__dirname, '../lib/server');
|
|||
const _dir = path.join(__dirname, '../legacy/lib/server');
|
||||
|
||||
const setDir = (name) => {
|
||||
return path.join(_dir, name);
|
||||
return path.join(_dir, name);
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -18,13 +18,13 @@ fs.readdirSync(dir)
|
|||
.map(writeFile);
|
||||
|
||||
function fillFile(name) {
|
||||
return {
|
||||
name: setDir(name),
|
||||
data: `module.exports = require(\'../../../lib_/server/${name}\');`
|
||||
}
|
||||
return {
|
||||
name: setDir(name),
|
||||
data: `module.exports = require(\'../../../lib_/server/${name}\');`
|
||||
}
|
||||
}
|
||||
|
||||
function writeFile({name, data}) {
|
||||
return fs.writeFileSync(name, data);
|
||||
return fs.writeFileSync(name, data);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -16,30 +16,30 @@ module.exports = (name, request, callback) => {
|
|||
check(name, request, callback);
|
||||
|
||||
switch(method) {
|
||||
case 'GET':
|
||||
name = name.replace('/markdown', '');
|
||||
case 'GET':
|
||||
name = name.replace('/markdown', '');
|
||||
|
||||
if (query === 'relative')
|
||||
name = DIR_ROOT + name;
|
||||
else
|
||||
if (query === 'relative')
|
||||
name = DIR_ROOT + name;
|
||||
else
|
||||
name = root(name);
|
||||
|
||||
fs.readFile(name, 'utf8', (error, data) => {
|
||||
if (error)
|
||||
return callback(error);
|
||||
fs.readFile(name, 'utf8', (error, data) => {
|
||||
if (error)
|
||||
return callback(error);
|
||||
|
||||
parse(data, callback);
|
||||
});
|
||||
break;
|
||||
parse(data, callback);
|
||||
});
|
||||
break;
|
||||
|
||||
case 'PUT':
|
||||
pullout(request, 'string', (error, data) => {
|
||||
if (error)
|
||||
return callback(error);
|
||||
case 'PUT':
|
||||
pullout(request, 'string', (error, data) => {
|
||||
if (error)
|
||||
return callback(error);
|
||||
|
||||
parse(data, callback);
|
||||
});
|
||||
break;
|
||||
parse(data, callback);
|
||||
});
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -86,11 +86,11 @@ function indexProcessing(options) {
|
|||
.replace('icon-copy', 'icon-copy none');
|
||||
|
||||
if (noConfig)
|
||||
data = data
|
||||
data = data
|
||||
.replace('icon-config', 'icon-config none');
|
||||
|
||||
if (noConsole)
|
||||
data = data
|
||||
data = data
|
||||
.replace('icon-console', 'icon-console none');
|
||||
|
||||
left = rendy(Template.panel, {
|
||||
|
|
@ -231,7 +231,7 @@ function buildIndex(json, callback) {
|
|||
callback(error, data);
|
||||
});
|
||||
}, (callback) => {
|
||||
minify(PATH_INDEX, 'name', callback);
|
||||
minify(PATH_INDEX, 'name', callback);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ var DIR = __dirname + '/../../',
|
|||
'</div>';
|
||||
|
||||
test(function(t) {
|
||||
var paths = {},
|
||||
var paths = {},
|
||||
|
||||
filesList = TMPL_PATH.map(function(name) {
|
||||
var path = FS_DIR + name + '.hbs';
|
||||
|
|
@ -109,9 +109,9 @@ test(function(t) {
|
|||
'Expect: {{ expect }}',
|
||||
'Result: {{ result }}'
|
||||
].join('\n'), {
|
||||
number: i,
|
||||
expect: Expect.substr(i),
|
||||
result: result.substr(i)
|
||||
number: i,
|
||||
expect: Expect.substr(i),
|
||||
result: result.substr(i)
|
||||
}));
|
||||
|
||||
console.log('buildFromJSON: Not OK');
|
||||
|
|
|
|||
|
|
@ -219,12 +219,12 @@ test('cloudcmd: rest: pack: zip: put: error', (t) => {
|
|||
|
||||
function getPackOptions(port, to, names = ['pack']) {
|
||||
return {
|
||||
url: `http://localhost:${port}/api/v1/pack`,
|
||||
json: {
|
||||
to,
|
||||
names,
|
||||
from: '/fixture',
|
||||
}
|
||||
url: `http://localhost:${port}/api/v1/pack`,
|
||||
json: {
|
||||
to,
|
||||
names,
|
||||
from: '/fixture',
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue