Skip to content
This repository has been archived by the owner on Oct 20, 2021. It is now read-only.

Code convention

Kimi Gao edited this page Aug 29, 2018 · 7 revisions

CSS Style

  • Yandex BEM Style
  • The structure of the BEM follows the pattern:
    • block-name_modifier-name
    • block-name__element-name_modifier-name
  • Use prefixCls variable in js and prefix-cls variable in less

JavaScript Style

customized rules:

"rules": {
  "jsx-quotes": ["error", "prefer-double"],
  "react/jsx-no-bind": 0
}

Global Modules(do not need to import)

import React from 'react'
import PropTypes from 'prop-types'
import cx from 'classnames'

> NOTE: replace Component with React.Component

class ComponentName extends React.Component