Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit bbc92f3

Browse files
committed
chore: Merge branch 'constant' into dev
2 parents 32e8e6f + ea1fae0 commit bbc92f3

File tree

87 files changed

+3171
-4175
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+3171
-4175
lines changed

.babelrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@
5252
"alias": {
5353
"@containers":"./containers",
5454
"@components":"./components",
55+
"@constant": "./utils/constant/",
5556
"@config":"./config",
5657
"@stores":"./stores",
58+
"@model": "./stores/SharedModel",
5759
"@model":"./stores/SharedModel",
5860
"@utils":"./utils",
5961
"@schemas":"./containers/schemas",

.eslintrc.js

Lines changed: 1 addition & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,3 @@
11
module.exports = {
2-
extends: ['airbnb', 'plugin:react/recommended', 'prettier', 'prettier/react'],
3-
plugins: ['prettier', 'react', 'cypress', 'react-hooks'],
4-
parser: 'babel-eslint',
5-
parserOptions: {
6-
ecmaVersion: 2016,
7-
sourceType: 'module',
8-
ecmaFeatures: {
9-
jsx: true,
10-
},
11-
},
12-
env: {
13-
es6: true,
14-
node: true,
15-
jest: true,
16-
'cypress/globals': true,
17-
},
18-
settings: {
19-
'import/resolver': {
20-
'babel-module': {},
21-
},
22-
},
23-
rules: {
24-
// import/resolver 暂时识别不了 @xxx, 暂时关闭该检测
25-
'import/no-extraneous-dependencies': 0,
26-
'arrow-body-style': 0,
27-
// need for _store init
28-
'no-underscore-dangle': 0,
29-
// heavilly used in store.actions
30-
'no-param-reassign': 0,
31-
// heavilly used in store.views
32-
'no-use-before-define': 0,
33-
// force-return is unneeded
34-
'consistent-return': 0,
35-
'no-shadow': 0,
36-
// error could be object for parse by upfloor
37-
'prefer-promise-reject-errors': 0,
38-
'react/jsx-no-bind': 0,
39-
// allow JSX in js files
40-
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
41-
'react/forbid-prop-types': 0,
42-
// no need sort
43-
'react/sort-comp': 0,
44-
'react/prop-types': [1, { skipUndeclared: true }],
45-
'jsx-a11y/href-no-hash': 'off',
46-
'jsx-a11y/no-static-element-interactions': 0,
47-
'jsx-a11y/click-events-have-key-events': 0,
48-
49-
// for cypress test usage
50-
'no-unused-expressions': 0,
51-
52-
'prettier/prettier': [
53-
'error',
54-
{
55-
singleQuote: true,
56-
semi: false,
57-
tabWidth: 2,
58-
bracketSpacing: true,
59-
trailingComma: 'es5',
60-
},
61-
],
62-
'react-hooks/rules-of-hooks': 'error',
63-
'react-hooks/exhaustive-deps': 'warn',
64-
},
2+
extends: ['@groupher/eslint-config-web'],
653
}

commitlint.config.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
module.exports = {
2+
rules: {
3+
'body-leading-blank': [1, 'always'],
4+
'footer-leading-blank': [1, 'always'],
5+
'header-max-length': [2, 'always', 72],
6+
'scope-case': [0],
7+
'subject-case': [0],
8+
'subject-empty': [2, 'never'],
9+
'subject-full-stop': [2, 'never', '.'],
10+
'type-case': [2, 'always', 'lower-case'],
11+
'type-empty': [2, 'never'],
12+
'type-enum': [
13+
2,
14+
'always',
15+
[
16+
'build',
17+
'chore',
18+
'ci',
19+
'docs',
20+
'feat',
21+
'fix',
22+
'perf',
23+
'refactor',
24+
'revert',
25+
'style',
26+
'test',
27+
],
28+
],
29+
},
30+
}

components/ReposTable/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ import React from 'react'
88
import T from 'prop-types'
99
import { Table, Button } from 'antd'
1010

11-
import { buildLog, TYPE } from '@utils'
11+
import { TYPE } from '@constant'
12+
import { buildLog } from '@utils'
13+
1214
import Pagi from '../Pagi'
1315
import { TableLoading } from '../LoadingEffects'
1416
import { Space } from '../BaseStyled'

components/VideosTable/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import React from 'react'
88
import T from 'prop-types'
99
import { Table, Button } from 'antd'
1010

11-
import { buildLog, cutFrom, TYPE } from '@utils'
12-
import { OperationWrapper } from './styles'
11+
import { TYPE } from '@constant'
12+
import { buildLog, cutFrom } from '@utils'
1313

1414
import Pagi from '../Pagi'
1515
import { TableLoading } from '../LoadingEffects'
@@ -19,6 +19,8 @@ import CommunityCell from '../CommunityCell'
1919
import TagsCell from '../TagsCell'
2020
import TimeStampCell from '../TimeStampCell'
2121

22+
import { OperationWrapper } from './styles'
23+
2224
/* eslint-disable no-unused-vars */
2325
const log = buildLog('c:VideosTable:index')
2426
/* eslint-enable no-unused-vars */

containers/AccountEditor/logic.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
import R from 'ramda'
22
import { useEffect } from 'react'
33

4-
import {
5-
asyncSuit,
6-
buildLog,
7-
send,
8-
EVENT,
9-
ERR,
10-
TYPE,
11-
meteorState,
12-
} from '@utils'
4+
import { EVENT, ERR, TYPE } from '@constant'
5+
import { asyncSuit, buildLog, send, meteorState } from '@utils'
136

147
import S from './schema'
158

containers/AccountEditor/store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { types as t, getParent } from 'mobx-state-tree'
77
import R from 'ramda'
88

9-
import { User } from 'stores/SharedModel'
9+
import { User } from '@model'
1010
import { markStates, buildLog, stripMobx } from '@utils'
1111

1212
/* eslint-disable no-unused-vars */

containers/AccountViewer/logic.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// import R from 'ramda'
22
import { useEffect } from 'react'
3-
import { asyncSuit, buildLog, ERR, send, EVENT, TYPE, Global } from '@utils'
3+
4+
import { EVENT, ERR, TYPE } from '@constant'
5+
import { asyncSuit, buildLog, send, Global } from '@utils'
46

57
import S from './schema'
68

containers/AccountViewer/store.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import { types as t, getParent } from 'mobx-state-tree'
77
// import R from 'ramda'
88

9-
import { User, EmptyUser } from 'stores/SharedModel'
9+
import { User, EmptyUser } from '@model'
1010
import { markStates, buildLog, stripMobx } from '@utils'
1111
/* eslint-disable no-unused-vars */
1212
const log = buildLog('S:AccountViewerStore')

containers/ArticleViwer/PostViewer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React from 'react'
22
import TimeAgo from 'timeago-react'
3-
// import CommentsList from '@components/CommentsList'
4-
import { MarkDownPreviewer, PostLoading } from '@components'
3+
54
import { ICON_CMD } from '@config'
6-
import { TYPE } from '@utils'
5+
import { TYPE } from '@constant'
6+
import { MarkDownPreviewer, PostLoading } from '@components'
7+
78
import Comments from '../Comments'
89

910
import {

0 commit comments

Comments
 (0)