mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-22 18:29:26 +00:00
chore(cloudcmd) lint
This commit is contained in:
parent
1e853b040d
commit
4c7f8cc6b6
10 changed files with 16 additions and 37 deletions
|
|
@ -28,10 +28,10 @@ module.exports = {
|
|||
await run(TerminalRun, 'npm run build:client:dev');
|
||||
CloudCmd.refresh();
|
||||
},
|
||||
'P - Build Prod': async ({CloudCmd}) => {
|
||||
'P - Build Prod': ({CloudCmd}) => {
|
||||
const {TerminalRun} = CloudCmd;
|
||||
|
||||
run(TerminalRun, 'npm run build:client'),
|
||||
run(TerminalRun, 'npm run build:client');
|
||||
CloudCmd.refresh();
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,6 +19,5 @@ cssnano.config.js
|
|||
bin/release.js
|
||||
|
||||
client
|
||||
legacy
|
||||
server_
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ module.exports = {
|
|||
'plugin:node/recommended',
|
||||
],
|
||||
}, {
|
||||
files: ['{client,common}/**/*.js'],
|
||||
files: ['{client,common,static}/**/*.js'],
|
||||
env: {
|
||||
browser: true,
|
||||
},
|
||||
|
|
|
|||
23
.madrun.js
23
.madrun.js
|
|
@ -3,29 +3,10 @@
|
|||
const {
|
||||
run,
|
||||
parallel,
|
||||
predefined,
|
||||
} = require('madrun');
|
||||
|
||||
const {version} = require('./package');
|
||||
|
||||
const names = [
|
||||
'bin/cloudcmd.js',
|
||||
'client',
|
||||
'common',
|
||||
'server',
|
||||
'test',
|
||||
'bin/release.js',
|
||||
'webpack.config.js',
|
||||
'cssnano.config.js',
|
||||
'.webpack',
|
||||
'.eslintrc.js',
|
||||
'.madrun.js',
|
||||
'{client,server,common}/**/*.spec.js',
|
||||
'*.md',
|
||||
];
|
||||
|
||||
const {putout} = predefined;
|
||||
|
||||
const env = 'THREAD_IT_COUNT=0';
|
||||
const dockerName = 'coderaiser/cloudcmd';
|
||||
|
||||
|
|
@ -35,9 +16,7 @@ module.exports = {
|
|||
'build:start': () => run(['build:client', 'start']),
|
||||
'build:start:dev': () => run(['build:client:dev', 'start:dev']),
|
||||
'lint:all': () => run(['lint', 'lint:css', 'spell']),
|
||||
'lint': () => putout({
|
||||
names,
|
||||
}),
|
||||
'lint': () => 'putout .',
|
||||
'lint:css': () => 'stylelint css/*.css',
|
||||
'spell': () => 'yaspeller .',
|
||||
'fix:lint': () => run(['lint', 'lint:css'], '--fix'),
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
{
|
||||
"ignore": [
|
||||
"fixture*",
|
||||
"dist*"
|
||||
"dist*",
|
||||
"app.json",
|
||||
"fontello.json"
|
||||
],
|
||||
"match": {
|
||||
"import.spec.js|console.js": {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ language: node_js
|
|||
node_js:
|
||||
- 15
|
||||
- 14
|
||||
- 12
|
||||
|
||||
cache:
|
||||
npm: false
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ test('util: findObjByNameInArr: array', (t) => {
|
|||
test('util: getRegExp', (t) => {
|
||||
const reg = getRegExp('hel?o.*');
|
||||
|
||||
t.deepEqual(reg, RegExp('^hel.?o\\..*$'), 'should return regexp');
|
||||
t.deepEqual(reg, /^hel.?o\..*$/, 'should return regexp');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
@ -103,7 +103,7 @@ test('util: getRegExp: dots', (t) => {
|
|||
test('util: getRegExp: no', (t) => {
|
||||
const reg = getRegExp('');
|
||||
|
||||
t.deepEqual(reg, RegExp('^$'), 'should return regexp');
|
||||
t.deepEqual(reg, /^$/, 'should return regexp');
|
||||
t.end();
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ function rest(config, request, response) {
|
|||
*/
|
||||
function sendData(params, config, callback) {
|
||||
const p = params;
|
||||
const isMD = RegExp('^/markdown').test(p.name);
|
||||
const isMD = /^\/markdown/.test(p.name);
|
||||
const rootDir = config('root');
|
||||
|
||||
if (isMD)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
'use strict';
|
||||
|
||||
const RENAME_FILE= 'Rename file';
|
||||
const RENAME_FILE = 'Rename file';
|
||||
|
||||
module.exports = {
|
||||
__settings: {
|
||||
'__settings': {
|
||||
select: [
|
||||
RENAME_FILE,
|
||||
],
|
||||
|
|
@ -27,7 +27,7 @@ module.exports = {
|
|||
CloudCmd,
|
||||
});
|
||||
},
|
||||
'D - Compare directories': async ({DOM}) => {
|
||||
'D - Compare directories': ({DOM}) => {
|
||||
const {
|
||||
CurrentInfo,
|
||||
getFilenames,
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ test('cloudcmd: static: user menu: compare directories', async (t) => {
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: static: user menu: compare directories: select names', async (t) => {
|
||||
test('cloudcmd: static: user menu: compare directories: select names', (t) => {
|
||||
const {_selectNames} = defaultMenu;
|
||||
const selectFile = stub();
|
||||
const file = {};
|
||||
|
|
@ -142,7 +142,7 @@ test('cloudcmd: static: user menu: compare directories: select names', async (t)
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: static: user menu: compare directories: select names: getCurrentByName', async (t) => {
|
||||
test('cloudcmd: static: user menu: compare directories: select names: getCurrentByName', (t) => {
|
||||
const {_selectNames} = defaultMenu;
|
||||
const selectFile = stub();
|
||||
const getCurrentByName = stub();
|
||||
|
|
@ -160,7 +160,7 @@ test('cloudcmd: static: user menu: compare directories: select names: getCurrent
|
|||
t.end();
|
||||
});
|
||||
|
||||
test('cloudcmd: static: user menu: compare directories: select names: compare', async (t) => {
|
||||
test('cloudcmd: static: user menu: compare directories: select names: compare', (t) => {
|
||||
const {_compare} = defaultMenu;
|
||||
const a = [1, 2];
|
||||
const b = [1, 3];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue