Socket
Socket
Sign inDemoInstall

eslint-plugin-json-schema-validator

Package Overview
Dependencies
Maintainers
0
Versions
316
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-json-schema-validator - npm Package Compare versions

Comparing version 5.1.0 to 5.1.1

2

lib/configs/flat/recommended.d.ts
import type { Linter } from "eslint";
declare const _default: Linter.FlatConfig[];
declare const _default: Linter.FlatConfig<Linter.RulesRecord>[];
export default _default;

@@ -19,4 +19,4 @@ import type { RuleModule } from "./types";

};
"flat/base": import("eslint").Linter.FlatConfig[];
"flat/recommended": import("eslint").Linter.FlatConfig[];
"flat/base": import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
"flat/recommended": import("eslint").Linter.FlatConfig<import("eslint").Linter.RulesRecord>[];
};

@@ -23,0 +23,0 @@ rules: {

@@ -1,2 +0,1 @@

/// <reference types="vue-eslint-parser" />
import type { JSONSchema4 } from "json-schema";

@@ -3,0 +2,0 @@ import type { Rule } from "eslint";

@@ -1,2 +0,1 @@

/// <reference types="vue-eslint-parser" />
import type { ESLintExpression } from "vue-eslint-parser/ast";

@@ -3,0 +2,0 @@ import type { RuleContext, SourceCode } from "../../../types";

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.analyzeJsAST = void 0;
exports.analyzeJsAST = analyzeJsAST;
const utils_1 = require("./utils");

@@ -28,3 +28,2 @@ const utils_2 = require("./utils");

}
exports.analyzeJsAST = analyzeJsAST;
const CALC_UNARY = {

@@ -31,0 +30,0 @@ "+": (v) => Number(v),

@@ -1,2 +0,1 @@

/// <reference types="vue-eslint-parser" />
import type { ESLintProperty, ESLintLiteral, ESLintTemplateLiteral, ESLintMemberExpression, ESLintIdentifier, ESLintNode, ESLintExpression } from "vue-eslint-parser/ast";

@@ -3,0 +2,0 @@ import type { RuleContext } from "../../../types";

@@ -26,3 +26,6 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.findInitNode = exports.getStaticValue = exports.getStringLiteralValue = exports.getStaticPropertyName = void 0;
exports.getStaticPropertyName = getStaticPropertyName;
exports.getStringLiteralValue = getStringLiteralValue;
exports.getStaticValue = getStaticValue;
exports.findInitNode = findInitNode;
const eslintUtils = __importStar(require("@eslint-community/eslint-utils"));

@@ -66,3 +69,2 @@ const compat_1 = require("../../compat");

}
exports.getStaticPropertyName = getStaticPropertyName;
function getStringLiteralValue(node) {

@@ -84,3 +86,2 @@ if (node.type === "Literal") {

}
exports.getStringLiteralValue = getStringLiteralValue;
function findVariable(context, node) {

@@ -92,3 +93,2 @@ return eslintUtils.findVariable(getScope(context, node), node);

}
exports.getStaticValue = getStaticValue;
function findInitNode(context, node) {

@@ -124,3 +124,2 @@ const variable = findVariable(context, node);

}
exports.findInitNode = findInitNode;
function getScope(context, currentNode) {

@@ -127,0 +126,0 @@ const inner = currentNode.type !== "Program";

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getJSONNodeFromPath = void 0;
exports.getJSONNodeFromPath = getJSONNodeFromPath;
const TRAVERSE_TARGET_TYPE = new Set([

@@ -85,5 +85,4 @@ "Program",

}
exports.getJSONNodeFromPath = getJSONNodeFromPath;
function isTraverseTarget(node) {
return TRAVERSE_TARGET_TYPE.has(node.type);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getTOMLNodeFromPath = void 0;
exports.getTOMLNodeFromPath = getTOMLNodeFromPath;
const toml_eslint_parser_1 = require("toml-eslint-parser");

@@ -79,3 +79,2 @@ const TRAVERSE_TARGET_TYPE = new Set([

}
exports.getTOMLNodeFromPath = getTOMLNodeFromPath;
function getTOMLNodeFromPathForKeyValue(node, paths) {

@@ -82,0 +81,0 @@ const keys = (0, toml_eslint_parser_1.getStaticTOMLValue)(node.key);

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getYAMLNodeFromPath = void 0;
exports.getYAMLNodeFromPath = getYAMLNodeFromPath;
const yaml_eslint_parser_1 = require("yaml-eslint-parser");

@@ -129,5 +129,4 @@ const TRAVERSE_TARGET_TYPE = new Set([

}
exports.getYAMLNodeFromPath = getYAMLNodeFromPath;
function isTraverseTarget(node) {
return TRAVERSE_TARGET_TYPE.has(node.type);
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCwd = exports.getFilename = exports.getSourceCode = void 0;
exports.getSourceCode = getSourceCode;
exports.getFilename = getFilename;
exports.getCwd = getCwd;
const eslint_compat_utils_1 = require("eslint-compat-utils");

@@ -8,10 +10,7 @@ function getSourceCode(context) {

}
exports.getSourceCode = getSourceCode;
function getFilename(context) {
return (0, eslint_compat_utils_1.getFilename)(context);
}
exports.getFilename = getFilename;
function getCwd(context) {
return (0, eslint_compat_utils_1.getCwd)(context);
}
exports.getCwd = getCwd;

@@ -1,3 +0,2 @@

/// <reference types="node" />
import type { RequestOptions } from "https";
export default function get(url: string, options?: RequestOptions): Promise<string>;

@@ -6,10 +6,10 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.default = get;
const https_1 = __importDefault(require("https"));
const http_1 = __importDefault(require("http"));
const tunnel_agent_1 = __importDefault(require("tunnel-agent"));
const TIMEOUT = 10000;
const TIMEOUT = 60000;
function get(url, options) {
return get0(url, options, 0);
}
exports.default = get;
function get0(url, options, redirectCount) {

@@ -16,0 +16,0 @@ const client = url.startsWith("https") ? https_1.default : http_1.default;

@@ -1,3 +0,2 @@

/// <reference types="node" />
import type { RequestOptions } from "https";
export declare function get(url: string, options?: RequestOptions, httpModulePath?: string): Promise<string>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.get = void 0;
exports.get = get;
function get(url, options, httpModulePath) {

@@ -12,2 +12,1 @@ const client = httpModulePath

}
exports.get = get;

@@ -1,3 +0,2 @@

/// <reference types="node" />
import type { RequestOptions } from "https";
export declare function syncGet(url: string, options?: RequestOptions, httpModulePath?: string): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.syncGet = void 0;
exports.syncGet = syncGet;
const synckit_1 = require("synckit");

@@ -9,2 +9,1 @@ const getSync = (0, synckit_1.createSyncFn)(require.resolve("./worker"));

}
exports.syncGet = syncGet;

@@ -29,3 +29,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.createRule = void 0;
exports.createRule = createRule;
const jsoncESLintParser = __importStar(require("jsonc-eslint-parser"));

@@ -113,3 +113,2 @@ const yamlESLintParser = __importStar(require("yaml-eslint-parser"));

}
exports.createRule = createRule;
function compositingVisitors(visitor, ...visitors) {

@@ -116,0 +115,0 @@ for (const v of visitors) {

@@ -6,3 +6,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.loadJson = exports.loadSchema = void 0;
exports.loadSchema = loadSchema;
exports.loadJson = loadJson;
const path_1 = __importDefault(require("path"));

@@ -23,7 +24,5 @@ const fs_1 = __importDefault(require("fs"));

}
exports.loadSchema = loadSchema;
function loadJson(jsonPath, context) {
return loadJsonInternal(jsonPath, context);
}
exports.loadJson = loadJson;
function loadJsonInternal(jsonPath, context, edit) {

@@ -30,0 +29,0 @@ if (jsonPath.startsWith("http://") || jsonPath.startsWith("https://")) {

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.compile = void 0;
exports.compile = compile;
const ajv_1 = __importDefault(require("./ajv"));

@@ -45,3 +45,2 @@ const json_schema_migrate_1 = require("json-schema-migrate");

}
exports.compile = compile;
function schemaToValidator(schema, schemaPath, context) {

@@ -48,0 +47,0 @@ let validateSchema;

{
"name": "eslint-plugin-json-schema-validator",
"version": "5.1.0",
"version": "5.1.1",
"description": "ESLint plugin that validates data using JSON Schema Validator.",

@@ -70,3 +70,3 @@ "repository": "git+https://github.com/ota-meshi/eslint-plugin-json-schema-validator.git",

"@ota-meshi/eslint-plugin": "^0.15.0",
"@ota-meshi/site-kit-eslint-editor-vue": "^0.1.2",
"@ota-meshi/site-kit-eslint-editor-vue": "^0.2.0",
"@stylistic/stylelint-config": "^1.0.1",

@@ -89,18 +89,17 @@ "@types/debug": "^4.1.5",

"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-eslint-plugin": "^5.0.0",
"eslint-plugin-eslint-plugin": "^6.0.0",
"eslint-plugin-json-schema-validator": "^5.0.0",
"eslint-plugin-jsonc": "^2.0.0",
"eslint-plugin-markdown": "^3.0.0",
"eslint-plugin-markdown": "^5.0.0",
"eslint-plugin-n": "^16.0.0",
"eslint-plugin-node-dependencies": "^0.11.0",
"eslint-plugin-node-dependencies": "^0.12.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-regexp": "^2.0.0",
"eslint-plugin-toml": "^0.10.0",
"eslint-plugin-toml": "^0.11.0",
"eslint-plugin-vue": "^9.0.0",
"eslint-plugin-yml": "^1.0.0",
"espree": "^10.0.0",
"events": "^3.3.0",
"mocha": "^10.0.0",
"monaco-editor": "^0.47.0",
"nyc": "^15.1.0",
"monaco-editor": "^0.49.0",
"nyc": "^17.0.0",
"pako": "^2.1.0",

@@ -117,3 +116,3 @@ "prettier": "^3.0.0",

"typescript": "^5.0.0",
"vite-plugin-eslint4b": "^0.2.5",
"vite-plugin-eslint4b": "^0.4.0",
"vitepress": "^1.0.1",

@@ -125,3 +124,4 @@ "vue-eslint-parser": "^9.0.0",

"access": "public"
}
},
"packageManager": "yarn@1.22.22"
}

@@ -53,7 +53,7 @@ # Introduction

```js
import eslintPluginJsonSchemaValidator from 'eslint-plugin-json-schema-validator';
import eslintPluginJsonSchemaValidator from "eslint-plugin-json-schema-validator";
export default [
// add more generic rule sets here, such as:
// js.configs.recommended,
...eslintPluginJsonSchemaValidator.configs['flat/recommended'],
...eslintPluginJsonSchemaValidator.configs["flat/recommended"],
{

@@ -63,4 +63,4 @@ rules: {

// 'json-schema-validator/no-invalid': 'warn'
}
}
},
},
];

@@ -85,3 +85,3 @@ ```

// 'eslint:recommended',
'plugin:json-schema-validator/recommended'
"plugin:json-schema-validator/recommended",
],

@@ -91,4 +91,4 @@ rules: {

// 'json-schema-validator/no-invalid': 'error'
}
}
},
};
```

@@ -124,11 +124,11 @@

{
"eslint.validate": [
"javascript",
"javascriptreact",
"json",
"jsonc",
"json5",
"yaml",
"toml"
]
"eslint.validate": [
"javascript",
"javascriptreact",
"json",
"jsonc",
"json5",
"yaml",
"toml"
]
}

@@ -145,2 +145,3 @@ ```

<!-- The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) automatically fixes problems reported by rules which have a wrench :wrench: below. -->
The rules with the following star :star: are included in the configs.

@@ -178,6 +179,6 @@

requestOptions: {},
}
}
}
}
},
},
},
};
```

@@ -196,3 +197,3 @@

```js
const request = require("request")
const request = require("request");

@@ -203,12 +204,12 @@ /**

module.exports = function get(url, options) {
return new Promise((resolve, reject) => {
request.get(url, options, (error, _res, body) => {
if (error) {
reject(error)
return
}
resolve(body)
})
})
}
return new Promise((resolve, reject) => {
request.get(url, options, (error, _res, body) => {
if (error) {
reject(error);
return;
}
resolve(body);
});
});
};
```

@@ -228,8 +229,8 @@

// Example of proxy settings.
proxy: "http://my.proxy.com:8080/"
proxy: "http://my.proxy.com:8080/",
},
}
}
}
}
},
},
},
};
```

@@ -247,4 +248,4 @@

- `npm test` runs tests and measures coverage.
- `npm run update` runs in order to update readme and recommended configuration.
- `yarn test` runs tests and measures coverage.
- `yarn update` runs in order to update readme and recommended configuration.

@@ -251,0 +252,0 @@ ### Working With Rules

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc