@zohodesk/codestandard-validator 0.0.2-exp-10 → 0.0.2-exp-11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -275,17 +275,9 @@ async function preCommitHook() {
275
275
  Logger.log(Logger.INFO_TYPE, 'Error executing pre commit hook');
276
276
  }
277
277
  if (shouldAbortCommit) {
278
- if (hasEslintErrorsInChangedLines && areFilesStaged) {
279
- Logger.log(Logger.FAILURE_TYPE, `There are eslint errors present. So commit is aborted`);
280
- process.exit(1);
281
- } else if (hasEslintErrorsInFiles && areFilesStaged) {
282
- Logger.log(Logger.FAILURE_TYPE, `There are eslint errors present. So commit is aborted`);
283
- process.exit(1);
284
- } else if (!hasEslintErrorsInFiles && !hasEslintErrorsInChangedLines && areFilesStaged) {
285
- Logger.log(Logger.SUCCESS_TYPE, `Commit Successful`);
286
- process.exit(0);
287
- }
288
- } else if (!shouldAbortCommit && areFilesStaged) {
278
+ Logger.log(Logger.FAILURE_TYPE, `There are eslint errors present. So commit is aborted. If possible try to fix the eslint warnings also.`);
279
+ process.exit(1);
280
+ } else {
289
281
  Logger.log(Logger.SUCCESS_TYPE, `Commit Successful`);
290
282
  process.exit(0);
291
283
  }
@@ -14,6 +14,7 @@ const path = require("path");
14
14
  * @property {string} tsConfigurationPath - The path of the ts configuration Path
15
15
  * @property {number} projectId - project id of repository
16
16
  * @property {boolean} impactBasedPrecommit - Indicates if the linting is impact-based in pre commit
17
+ * @property {boolean} shouldWarningsAbortCommit - Indicates if eslint warnings should abort the commit
17
18
  * @property {string} token - Encrypted Authentication Token
18
19
  * @property {string} compareBranch - Branch to compare diff
19
20
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/codestandard-validator",
3
- "version": "0.0.2-exp-10",
3
+ "version": "0.0.2-exp-11",
4
4
  "description": "library to enforce code standard using eslint",
5
5
  "main": "index.js",
6
6
  "scripts": {