mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 02:35:49 +00:00
chore: lint
This commit is contained in:
parent
4b9267f375
commit
ea929465a8
29 changed files with 42 additions and 19 deletions
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
|
|
@ -14,9 +14,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
node-version: 16.x
|
node-version: 16.x
|
||||||
- name: Install Redrun
|
- name: Install Redrun
|
||||||
run: npm i redrun -g
|
run: bun i redrun -g --no-save
|
||||||
- name: NPM Install
|
- name: NPM Install
|
||||||
run: npm install
|
run: bun i --no-save
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: redrun lint
|
run: redrun lint
|
||||||
- name: Build
|
- name: Build
|
||||||
|
|
|
||||||
7
.github/workflows/nodejs.yml
vendored
7
.github/workflows/nodejs.yml
vendored
|
|
@ -14,14 +14,17 @@ jobs:
|
||||||
- 20.x
|
- 20.x
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
- uses: oven-sh/setup-bun@v1
|
||||||
|
with:
|
||||||
|
bun-version: latest
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- name: Install Redrun
|
- name: Install Redrun
|
||||||
run: npm i redrun -g
|
run: bun i redrun -g --no-save
|
||||||
- name: Install
|
- name: Install
|
||||||
run: npm install
|
run: bun i --no-save
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: redrun fix:lint
|
run: redrun fix:lint
|
||||||
- uses: actions/cache@v3
|
- uses: actions/cache@v3
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import process from 'node:process';
|
||||||
import {
|
import {
|
||||||
run,
|
run,
|
||||||
cutEnv,
|
cutEnv,
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const {
|
||||||
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
const ExtractTextPlugin = require('extract-text-webpack-plugin');
|
||||||
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
const OptimizeCssAssetsPlugin = require('optimize-css-assets-webpack-plugin');
|
||||||
|
|
||||||
const {env} = process;
|
const {env} = require('process');
|
||||||
const isDev = env.NODE_ENV === 'development';
|
const isDev = env.NODE_ENV === 'development';
|
||||||
|
|
||||||
const extractCSS = (a) => new ExtractTextPlugin(`${a}.css`);
|
const extractCSS = (a) => new ExtractTextPlugin(`${a}.css`);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
const HtmlWebpackPlugin = require('html-webpack-plugin');
|
||||||
const {env} = process;
|
const {env} = require('process');
|
||||||
|
|
||||||
const isDev = env.NODE_ENV === 'development';
|
const isDev = env.NODE_ENV === 'development';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,11 +11,10 @@ const WebpackBar = require('webpackbar');
|
||||||
|
|
||||||
const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin');
|
const ServiceWorkerWebpackPlugin = require('serviceworker-webpack-plugin');
|
||||||
|
|
||||||
const dir = './client';
|
const {env} = require('process');
|
||||||
const dirModules = './client/modules';
|
|
||||||
const modules = './modules';
|
const modules = './modules';
|
||||||
|
const dirModules = './client/modules';
|
||||||
const {env} = process;
|
const dir = './client';
|
||||||
const {NODE_ENV} = env;
|
const {NODE_ENV} = env;
|
||||||
const isDev = NODE_ENV === 'development';
|
const isDev = NODE_ENV === 'development';
|
||||||
|
|
||||||
|
|
|
||||||
4
HELP.md
4
HELP.md
|
|
@ -669,7 +669,7 @@ npm i cloudcmd express socket.io -S
|
||||||
And create `index.js`:
|
And create `index.js`:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import http from 'http';
|
import http from 'node:http';
|
||||||
import cloudcmd from 'cloudcmd';
|
import cloudcmd from 'cloudcmd';
|
||||||
import {Server} from 'socket.io';
|
import {Server} from 'socket.io';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
|
@ -722,7 +722,7 @@ server.listen(port);
|
||||||
Here is example with two `Config Managers`:
|
Here is example with two `Config Managers`:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import http from 'http';
|
import http from 'node:http';
|
||||||
import cloudcmd from 'cloudcmd';
|
import cloudcmd from 'cloudcmd';
|
||||||
import {Server} from 'socket.io';
|
import {Server} from 'socket.io';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ npm i cloudcmd express socket.io -S
|
||||||
And create `index.js`:
|
And create `index.js`:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
import http from 'http';
|
import http from 'node:http';
|
||||||
import cloudcmd from 'cloudcmd';
|
import cloudcmd from 'cloudcmd';
|
||||||
import {Server} from 'socket.io';
|
import {Server} from 'socket.io';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,11 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
import {createRequire} from 'module';
|
import {createRequire} from 'node:module';
|
||||||
import {promisify} from 'util';
|
import {promisify} from 'node:util';
|
||||||
import tryToCatch from 'try-to-catch';
|
import tryToCatch from 'try-to-catch';
|
||||||
import {createSimport} from 'simport';
|
import {createSimport} from 'simport';
|
||||||
import parse from 'yargs-parser';
|
import parse from 'yargs-parser';
|
||||||
|
import process from 'node:process';
|
||||||
import exit from '../server/exit.js';
|
import exit from '../server/exit.js';
|
||||||
import {
|
import {
|
||||||
createConfig,
|
createConfig,
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
import {promisify} from 'util';
|
import {promisify} from 'node:util';
|
||||||
import tryToCatch from 'try-to-catch';
|
import tryToCatch from 'try-to-catch';
|
||||||
import {createSimport} from 'simport';
|
import {createSimport} from 'simport';
|
||||||
import minor from 'minor';
|
import minor from 'minor';
|
||||||
import _place from 'place';
|
import _place from 'place';
|
||||||
import rendy from 'rendy';
|
import rendy from 'rendy';
|
||||||
import shortdate from 'shortdate';
|
import shortdate from 'shortdate';
|
||||||
|
import process from 'node:process';
|
||||||
|
|
||||||
const simport = createSimport(import.meta.url);
|
const simport = createSimport(import.meta.url);
|
||||||
const place = promisify(_place);
|
const place = promisify(_place);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
/* global DOM */
|
/* global DOM */
|
||||||
const Emitify = require('emitify');
|
const Emitify = require('emitify');
|
||||||
const inherits = require('inherits');
|
const inherits = require('inherits');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
require('../css/main.css');
|
require('../css/main.css');
|
||||||
require('../css/nojs.css');
|
require('../css/nojs.css');
|
||||||
require('../css/columns/name-size-date.css');
|
require('../css/columns/name-size-date.css');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const codegen = require('codegen.macro');
|
const codegen = require('codegen.macro');
|
||||||
const tryToCatch = require('try-to-catch');
|
const tryToCatch = require('try-to-catch');
|
||||||
const currify = require('currify');
|
const currify = require('currify');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const DIR = `${__dirname}/`;
|
const DIR = `${__dirname}/`;
|
||||||
const DIR_COMMON = `${DIR}../common/`;
|
const DIR_COMMON = `${DIR}../common/`;
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
const {test, stub} = require('supertape');
|
const {test, stub} = require('supertape');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const readFilesSync = require('@cloudcmd/read-files-sync');
|
const readFilesSync = require('@cloudcmd/read-files-sync');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const test = require('supertape');
|
const test = require('supertape');
|
||||||
const {promisify} = require('util');
|
const {promisify} = require('util');
|
||||||
const tryToCatch = require('try-to-catch');
|
const tryToCatch = require('try-to-catch');
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
const snake = require('just-snake-case');
|
const snake = require('just-snake-case');
|
||||||
|
|
||||||
const {env} = process;
|
const {env} = require('process');
|
||||||
const up = (a) => a.toUpperCase();
|
const up = (a) => a.toUpperCase();
|
||||||
|
|
||||||
module.exports = parse;
|
module.exports = parse;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const test = require('supertape');
|
const test = require('supertape');
|
||||||
const env = require('./env');
|
const env = require('./env');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const getMessage = (a) => a?.message || a;
|
const getMessage = (a) => a?.message || a;
|
||||||
|
|
||||||
module.exports = (...args) => {
|
module.exports = (...args) => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const {test, stub} = require('supertape');
|
const {test, stub} = require('supertape');
|
||||||
|
|
||||||
const exit = require('./exit');
|
const exit = require('./exit');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const net = require('net');
|
const net = require('net');
|
||||||
const repl = require('repl');
|
const repl = require('repl');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const DIR = '../';
|
const DIR = '../';
|
||||||
const DIR_COMMON = `${DIR}../common/`;
|
const DIR_COMMON = `${DIR}../common/`;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const format = require('format-io');
|
const format = require('format-io');
|
||||||
|
|
||||||
const {version} = require('../../package');
|
const {version} = require('../../package');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const {test, stub} = require('supertape');
|
const {test, stub} = require('supertape');
|
||||||
|
|
||||||
const info = require('./info');
|
const info = require('./info');
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import cloudcmd from './cloudcmd.js';
|
import cloudcmd from './cloudcmd.js';
|
||||||
import http from 'http';
|
import http from 'node:http';
|
||||||
import {promisify} from 'util';
|
import {promisify} from 'node:util';
|
||||||
import currify from 'currify';
|
import currify from 'currify';
|
||||||
import squad from 'squad';
|
import squad from 'squad';
|
||||||
import tryToCatch from 'try-to-catch';
|
import tryToCatch from 'try-to-catch';
|
||||||
|
|
@ -12,6 +12,7 @@ import opn from 'open';
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
import {Server} from 'socket.io';
|
import {Server} from 'socket.io';
|
||||||
import tryRequire from 'tryrequire';
|
import tryRequire from 'tryrequire';
|
||||||
|
import process from 'node:process';
|
||||||
|
|
||||||
const bind = (f, self) => f.bind(self);
|
const bind = (f, self) => f.bind(self);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const http = require('http');
|
const http = require('http');
|
||||||
const os = require('os');
|
const os = require('os');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const test = require('supertape');
|
const test = require('supertape');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const {reRequire} = require('mock-require');
|
const {reRequire} = require('mock-require');
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
const process = require('process');
|
||||||
const test = require('supertape');
|
const test = require('supertape');
|
||||||
const env = require('../../server/env');
|
const env = require('../../server/env');
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue