Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

Commit2f5d5bc

Browse files
committed
refactor(naming): use@xxx for local import
1 parent40bc04f commit2f5d5bc

File tree

367 files changed

+557
-532
lines changed

Some content is hidden

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

367 files changed

+557
-532
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
importReactfrom'react'
88
importPropTypesfrom'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
importstyledfrom'styled-components'
22

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

66
exportconstAddWrapper=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
importstyledfrom'styled-components'
22

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

55
exportconstAvatars=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
importReactfrom'react'
88
importPropTypesfrom'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
importstyledfrom'styled-components'
2-
import{theme}from'utils'
2+
import{theme}from'@utils'
33

44
exportconstCenter=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
importRfrom'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
importAdderCellfrom'../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
importstyledfrom'styled-components'
22

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

66
exportconstUnsetText=styled.div`

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp