gpt4 book ai didi

javascript - 组内的导入源必须按字母顺序排列,找不到正确的顺序

转载 作者:行者123 更新时间:2023-12-02 23:59:19 25 4
gpt4 key购买 nike

我下面有这个简单的代码,在构建时出现此错误,但我不清楚导入的顺序应该是什么。

  import * as React from 'react';
import './App.css';
import logo from './logo.svg';
import { DefaultButton } from 'office-ui-fabric-react/lib/Button';


class App extends React.Component {
public render() {
return (
<div className="App">
<DefaultButton
text='See Button'
primary={ true }
href='#/components/button'
/>
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<h1 className="App-title">Welcome to React</h1>
</header>
<p className="App-intro">
To get started, edit <code>src/App.tsx</code> and save to reload.
</p>
</div>
);
}
}

export default App;

最佳答案

tslint.json 中设置这些:

  "rules": {
"ordered-imports": [false],
"object-literal-sort-keys": [false]
}

关于javascript - 组内的导入源必须按字母顺序排列,找不到正确的顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55247219/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com