mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-13 20:36:34 +00:00
chore: lint tool
This commit is contained in:
parent
0014b6aae8
commit
1874a4b3e1
59
.eslintrc.js
59
.eslintrc.js
@ -1,59 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
extends: 'eslint-config-ali/typescript/react',
|
|
||||||
parserOptions: {
|
|
||||||
project: [], // for lint performance
|
|
||||||
createDefaultProgram: false, // for lint performance
|
|
||||||
},
|
|
||||||
rules: {
|
|
||||||
'react/no-multi-comp': 0,
|
|
||||||
'no-unused-expressions': 0,
|
|
||||||
'implicit-arrow-linebreak': 1,
|
|
||||||
'no-nested-ternary': 1,
|
|
||||||
'no-mixed-operators': 1,
|
|
||||||
'@typescript-eslint/ban-types': 1,
|
|
||||||
'no-shadow': 1,
|
|
||||||
'no-prototype-builtins': 1,
|
|
||||||
'no-useless-constructor': 1,
|
|
||||||
'no-empty-function': 1,
|
|
||||||
'lines-between-class-members': 0,
|
|
||||||
'no-await-in-loop': 0,
|
|
||||||
'no-plusplus': 0,
|
|
||||||
'@typescript-eslint/no-parameter-properties': 0,
|
|
||||||
'no-restricted-exports': ['error'],
|
|
||||||
'no-multi-assign': 1,
|
|
||||||
'no-dupe-class-members': 1,
|
|
||||||
'react/no-deprecated': 1,
|
|
||||||
'no-useless-escape': 1,
|
|
||||||
'brace-style': 1,
|
|
||||||
'@typescript-eslint/no-inferrable-types': 0,
|
|
||||||
'no-proto': 0,
|
|
||||||
'prefer-const': 0,
|
|
||||||
'eol-last': 0,
|
|
||||||
'react/no-find-dom-node': 0,
|
|
||||||
'no-case-declarations': 0,
|
|
||||||
'@typescript-eslint/indent': 0,
|
|
||||||
'import/no-cycle': 0,
|
|
||||||
'@typescript-eslint/no-shadow': 0,
|
|
||||||
'@typescript-eslint/method-signature-style': 0,
|
|
||||||
'@typescript-eslint/consistent-type-assertions': 0,
|
|
||||||
'@typescript-eslint/no-useless-constructor': 0,
|
|
||||||
'@typescript-eslint/dot-notation': 0, // for lint performance
|
|
||||||
'@typescript-eslint/restrict-plus-operands': 0, // for lint performance
|
|
||||||
'no-unexpected-multiline': 1,
|
|
||||||
'no-multiple-empty-lines': ['error', { max: 1 }],
|
|
||||||
'lines-around-comment': ['error', {
|
|
||||||
beforeBlockComment: true,
|
|
||||||
afterBlockComment: false,
|
|
||||||
afterLineComment: false,
|
|
||||||
allowBlockStart: true,
|
|
||||||
}],
|
|
||||||
'comma-dangle': ['error', 'always-multiline'],
|
|
||||||
'@typescript-eslint/member-ordering': [
|
|
||||||
'error',
|
|
||||||
{ default: ['signature', 'field', 'constructor', 'method'] }
|
|
||||||
],
|
|
||||||
'@typescript-eslint/no-unused-vars': ['error'],
|
|
||||||
'no-redeclare': 0,
|
|
||||||
'@typescript-eslint/no-redeclare': 1,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
1
.husky/commit-msg
Normal file
1
.husky/commit-msg
Normal file
@ -0,0 +1 @@
|
|||||||
|
pnpm commitlint --edit $1
|
||||||
1
.husky/pre-commit
Normal file
1
.husky/pre-commit
Normal file
@ -0,0 +1 @@
|
|||||||
|
# pnpm lint-staged
|
||||||
@ -1,7 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
printWidth: 100,
|
|
||||||
tabWidth: 2,
|
|
||||||
semi: true,
|
|
||||||
singleQuote: true,
|
|
||||||
trailingComma: 'all',
|
|
||||||
};
|
|
||||||
@ -1,9 +0,0 @@
|
|||||||
# 忽略目录
|
|
||||||
node_modules/
|
|
||||||
build/
|
|
||||||
dist/
|
|
||||||
|
|
||||||
# 忽略文件
|
|
||||||
**/*.min.css
|
|
||||||
**/*-min.css
|
|
||||||
**/*.bundle.css
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
extends: 'stylelint-config-ali',
|
|
||||||
rules: {
|
|
||||||
"selector-max-id": 2
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@ -1,3 +1,21 @@
|
|||||||
module.exports = {
|
export default {
|
||||||
extends: ['ali'],
|
extends: ['@commitlint/config-conventional'],
|
||||||
|
rules: {
|
||||||
|
'type-enum': [
|
||||||
|
2,
|
||||||
|
'always',
|
||||||
|
[
|
||||||
|
'feat',
|
||||||
|
'fix',
|
||||||
|
'docs',
|
||||||
|
'chore',
|
||||||
|
'style',
|
||||||
|
'refactor',
|
||||||
|
'ci',
|
||||||
|
'test',
|
||||||
|
'revert',
|
||||||
|
'perf',
|
||||||
|
],
|
||||||
|
],
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
40
eslint.config.js
Normal file
40
eslint.config.js
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import stylistic from '@stylistic/eslint-plugin';
|
||||||
|
import tsParser from '@typescript-eslint/parser';
|
||||||
|
import js from '@eslint/js';
|
||||||
|
import reactHooks from 'eslint-plugin-react-hooks';
|
||||||
|
import reactRefresh from 'eslint-plugin-react-refresh';
|
||||||
|
|
||||||
|
export default [
|
||||||
|
js.configs.recommended,
|
||||||
|
{
|
||||||
|
files: ['**/src/**/*.{ts?(x),js?(x)}'],
|
||||||
|
plugins: {
|
||||||
|
'@stylistic': stylistic,
|
||||||
|
'react-hooks': reactHooks,
|
||||||
|
},
|
||||||
|
languageOptions: {
|
||||||
|
parser: tsParser,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'@stylistic/indent': ['error', 2],
|
||||||
|
"@stylistic/indent-binary-ops": ["error", 2],
|
||||||
|
'@stylistic/max-len': ["error", { "tabWidth": 2 }],
|
||||||
|
'@stylistic/no-tabs': "error",
|
||||||
|
'@stylistic/quotes': ["error", "single"],
|
||||||
|
"@stylistic/jsx-pascal-case": [2],
|
||||||
|
"@stylistic/jsx-indent": [2, 2, { checkAttributes: true, indentLogicalExpressions: true }],
|
||||||
|
|
||||||
|
'react-hooks/rules-of-hooks': 'error', // Checks rules of Hooks
|
||||||
|
'react-hooks/exhaustive-deps': 'warn', // Checks effect dependencies
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
files: ['**/src/**/*.{tsx,jsx}'],
|
||||||
|
plugins: {
|
||||||
|
'react-refresh': reactRefresh,
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
'react-refresh/only-export-components': 'warn',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
38
package.json
38
package.json
@ -1,14 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "lowcode-engine-repo",
|
"name": "@alilc/lowcode-monorepo",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"playground": "pnpm --filter playground dev",
|
"playground": "pnpm --filter playground dev",
|
||||||
"test": "pnpm -r test",
|
"test": "pnpm -r test",
|
||||||
"build": "pnpm -r build",
|
"build": "pnpm -r build",
|
||||||
"clean": "rimraf ./packages/*/dist",
|
"clean": "rimraf ./packages/*/dist",
|
||||||
"clean:lib": "rimraf ./node_modules ./packages/*/node_modules",
|
"clean:lib": "rimraf ./node_modules ./packages/*/node_modules",
|
||||||
"lint": "f2elint scan -q -i ./packages/*/src",
|
"lint": "eslint --cache --no-warn-ignored",
|
||||||
"lint:fix": "f2elint fix -i ./packages/*/src",
|
|
||||||
"pub": "npm run watchdog:build && lerna publish patch --yes --force-publish --exact --no-changelog",
|
"pub": "npm run watchdog:build && lerna publish patch --yes --force-publish --exact --no-changelog",
|
||||||
"pub:minor": "npm run watchdog:build && lerna publish minor --yes --force-publish --exact --no-changelog",
|
"pub:minor": "npm run watchdog:build && lerna publish minor --yes --force-publish --exact --no-changelog",
|
||||||
"pub:major": "npm run watchdog:build && lerna publish major --yes --force-publish --exact --no-changelog",
|
"pub:major": "npm run watchdog:build && lerna publish major --yes --force-publish --exact --no-changelog",
|
||||||
@ -16,37 +16,39 @@
|
|||||||
"pub:preminor": "npm run watchdog:build && lerna publish preminor --force-publish --exact --dist-tag beta --preid beta --no-changelog",
|
"pub:preminor": "npm run watchdog:build && lerna publish preminor --force-publish --exact --dist-tag beta --preid beta --no-changelog",
|
||||||
"pub:prepatch": "npm run watchdog:build && lerna publish prepatch --force-publish --exact --dist-tag beta --preid beta --no-changelog",
|
"pub:prepatch": "npm run watchdog:build && lerna publish prepatch --force-publish --exact --dist-tag beta --preid beta --no-changelog",
|
||||||
"pub:prerelease": "npm run watchdog:build && lerna publish prerelease --yes --force-publish --exact --dist-tag beta --preid beta --no-changelog",
|
"pub:prerelease": "npm run watchdog:build && lerna publish prerelease --yes --force-publish --exact --dist-tag beta --preid beta --no-changelog",
|
||||||
"syncOss": "node ./scripts/sync-oss.js"
|
"syncOss": "node ./scripts/sync-oss.js",
|
||||||
},
|
"prepare": "husky"
|
||||||
"husky": {
|
|
||||||
"hooks": {
|
|
||||||
"pre-commit": "f2elint commit-file-scan",
|
|
||||||
"commit-msg": "f2elint commit-msg-scan"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@alilc/build-plugin-lce": "^0.0.5",
|
"@alilc/build-plugin-lce": "^0.0.5",
|
||||||
"@alilc/lowcode-test-mate": "^1.0.1",
|
"@alilc/lowcode-test-mate": "^1.0.1",
|
||||||
"@changesets/cli": "^2.27.1",
|
"@changesets/cli": "^2.27.1",
|
||||||
|
"@commitlint/cli": "^19.2.1",
|
||||||
|
"@commitlint/config-conventional": "^19.1.0",
|
||||||
|
"@eslint/js": "^8.57.0",
|
||||||
"@microsoft/api-extractor": "^7.43.0",
|
"@microsoft/api-extractor": "^7.43.0",
|
||||||
|
"@stylistic/eslint-plugin": "^1.7.0",
|
||||||
"@types/node": "^20.11.30",
|
"@types/node": "^20.11.30",
|
||||||
"@types/react-router": "5.1.18",
|
"@types/react-router": "5.1.18",
|
||||||
|
"@typescript-eslint/parser": "^7.4.0",
|
||||||
"@vitejs/plugin-react": "^4.2.1",
|
"@vitejs/plugin-react": "^4.2.1",
|
||||||
"babel-jest": "^26.5.2",
|
"eslint": "^8.57.0",
|
||||||
"del": "^6.1.1",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"execa": "^8.0.1",
|
"eslint-plugin-react-refresh": "^0.4.6",
|
||||||
"f2elint": "^4.2.1",
|
|
||||||
"gulp": "^4.0.2",
|
|
||||||
"husky": "^9.0.11",
|
"husky": "^9.0.11",
|
||||||
"typescript": "^5.4.2",
|
"lint-staged": "^15.2.2",
|
||||||
"prettier": "^3.2.5",
|
|
||||||
"rimraf": "^5.0.2",
|
"rimraf": "^5.0.2",
|
||||||
"rollup": "^4.13.0",
|
"rollup": "^4.13.0",
|
||||||
|
"typescript": "^5.4.2",
|
||||||
"vite": "^5.1.6",
|
"vite": "^5.1.6",
|
||||||
"vitest": "^1.3.1"
|
"vitest": "^1.3.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0",
|
||||||
|
"pnpm": ">= 8"
|
||||||
|
},
|
||||||
|
"lint-staged": {
|
||||||
|
"*": "pnpm lint"
|
||||||
},
|
},
|
||||||
"repository": "git@github.com:alibaba/lowcode-engine.git"
|
"repository": "git@github.com:alibaba/lowcode-engine.git"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,18 +1,18 @@
|
|||||||
{
|
{
|
||||||
"name": "@alilc/lowcode-renderer-react",
|
"name": "@alilc/lowcode-react-renderer",
|
||||||
"version": "2.0.0-beta.0",
|
"version": "2.0.0-beta.0",
|
||||||
"description": "react renderer for ali lowcode engine",
|
"description": "react renderer for ali lowcode engine",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bugs": "https://github.com/alibaba/lowcode-engine/issues",
|
"bugs": "https://github.com/alibaba/lowcode-engine/issues",
|
||||||
"homepage": "https://github.com/alibaba/lowcode-engine/#readme",
|
"homepage": "https://github.com/alibaba/lowcode-engine/#readme",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "dist/rendererReact.cjs",
|
"main": "dist/reactRenderer.cjs",
|
||||||
"module": "dist/rendererReact.js",
|
"module": "dist/reactRenderer.js",
|
||||||
"types": "dist/index.d.ts",
|
"types": "dist/index.d.ts",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"import": "./dist/rendererReact.js",
|
"import": "./dist/reactRenderer.js",
|
||||||
"require": "./dist/rendererReact.cjs",
|
"require": "./dist/reactRenderer.cjs",
|
||||||
"types": "./dist/index.d.ts"
|
"types": "./dist/index.d.ts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1,4 +1,4 @@
|
|||||||
import EventEmitter from 'events';
|
import { EventEmitter } from 'events';
|
||||||
|
|
||||||
let instance: AppHelper | null = null;
|
let instance: AppHelper | null = null;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { IPublicEnumTransitionType } from '@alilc/lowcode-types';
|
import { IPublicEnumTransitionType } from '@alilc/lowcode-types';
|
||||||
import { runInAction } from 'mobx';
|
import { runInAction } from 'mobx';
|
||||||
import EventEmitter from 'events';
|
import { EventEmitter } from 'events';
|
||||||
|
|
||||||
class TransactionManager {
|
class TransactionManager {
|
||||||
emitter = new EventEmitter();
|
emitter = new EventEmitter();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user