@zohodesk/codestandard-validator 0.0.4-exp-18 → 0.0.4-exp-20

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.
@@ -33,5 +33,6 @@ module.exports = {
33
33
  impactBasedPrecommit: true,
34
34
  shouldWarningsAbortCommit: false,
35
35
  token: "w-OkG3f5OOM1Rkly8phZ",
36
- compareBranch: 'release'
36
+ compareBranch: 'release',
37
+ supportedExtensions: ['.js', '.jsx', '.ts', '.tsx', '.properties']
37
38
  };
@@ -10,15 +10,20 @@ const {
10
10
  const {
11
11
  Logger
12
12
  } = require('../Logger/Logger');
13
+ const {
14
+ existsSync
15
+ } = require("fs");
13
16
  function createVersionControlFile(uninstalledPlugins) {
14
17
  Logger.log(Logger.INFO_TYPE, `Rule Plugin Versions are Noted in pluginVersionControl.js`);
15
18
  const versionfilePath = path.join(getNodeModulesPath(), 'node_modules', '@zohodesk', 'codestandard-validator', 'pluginVersionControl.js');
16
- writeFileSync(versionfilePath, `module.exports.plugins = [${uninstalledPlugins.map(plugin => {
17
- return JSON.stringify({
18
- plugin: `${plugin}`,
19
- time: `${new Date()}`
20
- });
21
- }).join(',')}]`);
19
+ if (existsSync(versionfilePath)) {
20
+ writeFileSync(versionfilePath, `module.exports.plugins = [${uninstalledPlugins.map(plugin => {
21
+ return JSON.stringify({
22
+ plugin: `${plugin}`,
23
+ time: `${new Date()}`
24
+ });
25
+ }).join(',')}]`);
26
+ }
22
27
  }
23
28
  module.exports = {
24
29
  createVersionControlFile
@@ -54,11 +54,10 @@ function getConfigurationPrecommit() {
54
54
  * @returns {Array<string>}
55
55
  */
56
56
  function getSupportedLanguage() {
57
- const _language = [];
58
- _language.push('.js');
59
- _language.push('.jsx');
60
- _language.push('.ts');
61
- _language.push('.tsx');
57
+ const {
58
+ supportedExtensions
59
+ } = getConfigurationPrecommit();
60
+ const _language = supportedExtensions;
62
61
  return _language;
63
62
  }
64
63
  function getRunningEnv() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/codestandard-validator",
3
- "version": "0.0.4-exp-18",
3
+ "version": "0.0.4-exp-20",
4
4
  "description": "library to enforce code standard using eslint",
5
5
  "main": "index.js",
6
6
  "scripts": {