eslint-plugin-json-schema-validator
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -162,5 +162,3 @@ "use strict"; | ||
const cwd = getCwd(context); | ||
const v = parseOption(context.options[0] || {}, context, filename.startsWith(cwd) | ||
? path_1.default.relative(cwd, filename) | ||
: filename); | ||
const v = parseOption(context.options[0] || {}, context, filename.startsWith(cwd) ? path_1.default.relative(cwd, filename) : filename); | ||
if (!v) { | ||
@@ -262,4 +260,3 @@ return {}; | ||
AssignmentExpression(node) { | ||
if ((node.left.type === "Identifier" && | ||
node.left.name === "exports") || | ||
if ((node.left.type === "Identifier" && node.left.name === "exports") || | ||
(node.left.type === "MemberExpression" && | ||
@@ -305,4 +302,3 @@ node.left.object.type === "Identifier" && | ||
for (const body of rootExpr.body) { | ||
if (body.type !== "TOMLKeyValue" || | ||
body.key.keys.length !== 1) { | ||
if (body.type !== "TOMLKeyValue" || body.key.keys.length !== 1) { | ||
continue; | ||
@@ -309,0 +305,0 @@ } |
@@ -56,3 +56,3 @@ import type { JSONSchema4 } from "json-schema"; | ||
} | ||
export declare type JsonSchemaValidatorSettings = { | ||
export type JsonSchemaValidatorSettings = { | ||
http?: { | ||
@@ -86,6 +86,6 @@ requestOptions?: any; | ||
} | ||
export declare type Node = ESLintNode | JSON.JSONNode | YAML.YAMLNode | TOML.TOMLNode; | ||
export declare type Token = ES.Token | YAML.Token | TOML.Token | Comment; | ||
export declare type Comment = ESTreeComment | YAML.Comment | TOML.Comment; | ||
export declare type NodeOrToken = Node | Token; | ||
export type Node = ESLintNode | JSON.JSONNode | YAML.YAMLNode | TOML.TOMLNode; | ||
export type Token = ES.Token | YAML.Token | TOML.Token | Comment; | ||
export type Comment = ESTreeComment | YAML.Comment | TOML.Comment; | ||
export type NodeOrToken = Node | Token; | ||
export interface SourceCode { | ||
@@ -140,4 +140,4 @@ text: string; | ||
} | ||
declare type FilterPredicate = (tokenOrComment: Token) => boolean; | ||
declare type CursorWithSkipOptions = number | FilterPredicate | { | ||
type FilterPredicate = (tokenOrComment: Token) => boolean; | ||
type CursorWithSkipOptions = number | FilterPredicate | { | ||
includeComments?: boolean; | ||
@@ -147,3 +147,3 @@ filter?: FilterPredicate; | ||
}; | ||
declare type CursorWithCountOptions = number | FilterPredicate | { | ||
type CursorWithCountOptions = number | FilterPredicate | { | ||
includeComments?: boolean; | ||
@@ -159,3 +159,3 @@ filter?: FilterPredicate; | ||
} | ||
declare type SuggestionDescriptorMessage = { | ||
type SuggestionDescriptorMessage = { | ||
desc: string; | ||
@@ -165,8 +165,8 @@ } | { | ||
}; | ||
declare type SuggestionReportDescriptor = SuggestionDescriptorMessage & ReportDescriptorOptionsBase; | ||
type SuggestionReportDescriptor = SuggestionDescriptorMessage & ReportDescriptorOptionsBase; | ||
interface ReportDescriptorOptions extends ReportDescriptorOptionsBase { | ||
suggest?: SuggestionReportDescriptor[] | null; | ||
} | ||
declare type ReportDescriptor = ReportDescriptorMessage & ReportDescriptorLocation & ReportDescriptorOptions; | ||
declare type ReportDescriptorMessage = { | ||
type ReportDescriptor = ReportDescriptorMessage & ReportDescriptorLocation & ReportDescriptorOptions; | ||
type ReportDescriptorMessage = { | ||
message: string; | ||
@@ -176,3 +176,3 @@ } | { | ||
}; | ||
declare type ReportDescriptorLocation = { | ||
type ReportDescriptorLocation = { | ||
node: NodeOrToken; | ||
@@ -179,0 +179,0 @@ } | { |
import type { SourceCode } from "../../types"; | ||
export declare type GetLoc = (sourceCode: SourceCode) => [number, number]; | ||
export declare type NodeData<N> = { | ||
export type GetLoc = (sourceCode: SourceCode) => [number, number]; | ||
export type NodeData<N> = { | ||
key: GetLoc; | ||
@@ -10,2 +10,2 @@ value: N | null; | ||
}; | ||
export declare type GetNodeFromPath<N> = (node: never, paths: string[]) => NodeData<N>; | ||
export type GetNodeFromPath<N> = (node: never, paths: string[]) => NodeData<N>; |
import type { ESLintExpression } from "vue-eslint-parser/ast"; | ||
import type { RuleContext, SourceCode } from "../../../types"; | ||
declare const UNKNOWN: unique symbol; | ||
declare type TUnknown = typeof UNKNOWN; | ||
export declare type PathData = { | ||
type TUnknown = typeof UNKNOWN; | ||
export type PathData = { | ||
key: [number, number] | null | ((sourceCode: SourceCode) => [number, number] | null); | ||
@@ -10,3 +10,3 @@ data: unknown; | ||
}; | ||
export declare type AnalyzedJsAST = { | ||
export type AnalyzedJsAST = { | ||
object: unknown; | ||
@@ -13,0 +13,0 @@ pathData: PathData; |
@@ -117,5 +117,3 @@ "use strict"; | ||
.find((n) => n != null); | ||
let tokenIndex = before | ||
? node.elements.indexOf(before) | ||
: -1; | ||
let tokenIndex = before ? node.elements.indexOf(before) : -1; | ||
let token = before | ||
@@ -367,4 +365,3 @@ ? sourceCode.getTokenAfter(before) | ||
data += expressions[i]; | ||
data += | ||
(_b = node.quasis[i + 1].value.cooked) !== null && _b !== void 0 ? _b : node.quasis[i + 1].value.raw; | ||
data += (_b = node.quasis[i + 1].value.cooked) !== null && _b !== void 0 ? _b : node.quasis[i + 1].value.raw; | ||
} | ||
@@ -371,0 +368,0 @@ return { data, children: EMPTY_MAP }; |
@@ -57,6 +57,3 @@ "use strict"; | ||
} | ||
return [ | ||
sourceCode.getTokenBefore(token).range[1], | ||
token.range[0], | ||
]; | ||
return [sourceCode.getTokenBefore(token).range[1], token.range[0]]; | ||
}, | ||
@@ -63,0 +60,0 @@ value: null, |
@@ -47,4 +47,3 @@ "use strict"; | ||
return { | ||
key: (sourceCode) => (sourceCode.getFirstToken(topLevelTable) || topLevelTable) | ||
.range, | ||
key: (sourceCode) => (sourceCode.getFirstToken(topLevelTable) || topLevelTable).range, | ||
value: topLevelTable, | ||
@@ -51,0 +50,0 @@ }; |
@@ -79,4 +79,3 @@ "use strict"; | ||
else { | ||
hyphenTokenElementIndex = | ||
node.entries.indexOf(before) + 1; | ||
hyphenTokenElementIndex = node.entries.indexOf(before) + 1; | ||
hyphenToken = sourceCode.getTokenAfter(before); | ||
@@ -116,4 +115,3 @@ } | ||
} | ||
if (dataNode.type === "YAMLMapping" || | ||
dataNode.type === "YAMLSequence") { | ||
if (dataNode.type === "YAMLMapping" || dataNode.type === "YAMLSequence") { | ||
return sourceCode.getFirstToken(dataNode).range; | ||
@@ -120,0 +118,0 @@ } |
@@ -1,1 +0,1 @@ | ||
export declare type GetModule = (url: string, options?: any) => Promise<string>; | ||
export type GetModule = (url: string, options?: any) => Promise<string>; |
@@ -29,4 +29,10 @@ "use strict"; | ||
redirectCount < 3) { | ||
const redirectUrl = res.headers.location; | ||
resolve(get0(redirectUrl, options, redirectCount + 1)); | ||
const location = res.headers.location; | ||
try { | ||
const redirectUrl = new url_1.URL(location, url).toString(); | ||
resolve(get0(redirectUrl, options, redirectCount + 1)); | ||
} | ||
catch (e) { | ||
reject(e); | ||
} | ||
return; | ||
@@ -33,0 +39,0 @@ } |
@@ -56,4 +56,3 @@ "use strict"; | ||
customBlock: true, | ||
filename: getBlockFileName(blockContext.parserServices | ||
.customBlock, "json"), | ||
filename: getBlockFileName(blockContext.parserServices.customBlock, "json"), | ||
}); | ||
@@ -67,4 +66,3 @@ }, | ||
customBlock: true, | ||
filename: getBlockFileName(blockContext.parserServices | ||
.customBlock, "yaml"), | ||
filename: getBlockFileName(blockContext.parserServices.customBlock, "yaml"), | ||
}); | ||
@@ -78,4 +76,3 @@ }, | ||
customBlock: true, | ||
filename: getBlockFileName(blockContext.parserServices | ||
.customBlock, "toml"), | ||
filename: getBlockFileName(blockContext.parserServices.customBlock, "toml"), | ||
}); | ||
@@ -82,0 +79,0 @@ }, |
@@ -47,3 +47,2 @@ "use strict"; | ||
try { | ||
; | ||
({ data, timestamp } = | ||
@@ -50,0 +49,0 @@ require(`../../.cached_schemastore/${jsonFileName}`)); |
@@ -1,2 +0,2 @@ | ||
export declare type SchemaObject = { | ||
export type SchemaObject = { | ||
$id?: string; | ||
@@ -3,0 +3,0 @@ $schema?: string; |
import type { SchemaObject } from "./ajv"; | ||
import type { RuleContext } from "../types"; | ||
export declare type Validator = (data: unknown) => ValidateError[]; | ||
export declare type ValidateError = { | ||
export type Validator = (data: unknown) => ValidateError[]; | ||
export type ValidateError = { | ||
message: string; | ||
@@ -6,0 +6,0 @@ path: string[]; |
{ | ||
"name": "eslint-plugin-json-schema-validator", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "ESLint plugin that validates data using JSON Schema Validator.", | ||
@@ -62,3 +62,3 @@ "repository": "git+https://github.com/ota-meshi/eslint-plugin-json-schema-validator.git", | ||
"@actions/core": "^1.2.6", | ||
"@ota-meshi/eslint-plugin": "^0.11.1", | ||
"@ota-meshi/eslint-plugin": "^0.13.0", | ||
"@types/debug": "^4.1.5", | ||
@@ -69,3 +69,3 @@ "@types/eslint": "^8.0.0", | ||
"@types/estree": "^1.0.0", | ||
"@types/mocha": "^9.0.0", | ||
"@types/mocha": "^10.0.0", | ||
"@types/node": "^18.0.0", | ||
@@ -86,3 +86,3 @@ "@types/request": "^2.48.5", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-node-dependencies": "^0.9.0", | ||
"eslint-plugin-node-dependencies": "^0.10.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
@@ -104,3 +104,3 @@ "eslint-plugin-regexp": "^1.0.0", | ||
"stylelint-config-recommended-vue": "^1.0.0", | ||
"stylelint-config-standard": "^28.0.0", | ||
"stylelint-config-standard": "^29.0.0", | ||
"stylelint-stylus": "^0.17.0", | ||
@@ -107,0 +107,0 @@ "typescript": "^4.0.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
98957
2300