chore(eslint) add indentation rule

This commit is contained in:
coderaiser 2016-12-20 10:34:40 +02:00
parent 3e1db58144
commit f46f7e1e74
6 changed files with 40 additions and 37 deletions

View file

@ -7,5 +7,8 @@
"ecmaVersion": 6,
"sourceType": "module"
},
"rules": {
"indent": ["error", 4]
},
"extends": ["eslint:recommended"]
}

View file

@ -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);
}

View file

@ -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;
}
};

View file

@ -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);
});
}

View file

@ -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');

View file

@ -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',
}
};
}