Browse Source

fix: lint js and docs alongside clang-format (backport: 3-0-x) (#14053)

* fix: lint js and docs alongside clang-format

* chore: change lint scripts to colon format
trop[bot] 6 years ago
parent
commit
2af61cbe95
1 changed files with 9 additions and 9 deletions
  1. 9 9
      package.json

+ 9 - 9
package.json

@@ -54,20 +54,20 @@
     "clang-format": "find atom/ brightray/ chromium_src/ -iname *.h -o -iname *.cc -o -iname *.mm | xargs clang-format -i",
     "coverage": "npm run instrument-code-coverage && npm test -- --use_instrumented_asar",
     "instrument-code-coverage": "electabul instrument --input-path ./lib --output-path ./out/coverage/electron.asar",
-    "lint": "npm run lint-js && npm run lint-cpp && npm run lint-clang-format && npm run lint-py && npm run lint-docs",
-    "lint-js": "standard && cd spec && standard",
-    "lint-clang-format": "python script/run-clang-format.py -r -c atom/ chromium_src/ brightray/ || (echo \"\\nCode not formatted correctly.\" && exit 1)",
-    "lint-cpp": "python ./script/cpplint.py",
-    "lint-py": "python ./script/pylint.py",
-    "lint-docs": "remark docs -qf && npm run lint-js-in-markdown && npm run create-typescript-definitions && npm run lint-docs-relative-links",
-    "lint-docs-relative-links": "python ./script/check-relative-doc-links.py",
-    "lint-js-in-markdown": "standard-markdown docs",
+    "lint": "npm run lint:js && npm run lint:cpp && npm run lint:clang-format && npm run lint:py && npm run lint:docs",
+    "lint:js": "standard && cd spec && standard",
+    "lint:clang-format": "python script/run-clang-format.py -r -c atom/ chromium_src/ brightray/ || (echo \"\\nCode not formatted correctly.\" && exit 1)",
+    "lint:cpp": "python ./script/cpplint.py",
+    "lint:py": "python ./script/pylint.py",
+    "lint:docs": "remark docs -qf && npm run lint:js-in-markdown && npm run create-typescript-definitions && npm run lint:docs-relative-links",
+    "lint:docs-relative-links": "python ./script/check-relative-doc-links.py",
+    "lint:js-in-markdown": "standard-markdown docs",
     "create-api-json": "electron-docs-linter docs --outfile=out/electron-api.json --version=$npm_package_version",
     "create-typescript-definitions": "npm run create-api-json && electron-typescript-definitions --in=out/electron-api.json --out=out/electron.d.ts",
     "mock-release": "node ./script/ci-release-build.js",
     "preinstall": "node -e 'process.exit(0)'",
     "publish-to-npm": "node ./script/publish-to-npm.js",
-    "precommit": "python script/run-clang-format.py -r -c atom/ chromium_src/ brightray/ || (echo \"Code not formatted correctly.\" && exit 1)",
+    "precommit": "python script/run-clang-format.py -r -c atom/ chromium_src/ brightray/ && npm run lint:js && remark docs -qf || (echo \"Code not formatted correctly.\" && exit 1)",
     "prepack": "check-for-leaks",
     "prepush": "check-for-leaks",
     "prepare-release": "node ./script/prepare-release.js",