├── .eslintrc.js ├── .gitignore ├── README.md ├── config ├── deploy.config.dev.js ├── deploy.config.pre.js ├── deploy.config.prod.js ├── deploy.config.test.js ├── env.js ├── jest │ ├── cssTransform.js │ └── fileTransform.js ├── paths.js ├── polyfills.js ├── webpack.config.dev.js ├── webpack.config.dev.micro.js ├── webpack.config.micro.js ├── webpack.config.prod.js └── webpackDevServer.config.js ├── jsconfig.json ├── package-lock.json ├── package.json ├── public ├── index.html ├── manifest.json └── project.json ├── scripts ├── build.js ├── build.micro.js ├── deploy.js ├── mock.js ├── start.js └── test.js ├── src ├── Store.js ├── common │ ├── apiPath.js │ ├── asyncComponent.js │ ├── menu.js │ └── router.js ├── components │ ├── Demo │ │ ├── demo │ │ │ ├── 403.md │ │ │ ├── 404.md │ │ │ └── 500.md │ │ ├── index.d.ts │ │ ├── index.en-US.md │ │ ├── index.js │ │ ├── index.less │ │ ├── index.zh-CN.md │ │ └── typeConfig.js │ ├── Exception │ │ ├── demo │ │ │ ├── 403.md │ │ │ ├── 404.md │ │ │ └── 500.md │ │ ├── index.d.ts │ │ ├── index.en-US.md │ │ ├── index.js │ │ ├── index.less │ │ ├── index.zh-CN.md │ │ └── typeConfig.js │ ├── FooterToolbar │ │ ├── demo │ │ │ └── basic.md │ │ ├── index.d.ts │ │ ├── index.en-US.md │ │ ├── index.js │ │ ├── index.less │ │ └── index.zh-CN.md │ ├── GlobalHeader │ │ ├── index.js │ │ └── index.less │ ├── HotPersonCascader │ │ ├── index.js │ │ └── style.less │ ├── Operating │ │ ├── index.js │ │ └── index.less │ ├── PageHeader │ │ ├── demo │ │ │ ├── image.md │ │ │ ├── simple.md │ │ │ ├── standard.md │ │ │ └── structure.md │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.less │ │ ├── index.md │ │ └── index.test.js │ ├── Result │ │ ├── demo │ │ │ ├── classic.md │ │ │ ├── error.md │ │ │ └── structure.md │ │ ├── index.d.ts │ │ ├── index.js │ │ ├── index.less │ │ └── index.md │ ├── SiderMenu │ │ ├── index.js │ │ └── index.less │ ├── StandardTable │ │ ├── index.js │ │ └── index.less │ └── _utils │ │ ├── pathTools.js │ │ └── pathTools.test.js ├── constant │ └── index.js ├── index.js ├── index.less ├── layouts │ ├── BasicLayout.js │ ├── BasicLayout.less │ ├── BasicLayout.local.js │ ├── PageHeaderLayout.js │ └── PageHeaderLayout.less ├── registerServiceWorker.js ├── root.component.js ├── routes │ ├── Exception │ │ ├── 403.js │ │ ├── 404.js │ │ ├── 500.js │ │ ├── style.less │ │ └── triggerException.js │ ├── page │ │ └── index.js │ ├── page2 │ │ └── index.js │ └── page3 │ │ └── index.js ├── store │ └── index.js ├── theme.js └── utils │ ├── Authorized.js │ ├── authority.js │ ├── index.js │ ├── notify.js │ ├── province.js │ ├── request.js │ ├── utils.js │ ├── utils.less │ ├── verify.js │ └── xssAnddecodeEntities.js └── tsconfig.json /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: ['react'], 3 | parser: 'babel-eslint', 4 | parserOptions: { 5 | ecmaVersion: 6, 6 | ecmaFeatures: { // 其他语言特性 7 | experimentalObjectRestSpread: true, // ...rest参数和扩展扩算符 8 | jsx: true, 9 | modules: true 10 | }, 11 | sourceType: 'module', // 默认script,可选module 12 | }, 13 | env: { 14 | es6: true, 15 | node: true, 16 | browser: true, 17 | }, 18 | globals: { // 全局变量,false代表无法重写 19 | React: true, 20 | document: false, 21 | navigator: false, 22 | window: false, 23 | 'DEV': true, 24 | 'TEST': true, 25 | 'PRE': true, 26 | 'PRO': true, 27 | 'MICRO': true 28 | }, 29 | // http://eslint.org/docs/rules/xxx, xxx代表rule名称, 0=off, 1=warning, 2=error 30 | rules: { // 具体规则 31 | 'accessor-pairs': 2, // getter/setter成对出现 32 | 'arrow-spacing': [ 33 | 1, 34 | { 35 | 'before': true, 'after': true 36 | } 37 | ], // 箭头函数前后有空格 38 | 'array-bracket-spacing': [ 39 | 1, 'never' 40 | ], // 数组内前后无空格 41 | 'block-spacing': [ 42 | 1, 'always' 43 | ], // 单行{}前后有空格 44 | 'brace-style': [ 45 | 2, '1tbs', 46 | { 47 | 'allowSingleLine': true 48 | } 49 | ], // {}换行,单行不用 50 | 'camelcase': [ 51 | 2, 52 | { 53 | 'properties': 'never' 54 | } 55 | ], // 属性名可以不是驼峰 56 | 'comma-dangle': [ 57 | 1, 'only-multiline' 58 | ], // 数组/对象最后一个必须有, 59 | 'comma-spacing': [ 60 | 1, 61 | { 62 | 'before': false, 'after': true 63 | } 64 | ], // ,前有空格, 后无空格 65 | 'comma-style': [ 66 | 2, 'last' 67 | ], // ,在最后,不能换行 68 | 'constructor-super': 1, // super()在必须构造函数内 69 | 'curly': [ 70 | 2, 'multi-line' 71 | ], // if/while等函数可以多行不带{} 72 | 'dot-location': [ 73 | 2, 'property' 74 | ], // .的位置可以在换行 75 | 'eol-last': 1, // 文件末尾需要空白行 76 | 'eqeqeq': [ 77 | 2, 'allow-null' 78 | ], // 必须===, null除外 79 | 'generator-star-spacing': [ 80 | 2, 81 | { 82 | 'before': true, 'after': true 83 | } 84 | ], // generator函数前后有空格 85 | 'handle-callback-err': [ 86 | 2, '^(err|error)$' 87 | ], // 有err/error必须处理异常 88 | 'indent': [ 89 | 1, 90 | 2, 91 | { 92 | 'SwitchCase': 1 93 | } 94 | ], // 缩进2格,switch中1格 95 | 'jsx-quotes': [ 96 | 2, 'prefer-single' 97 | ], // jsx属性用单引号 98 | 'key-spacing': [ 99 | 2, 100 | { 101 | 'beforeColon': false, 'afterColon': true 102 | } 103 | ], // 对象属性前有空格, 后无空格 104 | 'keyword-spacing': [ 105 | 2, 106 | { 107 | 'before': true, 'after': true 108 | } 109 | ], // 关键词前后有空格, 如if-else 110 | 'new-cap': [ 111 | 2, 112 | { 113 | 'newIsCap': true, 'capIsNew': false 114 | } 115 | ], // new后必须大写开头构造函数, 大写开头不一定要new 116 | 'new-parens': 2, // new的构造函数必须带参数 117 | 'object-curly-spacing': [ 118 | 2, 'always', 119 | { 120 | objectsInObjects: false 121 | } 122 | ], // 对象{}前后有空格, 对象内的对象例外 123 | 'no-array-constructor': 2, // Array(10)->yes, Array(1, 2)->no 124 | 'no-caller': 2, // 禁止caller/callee 125 | 'no-class-assign': 2, // 禁止赋值class 126 | 'no-cond-assign': 2, // 条件不能有赋值 127 | 'no-const-assign': 2, // 禁止赋值常量(const) 128 | 'no-control-regex': 2, // reg中不能有控制符号 129 | 'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 1, // node环境prod禁用 130 | 'no-delete-var': 2, // 不能delete变量,可以用在对象 131 | 'no-dupe-args': 2, // 参数不能重复 132 | 'no-dupe-class-members': 2, // class中方法不能有重复 133 | 'no-dupe-keys': 2, // 对象key不能重复 134 | 'no-duplicate-case': 2, // switch不能有重复case 135 | 'no-empty-character-class': 2, // reg中不能有空字符串 136 | 'no-empty-pattern': 2, // 解构不能有空解构模式 137 | 'no-eval': 2, // 不能用eval 138 | 'no-ex-assign': 2, // 不能复制catch中的error 139 | 'no-extend-native': 2, // 不能扩展Object原型 140 | 'no-extra-bind': 2, // bind的函数体中要有明确的this 141 | 'no-extra-boolean-cast': 2, // 禁止多余的Boolean转换 142 | 'no-extra-parens': [ 143 | 2, 'functions' 144 | ], // 函数中禁止多余的括号 145 | 'no-fallthrough': 2, // switch需要break 146 | 'no-floating-decimal': 2, // float中0不能省略 147 | 'no-func-assign': 2, // 禁止赋值函数 148 | 'no-implied-eval': 2, // 禁止隐性eval 149 | 'no-inner-declarations': [ 150 | 2, 'functions' 151 | ], // 禁止在条件中声明function 152 | 'no-invalid-regexp': 2, // 禁止无用的reg 153 | 'no-irregular-whitespace': 2, // 禁止不规则空格 154 | 'no-iterator': 2, // 禁止使用__iterator__属性 155 | 'no-label-var': 2, // 禁止label var 156 | 'no-labels': [ 157 | 2, 158 | { 159 | 'allowLoop': false, 'allowSwitch': false 160 | } 161 | ], // 禁止label表达式 162 | 'no-lone-blocks': 2, // 禁止无用的{} 163 | 'no-mixed-spaces-and-tabs': 2, // space和tab不混用 164 | 'no-multi-spaces': 1, // 禁止多空格 165 | 'no-multi-str': 2, // 禁止多行的string 166 | 'no-multiple-empty-lines': [ 167 | 2, 168 | { 169 | 'max': 1 170 | } 171 | ], // 禁止多空行,最大1行 172 | 'no-native-reassign': 2, // 禁止赋值原生对象(window/Object...) 173 | 'no-negated-in-lhs': 2, // !(key in object)->yes, !key in object->no 174 | 'no-new-object': 2, // new Object()->no 175 | 'no-new-require': 2, // new require(xxx)->no 176 | 'no-new-symbol': 2, // new Symbol(xxx)->no 177 | 'no-new-wrappers': 2, // String/Number等不能用new 178 | 'no-obj-calls': 2, // 禁止calling全局对象属性,如Math/JSON 179 | 'no-octal': 2, // 禁止八进制文字 180 | 'no-octal-escape': 2, // 禁止八进制转义 181 | 'no-path-concat': 2, // __dirname和__filename禁止string拼接 182 | 'no-proto': 2, // 禁止使用__proto__ 183 | 'no-redeclare': 2, // 禁止重新复制var 184 | 'no-regex-spaces': 2, // 禁止reg出现多个空格 185 | 'no-return-assign': [ 186 | 2, 'except-parens' 187 | ], // 禁止return中赋值 188 | 'no-self-assign': 2, // 禁止自身赋值 189 | 'no-self-compare': 2, // 禁止自身比较, 如果NaN->Number.isNaN 190 | 'no-sequences': 2, // 禁止,操作符 191 | 'no-shadow-restricted-names': 2, // 禁止跟踪严格模式下部分关键词 192 | 'no-spaced-func': 2, // function的()不要空格 193 | 'no-sparse-arrays': 2, // array不能用空元素 194 | 'no-this-before-super': 2, // super()前不能用this 195 | 'no-throw-literal': 2, // 禁止直接throw内容,必须是Error() 196 | 'no-trailing-spaces': 1, // 禁止多余的空格 197 | // 'no-undef': 2, // 禁止使用未赋值变量 198 | 'no-undef-init': 2, // 变量不能初始化为undefined 199 | 'no-unexpected-multiline': 2, // 禁止有疑义的多行表达式 200 | 'no-unmodified-loop-condition': 2, // 循环中的变量要在循环中修改 201 | 'no-unneeded-ternary': [ 202 | 2, 203 | { 204 | 'defaultAssignment': false 205 | } 206 | ], // 禁止不必要的三元操作符 207 | 'no-unreachable': 2, // return/throw等之后不应有表达式 208 | 'no-unsafe-finally': 2, // 禁止不安全的finally 209 | 'no-unused-vars': [ 210 | 0, 211 | { 212 | 'vars': 'all', 'args': 'none' 213 | } 214 | ], // 禁止不使用的变量,参数可以 215 | 'no-useless-call': 2, // 禁止无用的call 216 | 'no-useless-computed-key': 2, // 禁止无用的计算属性 217 | 'no-useless-constructor': 2, // 禁止无用的constructor 218 | 'no-whitespace-before-property': 2, // 属性前不能有空格 219 | 'no-with': 2, // 禁用with 220 | 'one-var': [ 221 | 2, 222 | { 223 | 'initialized': 'never' 224 | } 225 | ], // 只能一个var, 初始化不检查 226 | 'operator-linebreak': [ 227 | 2, 'after', 228 | { 229 | 'overrides': { 230 | '?': 'before', ':': 'before' 231 | } 232 | } 233 | ], // 操作符换行, 默认在行末, ?和:在下一行前 234 | 'padded-blocks': [ 235 | 1, 'never' 236 | ], // 作用域中没有padded的空行 237 | 'quotes': [ 238 | 2, 'single', 239 | { 240 | 'avoidEscape': true, 'allowTemplateLiterals': true 241 | } 242 | ], // 使用单引号, 转义或者模版可以例外 243 | 'semi': [ 244 | 2, 'never' 245 | ], // 禁用结尾; 246 | 'semi-spacing': [ 247 | 2, 248 | { 249 | 'before': false, 'after': true 250 | } 251 | ], // ;前有空格, 后无空格 252 | 'space-before-blocks': [ 253 | 2, 'always' 254 | ], // 作用域前有空格 255 | 'space-in-parens': [ 256 | 2, 'never' 257 | ], // 括号内无空格 258 | 'space-infix-ops': 2, // 插入的操作符需要空格, 如+/- 259 | 'space-unary-ops': [ 260 | 2, 261 | { 262 | 'words': true, 'nonwords': false 263 | } 264 | ], // 操作符单词类要空格(new/delete), 非单词不要空格(++/--/!) 265 | 'spaced-comment': [ 266 | 2, 'always', 267 | { 268 | 'markers': ['!', ',', '/', '-' 269 | ] 270 | } 271 | ], // 注释要空格,markers为例外 272 | 'template-curly-spacing': [ 273 | 2, 'never' 274 | ], // 模版字符串中变量无空格 275 | 'use-isnan': 2, // 使用isNaN 276 | 'valid-typeof': 2, // typeof的字符串必须正确 277 | 'wrap-iife': [ 278 | 2, 'any' 279 | ], // 立即调用的function必须有括号 280 | 'yield-star-spacing': [ 281 | 2, 'both' 282 | ], // yield的*前后有空格 283 | 'yoda': [ 284 | 2, 'never' 285 | ], // 条件中变量在前 286 | 'prefer-const': 0, // 能用const场景用const 287 | 'no-useless-escape': 0, // 不检查escape 288 | 'space-before-function-paren': 0, // 函数括号无空格 289 | // 'no-use-before-define': 1, // 未定义不能使用 290 | 'react/jsx-uses-react': 'error', 291 | 'react/jsx-uses-vars': 'error', 292 | 'react/prefer-es6-class': 1, // 禁止使用ES5语法创建React组件 293 | 'react/prefer-stateless-function': 1, // 组件没有状态或是没有引用refs,推荐使用无状态组件(函数声明)而不是类 294 | 'react/jsx-pascal-case': 2, // 组件名称使用帕斯卡命名法 295 | 'react/jsx-closing-bracket-location': 1, // 自关闭的jsx标签代码对齐格式 296 | 'react/jsx-tag-spacing': 1, // 自关闭的标签前加一个空格 297 | 'react/jsx-curly-brace-presence': 1, // 不需要多余的 去掉props和children多余的花括号,如title={"标题"}和