@zohodesk/codestandard-validator 0.0.5 → 0.0.6

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
  };
@@ -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/changeLog.md CHANGED
@@ -23,7 +23,10 @@
23
23
  3. Added configuration to abort commits if there are warnings or issues.
24
24
  4. Environment-specific clone configuration added.
25
25
 
26
- # 0.0.5 - auto plugin installtion and dependencies validation
26
+ # 0.0.5 - Automatic eslint plugins installation
27
+ 1. The required eslint plugins configured for a repository will be automatically installed during the installation of the library
27
28
 
28
- 1. check plugin version in local with remote and auto install rules plugins.
29
- 2. plugin version log file.
29
+ # 0.0.6 - Support extended for .properties file
30
+
31
+ 1. The file types that are supported by this library can now be configured using the configuration file "lint.config.js"
32
+ 2. Support for .properties file is also extended in this version along with existing support for file types .js, .jsx, .ts, .tsx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohodesk/codestandard-validator",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "description": "library to enforce code standard using eslint",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- const {
4
- Worker
5
- } = require('worker_threads');
6
- async function installPluginsByWorker(plugins) {
7
- try {
8
- const results = await Promise.all(plugins.map(pkg => runWorker({
9
- packageName: pkg.packageName,
10
- version: pkg.version
11
- })));
12
- console.log('Package are installed By from workers:', results.join('\n'));
13
- } catch (error) {
14
- console.error('Error:', error);
15
- }
16
- }
17
- function runWorker(data) {
18
- return new Promise((resolve, reject) => {
19
- const worker = new Worker(`${__dirname}/worker.js`, {
20
- workerData: data
21
- });
22
- worker.on('message', result => {
23
- resolve(result);
24
- });
25
- worker.on('error', error => {
26
- reject(error);
27
- });
28
- worker.on('exit', code => {
29
- if (code !== 0) {
30
- reject(new Error(`Worker stopped with exit code ${code}`));
31
- }
32
- });
33
- });
34
- }
35
- module.exports = installPluginsByWorker;
@@ -1,33 +0,0 @@
1
- "use strict";
2
-
3
- const {
4
- workerData,
5
- parentPort
6
- } = require('worker_threads');
7
- const {
8
- spawnSync
9
- } = require('child_process');
10
- const {
11
- getNodeModulesPath
12
- } = require('../../General/getNodeModulesPath');
13
- function performanceInstalllation({
14
- packageName,
15
- version
16
- }) {
17
- const start = performance.now();
18
- try {
19
- require.resolve(packageName);
20
- } catch (err) {
21
- spawnSync('npm', ['install', `${packageName}@${version}`, '--no-save'], {
22
- stdio: 'inherit',
23
- cwd: getNodeModulesPath()
24
- });
25
- }
26
- const end = performance.now();
27
- return `Package ${packageName}@${version} installed successfully and installed in ${end - start} ms`;
28
- }
29
- const result = performanceInstalllation({
30
- packageName: workerData.packageName,
31
- version: workerData.version
32
- });
33
- parentPort.postMessage(result);