简体   繁体   English

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

[英]Import sources within a group must be alphabetized., cant find the right order

I have this simple code below and I got this error when building, but its not clear for me what the order of my imports should be.我在下面有这个简单的代码,并且在构建时遇到了这个错误,但我不清楚我的导入顺序应该是什么。

  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;

Set these in your tslint.json :在您的tslint.json设置这些:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM