GeezerVison is showing github.com — chore: 修改 code style 以及配置 lint & test action · selectgithub/lowcode-engine@a8de4b9
File treeExpand file treeCollapse file tree Open diff view settings material-parser/src/parse
react-simulator-renderer/src/utils
Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboard +33Lines changed: 33 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
| | 1 | +name: lint & test | | 2 | + | | 3 | +on: [push, pull_request] | | 4 | + | | 5 | +jobs: | | 6 | + setup: | | 7 | + runs-on: ubuntu-latest | | 8 | + steps: | | 9 | + - name: checkout | | 10 | + uses: actions/checkout@v2 | | 11 | + | | 12 | + - name: install | | 13 | + run: npm i && npm run setup:skip-build | | 14 | + | | 15 | + lint: | | 16 | + runs-on: ubuntu-latest | | 17 | + steps: | | 18 | + - name: checkout | | 19 | + uses: actions/checkout@v2 | | 20 | + | | 21 | + - name: lint | | 22 | + run: npm run lint | | 23 | + needs: setup | | 24 | + | | 25 | + test-designer: | | 26 | + runs-on: ubuntu-latest | | 27 | + steps: | | 28 | + - name: checkout | | 29 | + uses: actions/checkout@v2 | | 30 | + | | 31 | + - name: lint | | 32 | + run: cd packages/designer && npm test | | 33 | + needs: setup |
Collapse file Copy file name to clipboardExpand all lines: modules/code-generator/src/utils/resultHelper.ts +1-2Lines changed: 1 addition & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -53,7 +53,6 @@ export function flattenResult(dir: ResultDir, cwd = ''): FlattenFile[] { | 53 | 53 | ), | 54 | 54 | ].concat( | 55 | 55 | ...dir.dirs.map((subDir) => | 56 | | - flattenResult(subDir, [cwd, subDir.name].filter((x) => x !== '' && x !== '.').join('/')), | 57 | | - ), | | 56 | + flattenResult(subDir, [cwd, subDir.name].filter((x) => x !== '' && x !== '.').join('/'))), | 58 | 57 | ); | 59 | 58 | } |
Collapse file Copy file name to clipboardExpand all lines: modules/material-parser/src/parse/js/resolver/resolveImport.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -50,6 +50,7 @@ export function resolveToImport(initialPath) { | 50 | 50 | } | 51 | 51 | pathBuffer.unshift(...paths); | 52 | 52 | } | | 53 | + // eslint-disable-next-line no-fallthrough | 53 | 54 | case 'Identifier': | 54 | 55 | case 'JSXIdentifier': { | 55 | 56 | const valuePath = resolveToValue(path); | |
Collapse file Copy file name to clipboardExpand all lines: modules/material-parser/src/parse/js/utils/getComposedPath.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -25,6 +25,7 @@ export default function getComposedPropTypesPath(documentation, propName, p) { | 25 | 25 | const ast = parser.parse(fileContent); | 26 | 26 |
| 27 | 27 | visit(ast, { | | 28 | + // eslint-disable-next-line no-loop-func | 28 | 29 | visitAssignmentExpression(path: any) { | 29 | 30 | // Ignore anything that is not `exports.X = ...;` or | 30 | 31 | // `module.exports = ...;` | |
Collapse file Copy file name to clipboardExpand all lines: modules/material-parser/src/parse/ts/index.ts +2-4Lines changed: 2 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -299,8 +299,7 @@ function getDocgenTypeHelper( | 299 | 299 | name: 'union', | 300 | 300 | // @ts-ignore | 301 | 301 | value: type.types.map((t) => | 302 | | - getDocgenTypeHelper(checker, t, true, getNextParentIds(parentIds, type)), | 303 | | - ), | | 302 | + getDocgenTypeHelper(checker, t, true, getNextParentIds(parentIds, type))), | 304 | 303 | }); | 305 | 304 | } else if (isComplexType(type)) { | 306 | 305 | return makeResult({ | @@ -494,8 +493,7 @@ export default function parseTS(filePath: string, args: IParseArgs): ComponentDo | 494 | 493 |
| 495 | 494 | log('ts config path is', tsConfigPath); | 496 | 495 | const { config, error } = ts.readConfigFile(tsConfigPath, (filename) => | 497 | | - readFileSync(filename, 'utf8'), | 498 | | - ); | | 496 | + readFileSync(filename, 'utf8')); | 499 | 497 |
| 500 | 498 | if (error !== undefined) { | 501 | 499 | const errorText = `Cannot load custom tsconfig.json from provided path: ${tsConfigPath}, with error code: ${error.code}, message: ${error.messageText}`; | |
Collapse file Copy file name to clipboardExpand all lines: package.json -1Lines changed: 0 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
| 24 | 24 | "setup:test": "./scripts/setup-for-test.sh", | 25 | 25 | "setup:skip-build": "./scripts/setup-skip-build.sh", | 26 | 26 | "start": "./scripts/start.sh", | 27 | | - "start:demo": "./scripts/start.sh @ali/lowcode-demo", | 28 | 27 | "test": "lerna run test --stream", | 29 | 28 | "test:snapshot": "lerna run test:snapshot", | 30 | 29 | "watchdog:build": "node ./scripts/watchdog.js", | |
Collapse file Copy file name to clipboardExpand all lines: packages/editor-core/src/editor.ts +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -37,6 +37,7 @@ export declare interface Editor extends StrictEventEmitter<EventEmitter, GlobalE | 37 | 37 | getPreference(): Preference; | 38 | 38 | } | 39 | 39 |
| | 40 | +// eslint-disable-next-line no-redeclare | 40 | 41 | export class Editor extends (EventEmitter as any) implements IEditor { | 41 | 42 | /** | 42 | 43 | * Ioc Container | |
Collapse file Copy file name to clipboardExpand all lines: packages/editor-core/src/utils/app-preset.ts +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -28,11 +28,11 @@ window.__newFunc = (funContext: string): ((...args: any[]) => any) => { | 28 | 28 | }; | 29 | 29 |
| 30 | 30 | // 关闭浏览器前提醒,只有产生过交互才会生效 | 31 | | -window.onbeforeunload = function (e: Event): string | void { | | 31 | +window.onbeforeunload = function (e: Event): string { | 32 | 32 | const ev = e || window.event; | 33 | 33 | // 本地调试不生效 | 34 | 34 | if (location.href.indexOf('localhost') > 0) { | 35 | | - return; | | 35 | + return ''; | 36 | 36 | } | 37 | 37 | const msg = '您确定要离开此页面吗?'; | 38 | 38 | ev.cancelBubble = true; | |
Collapse file Copy file name to clipboardExpand all lines: packages/editor-core/src/utils/logger.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -2,6 +2,6 @@ import Logger, { Level } from 'zen-logger'; | 2 | 2 |
| 3 | 3 | export { Logger }; | 4 | 4 |
| 5 | | -export function getLogger(config: { level: Level, bizName: string }): Logger { | | 5 | +export function getLogger(config: { level: Level; bizName: string }): Logger { | 6 | 6 | return new Logger(config); | 7 | 7 | } |
Collapse file Copy file name to clipboardExpand all lines: packages/editor-core/src/utils/preference.ts +3-3Lines changed: 3 additions & 3 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,7 +16,7 @@ export default class Preference { | 16 | 16 | return `${STORAGE_KEY_PREFIX}_${moduleKey}.${key}`; | 17 | 17 | } | 18 | 18 |
| 19 | | - set(key: string, value:any, module?: string) { | | 19 | + set(key: string, value: any, module?: string) { | 20 | 20 | if (!key || typeof key !== 'string' || key.length === 0) { | 21 | 21 | logger.error('Invalid key when setting preference', key); | 22 | 22 | return; | @@ -26,7 +26,7 @@ export default class Preference { | 26 | 26 | store.set(storageKey, value); | 27 | 27 | } | 28 | 28 |
| 29 | | - get(key: string, module: string) : any { | | 29 | + get(key: string, module: string): any { | 30 | 30 | if (!key || typeof key !== 'string' || key.length === 0) { | 31 | 31 | logger.error('Invalid key when getting from preference', key); | 32 | 32 | return; | @@ -44,7 +44,7 @@ export default class Preference { | 44 | 44 | * @returns {boolean} | 45 | 45 | * @memberof Preference | 46 | 46 | */ | 47 | | - contains(key: string, module: string) : boolean { | | 47 | + contains(key: string, module: string): boolean { | 48 | 48 | if (!key || typeof key !== 'string' || key.length === 0) { | 49 | 49 | logger.error('Invalid key when getting from preference', key); | 50 | 50 | return false; | |
|