Giter Club home page Giter Club logo

Comments (4)

wssgcg1213 avatar wssgcg1213 commented on May 18, 2024

生成的代码格式只是一个示例, 是不是可以考虑放宽 prefer-stateless-function 这一 lint 限制? @yujiangshui

from ice.

yujiangshui avatar yujiangshui commented on May 18, 2024

from ice.

wssgcg1213 avatar wssgcg1213 commented on May 18, 2024

@chenbin92 麻烦修改一下所有脚手架的 eslint 规则, 放行 react/prefer-stateless-function


@xingqiyi 出现这个的原因是我们的 eslint 规则过于严格, 对于通过iceworks自动生成的页面代码, eslint 认为不符合规范, 我们生成的代码大致格式如下:

import React, { Component } from 'react';

export default class XXXPage extends Component {

  render() {
     return (
       <div>
          <BlockA />
          <BlockB />
       </div>
     );
  }
}

这个代码只是一个类似脚手架的示范, 使用者可以根据自身需求在页面上使用 React 的生命周期方法

所以我们决定放行这一条 eslint 规则, 如果是已经创建的项目, 只需要在 .eslintrc 文件的 rules 字段加上

"react/prefer-stateless-function": 0

就可以了

from ice.

yuanyan avatar yuanyan commented on May 18, 2024

@xingqiyi 感谢反馈,可以发你的收货地址和联系方式到 [email protected] ,正式发布后我们会寄送小礼品给你

from ice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.