@zohodesk/codestandard-validator 1.3.1-node-14 → 1.3.1-platform-14

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.
@@ -73,10 +73,22 @@ function getSupportedLanguage() {
73
73
  return [...new Set(_language)];
74
74
  }
75
75
  function getRunningEnv() {
76
- const command = "npm config get lint_env";
77
- return execSync(command, {
78
- shell: true
79
- }).toString().trim();
76
+ if (process.env.npm_config_lint_env) {
77
+ return String(process.env.npm_config_lint_env).trim();
78
+ }
79
+ if (process.env.LINT_ENV) {
80
+ return String(process.env.LINT_ENV).trim();
81
+ }
82
+ if (process.env.CI === "true" || process.env.CI === "1") {
83
+ return "CI";
84
+ }
85
+ try {
86
+ return execSync("npm config get lint_env", {
87
+ shell: true
88
+ }).toString().trim();
89
+ } catch {
90
+ return "";
91
+ }
80
92
  }
81
93
 
82
94
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/codestandard-validator",
3
- "version": "1.3.1-node-14",
3
+ "version": "1.3.1-platform-14",
4
4
  "description": "library to enforce code standard using eslint",
5
5
  "main": "index.js",
6
6
  "scripts": {