@zohodesk/codestandard-validator 0.0.7-exp-9 → 0.0.7-exp-10

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.
@@ -8,7 +8,7 @@ const fs = require('fs');
8
8
  const path = require('path');
9
9
  const {
10
10
  getEslintExecutablePath
11
- } = require('../../utils/EslintConfigFileUtils/getEslintExecutablePath');
11
+ } = require('../../utils/ConfigFileUtils/getEslintExecutablePath');
12
12
  const {
13
13
  getNodeModulesPath
14
14
  } = require('../../utils/General/getNodeModulesPath');
@@ -152,16 +152,15 @@ function findStyleLintErrors(filePath) {
152
152
  cwd: getNodeModulesPath()
153
153
  }, (error, stderr, stdout) => {
154
154
  if (stdout) {
155
- resolve(stderr.trim().split('\n'));
155
+ resolve(stdout.trim().split('\n'));
156
156
  }
157
- if (stderr) {
158
- resolve(stderr.trim().split('\n'));
159
- }
160
- // else if(error){
161
- // Logger.log(Logger.FAILURE_TYPE,error)
162
- // reject("Error executing eslint command")
157
+ // if(stderr){
158
+ // resolve(stderr.trim().split('\n'))
163
159
  // }
164
- else {
160
+ else if (error) {
161
+ Logger.log(Logger.FAILURE_TYPE, error);
162
+ reject("Error executing stylelint command");
163
+ } else {
165
164
  resolve([]);
166
165
  }
167
166
  });
@@ -51,13 +51,10 @@ function checkIfPluginsAreInstalled() {
51
51
  packageName,
52
52
  version
53
53
  } = plugin;
54
- const {
55
- isPluginPresent,
56
- pluginPath
57
- } = checkPluginsPresentInNodemodules(packageName);
58
- if (isPluginPresent && checkPluginHasProperVersion(packageName, pluginPath, version)) {
59
- return false;
60
- }
54
+ // const { isPluginPresent, pluginPath } = checkPluginsPresentInNodemodules(packageName) // circular installation loop so comment out
55
+ // if( isPluginPresent && checkPluginHasProperVersion(packageName,pluginPath,version)){
56
+ // return false
57
+ // }
61
58
  return `${packageName}@${version}`;
62
59
  }).filter(Boolean);
63
60
  if (uninstalledPlugins.length > 0) {
@@ -30,21 +30,12 @@ function installPlugins(pluginsToBeInstalled) {
30
30
  if (pluginsToBeInstalled.length > 0) {
31
31
  let packageJsonBeforePluginsInstallation = getPackageJsonContentBeforeInstallingPlugins();
32
32
  Logger.log(Logger.INFO_TYPE, 'Installing plugins ....');
33
+ const installCommand = `npm install --save-dev ${pluginsToBeInstalled.join(' ')} --legacy-peer-deps`;
33
34
  Logger.log(Logger.INFO_TYPE, `Install command being executed: ${installCommand}`);
34
35
  let arePluginsInstalledSuccessfully = executeSynchronizedCommands(execSync, [installCommand, {
35
36
  stdio: 'inherit',
36
37
  cwd: getNodeModulesPath()
37
38
  }], '', 'Some issue occured while installing plugins', false, true);
38
- const installCommand = ['install', '--save-dev', ...pluginsToBeInstalled, '--legacy-peer-deps'];
39
- const result = spawn('npm', installCommand, {
40
- stdio: 'inherit',
41
- shell: true,
42
- cwd: getNodeModulesPath()
43
- });
44
- if (result.error) {
45
- Logger.log('Error running npm install:', result.error);
46
- process.exit(1);
47
- }
48
39
  if (arePluginsInstalledSuccessfully) {
49
40
  Logger.log(Logger.SUCCESS_TYPE, 'Plugins installation successful');
50
41
  let isPackageJsonRestored = restorePackageJsonContent(packageJsonBeforePluginsInstallation);
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const { getLintConfigurationUtil } = require("./build/utils/EslintConfigFileUtils/getLintConfiguration");
1
+ const { getLintConfigurationUtil } = require("./build/utils/ConfigFileUtils/getLintConfiguration");
2
2
  const { rulesConfig, plugins, extendPlugins } = getLintConfigurationUtil();
3
3
 
4
4
  module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/codestandard-validator",
3
- "version": "0.0.7-exp-9",
3
+ "version": "0.0.7-exp-10",
4
4
  "description": "library to enforce code standard using eslint",
5
5
  "main": "index.js",
6
6
  "scripts": {