0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00
nodejs/tools
Vse Mozhet Byt 9a6dd07e8d tools: overhaul tools/doc/json.js
Modernize:
* Replace `var` with `const` / `let`.
* Wrap `switch` cases with `const`/`let` in blocks.
* Replace common functions with arrow functions.
* Replace string concatenation with template literals.
* Shorthand object literals.
* Use destructuring and spread.

Optimize:
* Move RegExp declaration out of loops.
* Replace `.match()` with `.test()` in boolean context.
* Replace RegExp with string when string suffices.
* Make RegExp more strict to reject unrelated cases.
* Make RegExp do the trimming to eliminate many `.trim()` calls.
* Cache retrieved object properties.
* Remove conditions that cannot be false.
* Remove code that seems obsolete
  (it means a state that cannot happen or is not typical).

Clarify:
* Sync code examples in comments with the actual source state.
* Expand some one-letter variable names.
* Rename confusingly similar variables.
* Move variable declarations closer to their context.
* Remove non-actual commented out code.
* Unify blank lines between top-level blocks.

Fix:
* Fix conditions that cannot be true.

Guard:
* Throw on unexpected state more often.

PR-URL: https://github.com/nodejs/node/pull/19832
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2018-04-08 16:57:47 +03:00
..
bootstrap
configure.d
doc tools: overhaul tools/doc/json.js 2018-04-08 16:57:47 +03:00
eslint-rules lint: change require-buffer rule message 2018-04-02 23:11:54 -05:00
gyp Revert "tools: teach gyp to write an 'all deps' rule" 2018-01-25 08:18:42 +11:00
icu tools: don’t emit illegal utf-8 from icutrim/iculslocs 2018-04-03 08:00:04 -07:00
macos-installer
msvs build, win: vcbuild improvements 2018-02-22 12:43:35 +01:00
node_modules tools: update ESLint to 4.19.1 2018-03-24 04:11:48 -07:00
pkgsrc
remark-cli
remark-preset-lint-node doc: add new documentation lint rule 2018-02-23 16:26:29 +00:00
rpm
.eslintrc.yaml
certdata.txt tools: update certdata.txt 2018-03-26 18:20:07 -04:00
check_macros.py lib: add internal check macros 2018-03-05 08:35:44 -06:00
check-imports.py
compress_json.py
cpplint.py
create_android_makefiles
create_expfile.sh
dcheck_macros.py lib: add internal check macros 2018-03-05 08:35:44 -06:00
genv8constants.py
getmoduleversion.py
getnodeversion.py
gyp_node.py
install.py
js2c.py tools,bootstrap: preprocess gypi files to json 2018-03-09 12:38:31 -06:00
license2rtf.js
license-builder.sh tools: add babel-eslint 2018-01-11 09:50:47 +01:00
lint-js.js
lsan_suppressions.txt
macosx-firewall.sh
make-v8.sh
Makefile
mk-ca-bundle.pl
mkssldef.py
nodcheck_macros.py lib: add internal check macros 2018-03-05 08:35:44 -06:00
osx-codesign.sh
osx-pkg-postinstall.sh
osx-productsign.sh
release.sh
run-valgrind.py
sign.bat
specialize_node_d.py
test-npm-package.js tools: fix test-npm-package 2018-03-12 19:49:27 -04:00
test-v8.bat
test.py
update-authors.sh
update-babel-eslint.sh tools: add babel-eslint 2018-01-11 09:50:47 +01:00
update-eslint.sh
utils.py