我下面有这个简单的代码,在构建时遇到了这个错误,但对我来说不清楚我的导入顺序。
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;
答案 0 :(得分:1)
在您的tslint.json
中设置它们:
"rules": {
"ordered-imports": [false],
"object-literal-sort-keys": [false]
}