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

Commit457cdc6

Browse files
committed
setup config override rules for emotion styles
1 parentfb0dd7c commit457cdc6

File tree

7 files changed

+51
-11
lines changed

7 files changed

+51
-11
lines changed

‎.eslintrc.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ module.exports = {
1616
'@typescript-eslint/ban-ts-ignore':'off',
1717
'@typescript-eslint/no-unused-vars':'off',
1818
'@typescript-eslint/camelcase':'off',
19-
'react/forbid-component-props':[1,{forbid:['style']}],
20-
'react/forbid-dom-props':[1,{forbid:['style']}],
19+
//'react/forbid-component-props': [1, { forbid: ['style'] }],
20+
//'react/forbid-dom-props': [1, { forbid: ['style'] }],
2121
},
2222
}

‎.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"editor.formatOnSave":true,
33
"editor.codeActionsOnSave": {
4-
"source.organizeImports":true,
4+
"source.organizeImports":false,
55
"source.fixAll":true
66
},
77
"eslint.validate": ["javascript","javascriptreact","typescript","typescriptreact"],

‎web-app/.storybook/webpack.config.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ module.exports = ({ config }) => {
2222
},
2323
],
2424
],
25-
presets:[['react-app',{flow:false,typescript:true}],['@emotion/babel-preset-css-prop']],
25+
presets:[
26+
// react-app
27+
['react-app',{flow:false,typescript:true}],
28+
// allow emotion css prop on html
29+
['@emotion/babel-preset-css-prop'],
30+
],
2631
},
2732
})
2833

‎web-app/config-overrides.js

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,45 @@
1-
const{ addLessLoader, addBabelPreset}=require('customize-cra')
1+
constpath=require('path')// eslint-disable-line
22

33
module.exports=functionoverride(config){
4-
addBabelPreset('@emotion/babel-preset-css-prop')(config)
4+
config.module.rules.push({
5+
test:/\.(woff(2)?|ttf|eot|svg)(\?v=\d+\.\d+\.\d+)?$/,
6+
use:[
7+
{
8+
loader:'file-loader',
9+
options:{
10+
name:'[name].[ext]',
11+
outputPath:'fonts/',
12+
},
13+
},
14+
],
15+
})
16+
17+
config.module.rules.push({
18+
test:/\.(ts|tsx)$/,
19+
loader:require.resolve('babel-loader'),
20+
options:{
21+
plugins:[
22+
// load css for@alifd/next components
23+
[
24+
'babel-plugin-import',
25+
{
26+
libraryName:'@alifd/next',
27+
style:true,
28+
},
29+
],
30+
],
31+
presets:[
32+
// react-app
33+
['react-app',{flow:false,typescript:true}],
34+
// allow emotion css prop on html
35+
['@emotion/babel-preset-css-prop'],
36+
],
37+
},
38+
})
39+
40+
config.resolve.extensions.push('.ts','.tsx')
41+
42+
config.resolve.modules=['node_modules',path.resolve(__dirname,'./src')]
543

644
returnconfig
745
}

‎web-app/src/components/Button/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import{ButtonasAlifdButton}from'@alifd/next'
22
import*asReactfrom'react'
3-
import{css,jsx}from'@emotion/core'
43

54
interfaceProps{
65
style?:React.CSSProperties
@@ -11,7 +10,7 @@ interface Props {
1110
}
1211

1312
constButton=(props:Props)=>(
14-
<AlifdButtononClick={props.onClick}type={props.type}disabled={props.disabled}css={props.style}>
13+
<AlifdButtononClick={props.onClick}type={props.type}disabled={props.disabled}style={props.style}>
1514
{props.children}
1615
</AlifdButton>
1716
)

‎web-app/src/components/Icon/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import{IconasAlifdIcon}from'@alifd/next'
22
import*asReactfrom'react'
3-
import{css,jsx}from'@emotion/core'
43

54
interfaceProps{
65
type:string
@@ -10,7 +9,7 @@ interface Props {
109
}
1110

1211
constIcon=(props:Props)=>{
13-
return<AlifdIcontype={props.type}role={props.role}size={props.size}css={props.style}/>
12+
return<AlifdIcontype={props.type}role={props.role}size={props.size}style={props.style}/>
1413
}
1514

1615
exportdefaultIcon

‎web-app/src/styles/index.css

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
@import'~@alifd/next/dist/next.css';
21
@import'~@alifd/theme-4/dist/next.css';
32

43
html {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp