Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

feat: prefer ES6 syntax #22

Merged
merged 3 commits into from
Nov 2, 2019
Merged

feat: prefer ES6 syntax #22

merged 3 commits into from
Nov 2, 2019

Conversation

curbengh
Copy link
Contributor

@curbengh curbengh commented Sep 3, 2019

@curbengh curbengh requested a review from a team September 3, 2019 09:38
@curbengh curbengh requested a review from segayuu September 4, 2019 04:16
@tomap
Copy link
Contributor

tomap commented Sep 7, 2019

I just ran your last change with --fix on hexojs/hexo master and got:

C:\dev\hexo\lib\extend\console.js
  55:13  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\extend\filter.js
  33:17  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\hexo\index.js
  435:16  error  Unexpected chained assignment  no-multi-assign
  437:17  error  Unexpected chained assignment  no-multi-assign
  439:16  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\hexo\locals.js
  17:13  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\hexo\post.js
  178:16  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\hexo\router.js
  17:17  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\plugins\console\config.js
  58:14  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\plugins\console\list\route.js
  28:16  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\plugins\helper\format.js
   6:22  error  Unexpected chained assignment  no-multi-assign
  12:21  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\plugins\helper\fragment_cache.js
  9:20  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\lib\theme\index.js
  36:17  error  Unexpected chained assignment  no-multi-assign
  69:17  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\test\scripts\box\box.js
  18:5  error  Combine this with the previous 'const' statement  one-var
  36:5  error  Combine this with the previous 'const' statement  one-var
  47:5  error  Combine this with the previous 'const' statement  one-var
  59:5  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\box\file.js
  37:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\console\config.js
  94:24  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\test\scripts\console\render.js
  16:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\extend\tag.js
   35:5  error  Combine this with the previous 'const' statement  one-var
   51:5  error  Combine this with the previous 'const' statement  one-var
   67:5  error  Combine this with the previous 'const' statement  one-var
   93:5  error  Combine this with the previous 'const' statement  one-var
  113:5  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\extend\tag_errors.js
   44:5  error  Combine this with the previous 'const' statement  one-var
   68:5  error  Combine this with the previous 'const' statement  one-var
  110:5  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\filters\i18n_locals.js
  102:5  error  Combine this with the previous 'const' statement  one-var
  121:5  error  Combine this with the previous 'const' statement  one-var
  140:5  error  Combine this with the previous 'const' statement  one-var
  161:5  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\filters\meta_generator.js
  21:5  error  Combine this with the previous 'const' statement  one-var
  31:5  error  Combine this with the previous 'const' statement  one-var
  42:5  error  Combine this with the previous 'const' statement  one-var
  47:5  error  Combine this with the previous 'const' statement  one-var
  58:5  error  Combine this with the previous 'const' statement  one-var
  63:5  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\css.js
  13:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\favicon_tag.js
  13:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\feed_tag.js
  13:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\gravatar.js
  12:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\image_tag.js
  13:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\js.js
  13:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\link_to.js
  13:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\list_archives.js
  15:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\list_categories.js
  17:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\list_posts.js
  14:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\list_tags.js
  17:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\mail_to.js
  15:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\open_graph.js
  226:5  error  Combine this with the previous 'const' statement  one-var
  309:5  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\paginator.js
  18:3  error  Combine this with the previous 'const' statement  one-var
  31:5  error  Combine this with the previous 'let' statement    one-var

C:\dev\hexo\test\scripts\helpers\partial.js
  28:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\helpers\tagcloud.js
  17:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\hexo\load_config.js
  52:24  error  Unexpected chained assignment  no-multi-assign

C:\dev\hexo\test\scripts\hexo\multi_config_path.js
  84:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\hexo\render.js
   14:3  error  Combine this with the previous 'const' statement  one-var
  277:5  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\hexo\router.js
  81:5  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\tags\blockquote.js
  10:3  error  Combine this with the previous 'const' statement  one-var

C:\dev\hexo\test\scripts\theme\view.js
  80:5  error  Combine this with the previous 'const' statement  one-var

and the following changes:
image

97 files changes :)

That is a lot of changes
Maybe we should introduce them progressively, or in two times: first the ones that are easily manually fixable, and then the others?

@curbengh
Copy link
Contributor Author

curbengh commented Sep 7, 2019

I propose no-multi-assign PR and one-var PR in hexo. We can fix hexo before releasing this PR.

@curbengh
Copy link
Contributor Author

Pending #25, if that is approved, this PR needs to remove some conflicting rules.

@curbengh
Copy link
Contributor Author

Reverted one-var rule as it's not related to es6.

@curbengh
Copy link
Contributor Author

suggest to hold off merging for now, let's refactor hexo first to see if this PR is actually viable.

@curbengh
Copy link
Contributor Author

Pending hexojs/hexo#3717

@curbengh
Copy link
Contributor Author

curbengh commented Nov 2, 2019

Refactored hexo:

I'm merging this since this PR is viable.

@curbengh curbengh merged commit 7c3417f into master Nov 2, 2019
@curbengh curbengh deleted the es6-rule branch November 2, 2019 06:06
@curbengh curbengh mentioned this pull request Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants