Skip to content

Commit

Permalink
fixed sonarcloud error
Browse files Browse the repository at this point in the history
  • Loading branch information
Gmin2 committed Jan 9, 2024
1 parent 2fe5ccf commit a996eef
Show file tree
Hide file tree
Showing 5 changed files with 165 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
parser: "@typescript-eslint/parser"
parser: "@babel/eslint-parser"

env:
node: true
Expand All @@ -14,7 +14,7 @@ extends:
- plugin:sonarjs/recommended

parserOptions:
ecmaVersion: 2017
requireConfigFile: false

rules:
# Ignore Rules
Expand Down
160 changes: 159 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"homepage": "https://github.com/asyncapi/spec-json-schemas#readme",
"devDependencies": {
"@typescript-eslint/parser": "^6.15.0",
"@babel/eslint-parser": "^7.23.3",
"ajv": "^8.12.0",
"ajv-draft-04": "^1.0.0",
"eslint": "^8.56.0",
Expand Down
5 changes: 2 additions & 3 deletions scripts/add-new-version.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ function addNewSchemaVersion(newVersion, newVersionDir, latestVersion) {
const obj = require(objFile);

// Adapt all the MUST supported schema formats
/* eslint-disable no-empty-pattern,no-unsafe-optional-chaining */
let mustSupportedSchemaFormats = [] = obj?.else?.properties?.schemaFormat?.anyOf[1]?.enum;
let mustSupportedSchemaFormats = obj?.else?.properties?.schemaFormat?.anyOf[1]?.enum || [];

//Add new version to the list of available schemaFormat values
if (mustSupportedSchemaFormats) {
Expand All @@ -59,7 +58,7 @@ function addNewSchemaVersion(newVersion, newVersionDir, latestVersion) {
}

//Make sure new versions apply the right schema
const enumsForValidatingSchema = [] = obj?.else?.allOf[1]?.if?.properties?.schemaFormat?.enum;
const enumsForValidatingSchema = obj?.else?.allOf[1]?.if?.properties?.schemaFormat?.enum || [];
if (enumsForValidatingSchema) {
//Add new schema formats
enumsForValidatingSchema.push(...newSchemaFormats);
Expand Down
3 changes: 1 addition & 2 deletions tools/bundler/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const path = require('path');
const fs = require('fs');
const traverse = require('json-schema-traverse');
/* eslint-disable no-unused-vars */
const { url } = require('inspector');
// const { url } = require('inspector');
const definitionsDirectory = path.resolve(__dirname, '../../definitions');
const bindingsDirectory = path.resolve(__dirname, '../../bindings');
const outputDirectory = path.resolve(__dirname, '../../schemas');
Expand Down

0 comments on commit a996eef

Please sign in to comment.