发表文章

[Ruby] 什么是更好的命名, eslint 或 javascript? What is better naming, eslint or javascript?[code-style]

JelF 2017-10-9 57

如果主题是代码样式, 则应将其命名为 "javascript" (或 "es6"), 如果主题为 eslint 配置, 则应将其命名为 "eslint"。这可能是一个艰难的抉择, 关于命名, 但据我看, 没有 eslint 严格的依赖性, 所以如果我们想添加配置为不同的绒, 它不会很难将它合并在一个 npm 包, 这可以在两个使用。

"eslint" 命名的优点:

  • 我们可以分离 eslint 配置, 例如 JSHint

"javascript"/"es6" 命名的优点:

  • 我们可以添加我们的代码样式指南 (如https://github.com/bbatsov/ruby-style-guide中的 ruby 样式指南)
  • 我希望用降价文档开发 "红宝石" 风格的指南, 这将描述所有 deviatoins 从 bbatsov/ruby 风格-指南我们正在强迫/允许和参考它的内容在 rubocop 配置文件中, 这将是一个一致的命名在这种情况下
原文:

If the subject is code style, it should be named 'javascript' (or 'es6') and if the subject is eslint config, it should be named 'eslint'. It may be a tough choise about naming, but as far as i see, there is no eslint strict dependency so if we want to add config for different linter, it would not be hard to combine it in one npm package, which could be used in both.

Pros of 'eslint' naming:

  • We can separate eslint configuration from e.g. JSHint

Pros of 'javascript' / 'es6' naming:

  • We can add our code style guide (like ruby style guide in https://github.com/bbatsov/ruby-style-guide)
  • I wish to develop 'ruby' style guides with markdown documentation, which would describe all deviatoins from bbatsov/ruby-style-guide we are forcing / allowing and refer it's content in rubocop configuration file, it would be a consistent naming in this case
相关推荐
最新评论 (0)
返回
发表文章
JelF
文章数
3
评论数
4
注册排名
60637