toml-eslint-parser
Advanced tools
Comparing version 0.0.2 to 0.1.0
@@ -6,3 +6,3 @@ import type { HasLocs } from "./loc"; | ||
} | ||
export declare type TOMLNode = TOMLProgram | TOMLTopLevelTable | TOMLTable | TOMLKeyValue | TOMLKey | TOMLBare | TOMLContentNode; | ||
export declare type TOMLNode = TOMLProgram | TOMLTopLevelTable | TOMLTable | TOMLKeyValue | TOMLKey | TOMLBare | TOMLQuoted | TOMLContentNode; | ||
export declare type TOMLContentNode = TOMLValue | TOMLArray | TOMLInlineTable; | ||
@@ -37,3 +37,3 @@ export interface TOMLProgram extends BaseTOMLNode { | ||
type: "TOMLKey"; | ||
keys: (TOMLBare | TOMLStringKey)[]; | ||
keys: (TOMLBare | TOMLQuoted)[]; | ||
parent: TOMLKeyValue | TOMLTable; | ||
@@ -56,2 +56,10 @@ } | ||
} | ||
export interface TOMLQuoted extends BaseTOMLNode { | ||
type: "TOMLQuoted"; | ||
value: string; | ||
style: "basic" | "literal"; | ||
parent: TOMLKey; | ||
kind: "string"; | ||
multiline: false; | ||
} | ||
export declare type TOMLValue = TOMLStringValue | TOMLNumberValue | TOMLBooleanValue | TOMLDateTimeValue; | ||
@@ -64,8 +72,4 @@ export interface TOMLStringValue extends BaseTOMLNode { | ||
multiline: boolean; | ||
parent: TOMLKey | TOMLKeyValue | TOMLArray; | ||
parent: TOMLKeyValue | TOMLArray; | ||
} | ||
export interface TOMLStringKey extends TOMLStringValue { | ||
multiline: false; | ||
parent: TOMLKey; | ||
} | ||
export interface TOMLNumberValue extends BaseTOMLNode { | ||
@@ -72,0 +76,0 @@ type: "TOMLValue"; |
@@ -1,5 +0,5 @@ | ||
import type { TOMLBare, TOMLContentNode, TOMLStringKey, TOMLTopLevelTable } from "../ast"; | ||
import type { TOMLBare, TOMLContentNode, TOMLQuoted, TOMLTopLevelTable } from "../ast"; | ||
import type { ParserOptions } from "../parser-options"; | ||
declare type DuplicateKey = { | ||
node: TOMLBare | TOMLStringKey | TOMLContentNode; | ||
node: TOMLBare | TOMLQuoted | TOMLContentNode; | ||
path: (string | number)[]; | ||
@@ -6,0 +6,0 @@ }; |
@@ -1,2 +0,2 @@ | ||
import type { TOMLBare, TOMLStringKey } from "../ast"; | ||
import type { TOMLBare, TOMLQuoted } from "../ast"; | ||
/** | ||
@@ -9,2 +9,2 @@ * Get the last element from given array | ||
*/ | ||
export declare function toKeyName(node: TOMLBare | TOMLStringKey): string; | ||
export declare function toKeyName(node: TOMLBare | TOMLQuoted): string; |
@@ -230,3 +230,3 @@ "use strict"; | ||
const node = { | ||
type: "TOMLValue", | ||
type: "TOMLQuoted", | ||
kind: "string", | ||
@@ -233,0 +233,0 @@ value: token.string, |
@@ -1,2 +0,2 @@ | ||
import type { TOMLArray, TOMLBare, TOMLContentNode, TOMLInlineTable, TOMLKey, TOMLKeyValue, TOMLProgram, TOMLStringValue, TOMLTable, TOMLTopLevelTable, TOMLValue } from "./ast"; | ||
import type { TOMLArray, TOMLBare, TOMLContentNode, TOMLInlineTable, TOMLKey, TOMLKeyValue, TOMLProgram, TOMLQuoted, TOMLStringValue, TOMLTable, TOMLTopLevelTable, TOMLValue } from "./ast"; | ||
declare type TOMLContentValue = TOMLValue["value"] | TOMLContentValue[] | TOMLTableValue; | ||
@@ -10,4 +10,4 @@ declare type TOMLTableValue = { | ||
export declare function getStaticTOMLValue(node: TOMLProgram | TOMLTopLevelTable | TOMLTable | TOMLKeyValue | TOMLInlineTable): TOMLTableValue; | ||
export declare function getStaticTOMLValue(node: TOMLStringValue | TOMLBare): string; | ||
export declare function getStaticTOMLValue(node: TOMLStringValue | TOMLBare | TOMLQuoted): string; | ||
export declare function getStaticTOMLValue(node: TOMLKey): string[]; | ||
export {}; |
@@ -56,2 +56,5 @@ "use strict"; | ||
}, | ||
TOMLQuoted(node) { | ||
return node.value; | ||
}, | ||
TOMLValue(node) { | ||
@@ -58,0 +61,0 @@ return node.value; |
@@ -14,4 +14,5 @@ "use strict"; | ||
TOMLBare: [], | ||
TOMLQuoted: [], | ||
TOMLValue: [], | ||
}; | ||
exports.KEYS = eslint_visitor_keys_1.unionWith(tomlKeys); |
{ | ||
"name": "toml-eslint-parser", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "A TOML parser that produces output compatible with ESLint", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
110835
3096