mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
chore: ci add lint & ts
This commit is contained in:
parent
61f558a0da
commit
700221c69b
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -28,5 +28,9 @@ jobs:
|
||||
run: node common/scripts/install-run-rush.js install
|
||||
- name: Rush build
|
||||
run: node common/scripts/install-run-rush.js build
|
||||
# - name: Check Lint
|
||||
# run: node common/scripts/install-run-rush.js lint
|
||||
- name: Check TS
|
||||
run: node common/scripts/install-run-rush.js ts-check
|
||||
- name: Test (coverage)
|
||||
run: node common/scripts/install-run-rush.js test:cov
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Editor } from './editor'
|
||||
import { createRoot } from 'react-dom/client';
|
||||
|
||||
import { Editor } from './editor';
|
||||
|
||||
ReactDOM.render(<Editor />, document.getElementById('root'));
|
||||
const app = createRoot(document.getElementById('root')!);
|
||||
|
||||
app.render(<Editor />);
|
||||
|
||||
@ -1,14 +1,12 @@
|
||||
import { nanoid } from 'nanoid';
|
||||
import { type FlowNodeEntity, useClientContext } from '@flowgram.ai/fixed-layout-editor';
|
||||
import { IconPlus } from '@douyinfe/semi-icons';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
|
||||
interface PropsType {
|
||||
activated?: boolean;
|
||||
node: FlowNodeEntity;
|
||||
}
|
||||
|
||||
|
||||
export function BranchAdder(props: PropsType) {
|
||||
const { activated, node } = props;
|
||||
const nodeData = node.firstChild!.renderData;
|
||||
@ -22,8 +20,8 @@ export function BranchAdder(props: PropsType) {
|
||||
type: 'block',
|
||||
data: {
|
||||
title: 'New Branch',
|
||||
content: ''
|
||||
}
|
||||
content: '',
|
||||
},
|
||||
});
|
||||
|
||||
setTimeout(() => {
|
||||
@ -38,7 +36,7 @@ export function BranchAdder(props: PropsType) {
|
||||
const className = [
|
||||
'demo-fixed-adder',
|
||||
isVertical ? '' : 'isHorizontal',
|
||||
activated ? 'activated' : ''
|
||||
activated ? 'activated' : '',
|
||||
].join(' ');
|
||||
|
||||
return (
|
||||
|
||||
@ -29,6 +29,7 @@ const SvgUngroup = () => (
|
||||
);
|
||||
|
||||
const IconFactory = (svg: ReactNode) =>
|
||||
// eslint-disable-next-line react/display-name
|
||||
forwardRef((props: Omit<IconProps, 'svg' | 'ref'>, ref: Ref<HTMLSpanElement>) => (
|
||||
<Icon svg={svg} {...props} ref={ref} />
|
||||
));
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
"build": "rm -rf ./doc_build && rspress build",
|
||||
"docs": "sucrase-node ./scripts/auto-generate.ts",
|
||||
"dev": "rspress dev",
|
||||
"lint": "eslint .",
|
||||
"lint": "eslint ./components --cache",
|
||||
"preview": "rspress preview"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@ -235,6 +235,22 @@
|
||||
"safeForSimultaneousRushProcesses": true,
|
||||
"shellCommand": "concurrently --kill-others --prefix \"{name}\" --names [watch],[demo] -c white,blue \"rush build:watch --to-except @flowgram.ai/docs\" \"cd apps/docs && rushx dev\""
|
||||
},
|
||||
{
|
||||
"name": "ts-check",
|
||||
"commandKind": "bulk",
|
||||
"summary": "⭐️️ Run ts check in packages",
|
||||
"ignoreMissingScript": true,
|
||||
"enableParallelism": true,
|
||||
"safeForSimultaneousRushProcesses": true
|
||||
},
|
||||
{
|
||||
"name": "lint",
|
||||
"commandKind": "bulk",
|
||||
"summary": "⭐️️ Run eslint check in packages",
|
||||
"ignoreMissingScript": true,
|
||||
"enableParallelism": true,
|
||||
"safeForSimultaneousRushProcesses": true
|
||||
},
|
||||
{
|
||||
"name": "dev:demo-fixed-layout",
|
||||
"commandKind": "global",
|
||||
|
||||
@ -62,7 +62,11 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
},
|
||||
extends: ['plugin:prettier/recommended', 'plugin:react/recommended'],
|
||||
extends: [
|
||||
'plugin:prettier/recommended',
|
||||
'plugin:react/recommended',
|
||||
'plugin:react/jsx-runtime',
|
||||
],
|
||||
plugins: ['@typescript-eslint', 'import'],
|
||||
|
||||
parserOptions: {
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
"scripts": {
|
||||
"build": "tsc -b --force",
|
||||
"dev": "npm run build -- -w",
|
||||
"lint": "eslint ./ --cache --quiet",
|
||||
"lint": "eslint ./src --cache",
|
||||
"lint:fix": "eslint --fix ../../packages",
|
||||
"test": "exit",
|
||||
"test:cov": "exit"
|
||||
|
||||
@ -2,6 +2,7 @@ import { beforeEach, describe, expect, it } from 'vitest';
|
||||
|
||||
describe('form test', () => {
|
||||
it('form test', () => {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('form test');
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user