组内的导入源必须按字母顺序排列。无法找到正确的顺序
Import sources within a group must be alphabetized., cant find the right order
我在下面有这个简单的代码,在构建时遇到了这个错误,但我不清楚我的导入顺序应该是什么。
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]
}
我在下面有这个简单的代码,在构建时遇到了这个错误,但我不清楚我的导入顺序应该是什么。
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]
}