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

Commit 61ef82f

Browse files
committed
chore: merge branch 'alias' into dev
2 parents 40bc04f + 9d4bf79 commit 61ef82f

File tree

383 files changed

+678
-649
lines changed

Some content is hidden

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

383 files changed

+678
-649
lines changed

.babelrc

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
{
2+
"presets": [
3+
["next/babel"]
4+
],
5+
"env": {
6+
"development": {
7+
"plugins": ["inline-dotenv"]
8+
},
9+
"production": {
10+
"presets": [
11+
["next/babel", {
12+
"preset-env": {
13+
"targets": {
14+
"ie": "11"
15+
},
16+
"debug": false
17+
}
18+
}]
19+
]
20+
},
21+
"test": {
22+
"plugins": ["inline-dotenv"]
23+
}
24+
},
225
"plugins": [
26+
"add-react-displayname",
327
["@babel/plugin-proposal-decorators", { "legacy": true }],
428
"transform-inline-environment-variables",
529
[
@@ -26,31 +50,16 @@
2650
["module-resolver", {
2751
"root": ["./"],
2852
"alias": {
29-
"containers":"./containers",
30-
"components":"./components",
31-
"config":"./config",
32-
"stores":"./stores",
33-
"schemas":"./containers/schemas",
34-
"utils":"./utils",
35-
"Img": "./components/Img",
36-
"SvgIcons": "./components/SvgIcons"
53+
"@containers":"./containers",
54+
"@components":"./components",
55+
"@config":"./config",
56+
"@stores":"./stores",
57+
"@model":"./stores/SharedModel",
58+
"@utils":"./utils",
59+
"@schemas":"./containers/schemas",
60+
"@Img": "./components/Img",
61+
"@SvgIcons": "./components/SvgIcons"
3762
}
3863
}]
39-
],
40-
"env": {
41-
"development": {
42-
"presets": ["next/babel"],
43-
"plugins": ["inline-dotenv"]
44-
},
45-
"local": {
46-
"presets": ["next/babel"],
47-
},
48-
"production": {
49-
"presets": ["next/babel"]
50-
},
51-
"test": {
52-
"presets": [["next/babel", { "preset-env": { "modules": "commonjs" } }]],
53-
"plugins": ["inline-dotenv"]
54-
}
55-
}
64+
]
5665
}

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
extends: ['airbnb', 'plugin:react/recommended', 'prettier', 'prettier/react'],
3-
plugins: ['prettier', 'react', 'cypress'],
3+
plugins: ['prettier', 'react', 'cypress', 'react-hooks'],
44
parser: 'babel-eslint',
55
parserOptions: {
66
ecmaVersion: 2016,
@@ -21,6 +21,8 @@ module.exports = {
2121
},
2222
},
2323
rules: {
24+
// import/resolver 暂时识别不了 @xxx, 暂时关闭该检测
25+
'import/no-extraneous-dependencies': 0,
2426
'arrow-body-style': 0,
2527
// need for _store init
2628
'no-underscore-dangle': 0,
@@ -57,5 +59,7 @@ module.exports = {
5759
trailingComma: 'es5',
5860
},
5961
],
62+
'react-hooks/rules-of-hooks': 'error',
63+
'react-hooks/exhaustive-deps': 'warn',
6064
},
6165
}

components/AdderCell/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
import React from 'react'
88
import PropTypes from 'prop-types'
99

10-
import { ICON_CMD } from 'config'
10+
import { ICON_CMD } from '@config'
1111

12-
import { makeDebugger } from 'utils'
12+
import { makeDebugger } from '@utils'
1313
import { AddWrapper, AddIcon, AddText } from './styles'
1414

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

components/AdderCell/styles/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components'
22

3-
import { animate } from 'utils'
3+
import { animate } from '@utils'
44
import Img from '../../Img'
55

66
export const AddWrapper = styled.div`

components/AvatarsRow/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { Tooltip } from 'antd'
1111

1212
import { ATATARS_LIST_LENGTH } from 'config/general'
1313

14-
import { makeDebugger, prettyNum } from 'utils'
14+
import { makeDebugger, prettyNum } from '@utils'
1515
import { Avatars, AvatarsItem, AvatarsImg, AvatarsMore } from './styles'
1616

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

components/AvatarsRow/styles/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components'
22

3-
import { theme, cs } from 'utils'
3+
import { theme, cs } from '@utils'
44

55
export const Avatars = styled.ul`
66
${cs.flex()};

components/BannerCountBrief/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import React from 'react'
88
import PropTypes from 'prop-types'
99

10-
import { makeDebugger, toPercentNum } from 'utils'
10+
import { makeDebugger, toPercentNum } from '@utils'
1111

1212
import {
1313
Result,

components/BaseStyled/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import styled from 'styled-components'
2-
import { theme } from 'utils'
2+
import { theme } from '@utils'
33

44
export const Center = styled.div`
55
/* display: flex;*/

components/CategoriesCell/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import PropTypes from 'prop-types'
99
import R from 'ramda'
1010
import { Icon } from 'antd'
1111

12-
import { ICON_CMD } from 'config'
12+
import { ICON_CMD } from '@config'
1313

14-
import { uid, Trans } from 'utils'
14+
import { uid, Trans } from '@utils'
1515
import AdderCell from '../AdderCell'
1616

1717
import {

components/CategoriesCell/styles/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import styled from 'styled-components'
22

3-
import { animate } from 'utils'
3+
import { animate } from '@utils'
44
import Img from '../../Img'
55

66
export const UnsetText = styled.div`

0 commit comments

Comments
 (0)