Skip to content

Commit

Permalink
chore: lint tool
Browse files Browse the repository at this point in the history
  • Loading branch information
1ncounter committed Mar 29, 2024
1 parent 0014b6a commit 1874a4b
Show file tree
Hide file tree
Showing 33 changed files with 89 additions and 108 deletions.
59 changes: 0 additions & 59 deletions .eslintrc.js

This file was deleted.

1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pnpm commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# pnpm lint-staged
7 changes: 0 additions & 7 deletions .prettierrc.js

This file was deleted.

9 changes: 0 additions & 9 deletions .stylelintignore

This file was deleted.

6 changes: 0 additions & 6 deletions .stylelintrc.js

This file was deleted.

22 changes: 20 additions & 2 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
module.exports = {
extends: ['ali'],
export default {
extends: ['@commitlint/config-conventional'],
rules: {
'type-enum': [
2,
'always',
[
'feat',
'fix',
'docs',
'chore',
'style',
'refactor',
'ci',
'test',
'revert',
'perf',
],
],
}
};
40 changes: 40 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -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 changes: 20 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
{
"name": "lowcode-engine-repo",
"name": "@alilc/lowcode-monorepo",
"private": true,
"type": "module",
"scripts": {
"playground": "pnpm --filter playground dev",
"test": "pnpm -r test",
"build": "pnpm -r build",
"clean": "rimraf ./packages/*/dist",
"clean:lib": "rimraf ./node_modules ./packages/*/node_modules",
"lint": "f2elint scan -q -i ./packages/*/src",
"lint:fix": "f2elint fix -i ./packages/*/src",
"lint": "eslint --cache --no-warn-ignored",
"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:major": "npm run watchdog:build && lerna publish major --yes --force-publish --exact --no-changelog",
"pub:premajor": "npm run watchdog:build && lerna publish premajor --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: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"
},
"husky": {
"hooks": {
"pre-commit": "f2elint commit-file-scan",
"commit-msg": "f2elint commit-msg-scan"
}
"syncOss": "node ./scripts/sync-oss.js",
"prepare": "husky"
},
"devDependencies": {
"@alilc/build-plugin-lce": "^0.0.5",
"@alilc/lowcode-test-mate": "^1.0.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",
"@stylistic/eslint-plugin": "^1.7.0",
"@types/node": "^20.11.30",
"@types/react-router": "5.1.18",
"@typescript-eslint/parser": "^7.4.0",
"@vitejs/plugin-react": "^4.2.1",
"babel-jest": "^26.5.2",
"del": "^6.1.1",
"execa": "^8.0.1",
"f2elint": "^4.2.1",
"gulp": "^4.0.2",
"eslint": "^8.57.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.6",
"husky": "^9.0.11",
"typescript": "^5.4.2",
"prettier": "^3.2.5",
"lint-staged": "^15.2.2",
"rimraf": "^5.0.2",
"rollup": "^4.13.0",
"typescript": "^5.4.2",
"vite": "^5.1.6",
"vitest": "^1.3.1"
},
"engines": {
"node": ">=18"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0",
"pnpm": ">= 8"
},
"lint-staged": {
"*": "pnpm lint"
},
"repository": "[email protected]:alibaba/lowcode-engine.git"
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@alilc/lowcode-renderer-react",
"name": "@alilc/lowcode-react-renderer",
"version": "2.0.0-beta.0",
"description": "react renderer for ali lowcode engine",
"type": "module",
"bugs": "https://github.com/alibaba/lowcode-engine/issues",
"homepage": "https://github.com/alibaba/lowcode-engine/#readme",
"license": "MIT",
"main": "dist/rendererReact.cjs",
"module": "dist/rendererReact.js",
"main": "dist/reactRenderer.cjs",
"module": "dist/reactRenderer.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/rendererReact.js",
"require": "./dist/rendererReact.cjs",
"import": "./dist/reactRenderer.js",
"require": "./dist/reactRenderer.cjs",
"types": "./dist/index.d.ts"
}
},
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/utils/src/app-helper.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import EventEmitter from 'events';
import { EventEmitter } from 'events';

let instance: AppHelper | null = null;

Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/transaction-manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IPublicEnumTransitionType } from '@alilc/lowcode-types';
import { runInAction } from 'mobx';
import EventEmitter from 'events';
import { EventEmitter } from 'events';

class TransactionManager {
emitter = new EventEmitter();
Expand Down

0 comments on commit 1874a4b

Please sign in to comment.