Skip to content

Commit

Permalink
完成 solidjs 的所有迁移工作
Browse files Browse the repository at this point in the history
  • Loading branch information
hymbz committed Apr 28, 2023
1 parent b7278f0 commit cb04ccb
Show file tree
Hide file tree
Showing 166 changed files with 8,781 additions and 11,193 deletions.
56 changes: 14 additions & 42 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ const publicConfig = {
'import/prefer-default-export': 'off',
// 允许使用 require
'import/no-dynamic-require': 'off',
// 判断引用循环时跳过动态导入
'import/no-cycle': ['warn', { allowUnsafeDynamicCyclicDependency: true }],
'import/no-unresolved': 'off',
},
};
Expand Down Expand Up @@ -83,15 +85,13 @@ module.exports = {
tsconfigRootDir: __dirname,
project: ['./packages/*/tsconfig.json'],
},
plugins: ['@typescript-eslint', 'jsdoc'],
plugins: ['@typescript-eslint', 'jsdoc', 'solid'],
extends: [
'airbnb',
'airbnb/hooks',
'airbnb-base',
'eslint:recommended',
'plugin:solid/recommended',
'plugin:jsdoc/recommended',
'plugin:import/typescript',
// 'plugin:react/recommended',
'plugin:react/jsx-runtime',
// 'plugin:react-hooks/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
Expand All @@ -100,14 +100,11 @@ module.exports = {
rules: {
// 使用 TS 的规则
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'@typescript-eslint/no-use-before-define': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-shadow': 'error',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{ varsIgnorePattern: 'React' },
],
'@typescript-eslint/no-unused-vars': 'warn',

// 允许 switch 中不使用 default
'default-case': 'off',
Expand Down Expand Up @@ -149,27 +146,6 @@ module.exports = {
// 允许分配 any 类型变量
'@typescript-eslint/no-unsafe-assignment': 'off',

//
// React 适配
//

// 使此规则支持 TS
'react/jsx-filename-extension': [
'warn',
{ extensions: ['.tsx', '.jsx'] },
],
'react/function-component-definition': [
'warn',
{
namedComponents: 'arrow-function',
unnamedComponents: 'arrow-function',
},
],
// 有 TS 不需要这个
'react/prop-types': 'off',
// 允许使用对象解构来传输 props
'react/jsx-props-no-spreading': 'off',

// 为了使用 immer,允许为 命名为state、draft开头、Ele结尾 的函数参数赋值
'no-param-reassign': [
'error',
Expand All @@ -179,20 +155,16 @@ module.exports = {
ignorePropertyModificationsForRegex: ['^draft', 'Ele$'],
},
],

// 不强制要求为可选参数加上默认值
'react/require-default-props': 'off',

// 不强制要求可点击元素必须同时监听键盘操作
'jsx-a11y/click-events-have-key-events': 'off',
// 不要求 a11y
'jsx-a11y/no-static-element-interactions': 'off',
},
}),
buildConfig({
files: ['*.*js'],
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'airbnb', 'plugin:prettier/recommended'],
extends: [
'eslint:recommended',
'airbnb-base',
'plugin:prettier/recommended',
],
rules: {
// 禁止提醒使用了 dev 的包
'import/no-extraneous-dependencies': 'off',
Expand Down
7 changes: 4 additions & 3 deletions ComicReadScript.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
{
"path": "packages/ui-component",
"name": "ui-component"
},
{
"path": "packages/solid-ui"
}
],
"settings": {
"typescript.tsdk": "root\\node_modules\\typescript\\lib",
"explorer.autoRevealExclude": {
"README*.md": true
},
"workbench.colorCustomizations": {
"minimap.background": "#23272e88",
"scrollbar.shadow": "#23272e88"
}
},
}
3 changes: 3 additions & 0 deletions docs/Dev.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## TODO

- 百合会更新后自动签到失效了
- 长图自动开启卷轴模式 https://bbs.yamibo.com/thread-534775-1-1.html
- 页数加一
- 测试平板上的使用
- 卷轴模式下滚动到底要能触发结束页
- 放大后侧边栏按钮悬浮背景色变为半透明会导致看不清图标
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
"@typescript-eslint/eslint-plugin": "^5.58.0",
"@typescript-eslint/parser": "^5.58.0",
"eslint": "^8.38.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^41.1.1",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"fake-indexeddb": "^4.0.1",
"prettier": "^2.8.7",
"release-it": "^15.8.0",
Expand Down
168 changes: 0 additions & 168 deletions packages/solid-ui/.eslintrc.cjs

This file was deleted.

8 changes: 0 additions & 8 deletions packages/solid-ui/.postcssrc.cjs

This file was deleted.

3 changes: 0 additions & 3 deletions packages/solid-ui/README.md

This file was deleted.

23 changes: 0 additions & 23 deletions packages/solid-ui/index.html

This file was deleted.

Loading

0 comments on commit cb04ccb

Please sign in to comment.