Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: lint for iceworks-server #2426

Merged
merged 6 commits into from
Jul 15, 2019
Merged

feat: lint for iceworks-server #2426

merged 6 commits into from
Jul 15, 2019

Conversation

alvinhui
Copy link
Collaborator

@alvinhui alvinhui commented Jul 12, 2019

Background

  • Open lint for iceworks-server;
  • Fixed some irregular code with auto-fix function;
  • Manually fix some irregular code.

Notes

  • Add dist/ to .eslintignore, this is the directory of the build results of typescript;
  • set class-methods-use-this to warning, I think this is a very controversial rule, this is not used in many controllers;
  • I used /* eslint */ to ignore some rules for file and // eslint-disable-line for line, please check the specific scenario.

@alvinhui alvinhui requested a review from Orange-C July 12, 2019 03:52
@alvinhui alvinhui self-assigned this Jul 12, 2019
@@ -2,7 +2,7 @@ const { eslintTS, deepmerge } = require('@ice/spec');

module.exports = deepmerge(eslintTS, {
rules: {
// 禁止用var引入模块:取消
"@typescript-eslint/no-var-requires": 0
"@typescript-eslint/no-var-requires": 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

规则改动都加上注释说明吧

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啥意思?我觉得这些规则都比较明确,不需要再注释说明了。
你的意思是加上注释为什么 取消?

const pages = await this.scanPages(this.path);
return _.orderBy(pages, 'name', 'asc');
}

async getOne(): Promise<any> { }
public async getOne(): Promise<any> { }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些空函数的意义是什么?如果业务没有需要可以删除吧,没必要为了加这个还改写规则

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -1,3 +1,4 @@
/* eslint no-eval: 0 */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

改成单行取消

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@Orange-C Orange-C merged commit 6581d84 into feat-one-lint Jul 15, 2019
@delete-merged-branch delete-merged-branch bot deleted the iceworks/sever-lint branch July 15, 2019 02:03
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants