From 423dbb7ffcff80f5c308018f518f8a74bc6d483e Mon Sep 17 00:00:00 2001 From: Shinigami Date: Mon, 2 Jan 2023 13:24:28 +0100 Subject: [PATCH] feat: add eslint-plugin-jsonc (#160) Co-authored-by: Julien --- package.json | 1 + pnpm-lock.yaml | 14 +++ .../generate-rule-files/src/plugins-map.ts | 8 ++ src/config/extends/eslint-plugin-jsonc.d.ts | 13 +++ src/config/extends/index.d.ts | 2 + src/parser-options.d.ts | 5 +- src/rules/index.d.ts | 2 + src/rules/jsonc/array-bracket-newline.d.ts | 38 ++++++++ src/rules/jsonc/array-bracket-spacing.d.ts | 45 +++++++++ src/rules/jsonc/array-element-newline.d.ts | 47 ++++++++++ src/rules/jsonc/auto.d.ts | 22 +++++ src/rules/jsonc/comma-dangle.d.ts | 50 ++++++++++ src/rules/jsonc/comma-style.d.ts | 41 +++++++++ src/rules/jsonc/indent.d.ts | 69 ++++++++++++++ src/rules/jsonc/index.d.ts | 92 +++++++++++++++++++ src/rules/jsonc/key-name-casing.d.ts | 39 ++++++++ src/rules/jsonc/key-spacing.d.ts | 83 +++++++++++++++++ src/rules/jsonc/no-bigint-literals.d.ts | 22 +++++ src/rules/jsonc/no-binary-expression.d.ts | 22 +++++ .../jsonc/no-binary-numeric-literals.d.ts | 22 +++++ src/rules/jsonc/no-comments.d.ts | 22 +++++ src/rules/jsonc/no-dupe-keys.d.ts | 22 +++++ .../no-escape-sequence-in-identifier.d.ts | 22 +++++ src/rules/jsonc/no-floating-decimal.d.ts | 22 +++++ .../no-hexadecimal-numeric-literals.d.ts | 22 +++++ src/rules/jsonc/no-infinity.d.ts | 22 +++++ src/rules/jsonc/no-irregular-whitespace.d.ts | 38 ++++++++ src/rules/jsonc/no-multi-str.d.ts | 22 +++++ src/rules/jsonc/no-nan.d.ts | 22 +++++ src/rules/jsonc/no-number-props.d.ts | 22 +++++ src/rules/jsonc/no-numeric-separators.d.ts | 22 +++++ src/rules/jsonc/no-octal-escape.d.ts | 22 +++++ .../jsonc/no-octal-numeric-literals.d.ts | 22 +++++ src/rules/jsonc/no-octal.d.ts | 22 +++++ src/rules/jsonc/no-parenthesized.d.ts | 22 +++++ src/rules/jsonc/no-plus-sign.d.ts | 22 +++++ src/rules/jsonc/no-regexp-literals.d.ts | 22 +++++ src/rules/jsonc/no-sparse-arrays.d.ts | 22 +++++ src/rules/jsonc/no-template-literals.d.ts | 22 +++++ src/rules/jsonc/no-undefined-value.d.ts | 22 +++++ .../jsonc/no-unicode-codepoint-escapes.d.ts | 22 +++++ src/rules/jsonc/no-useless-escape.d.ts | 22 +++++ src/rules/jsonc/object-curly-newline.d.ts | 71 ++++++++++++++ src/rules/jsonc/object-curly-spacing.d.ts | 44 +++++++++ src/rules/jsonc/object-property-newline.d.ts | 36 ++++++++ src/rules/jsonc/quote-props.d.ts | 44 +++++++++ src/rules/jsonc/quotes.d.ts | 42 +++++++++ src/rules/jsonc/sort-array-values.d.ts | 78 ++++++++++++++++ src/rules/jsonc/sort-keys.d.ts | 88 ++++++++++++++++++ src/rules/jsonc/space-unary-ops.d.ts | 38 ++++++++ src/rules/jsonc/valid-json-number.d.ts | 22 +++++ .../vue-custom-block/no-parsing-error.d.ts | 22 +++++ 52 files changed, 1621 insertions(+), 1 deletion(-) create mode 100644 src/config/extends/eslint-plugin-jsonc.d.ts create mode 100644 src/rules/jsonc/array-bracket-newline.d.ts create mode 100644 src/rules/jsonc/array-bracket-spacing.d.ts create mode 100644 src/rules/jsonc/array-element-newline.d.ts create mode 100644 src/rules/jsonc/auto.d.ts create mode 100644 src/rules/jsonc/comma-dangle.d.ts create mode 100644 src/rules/jsonc/comma-style.d.ts create mode 100644 src/rules/jsonc/indent.d.ts create mode 100644 src/rules/jsonc/index.d.ts create mode 100644 src/rules/jsonc/key-name-casing.d.ts create mode 100644 src/rules/jsonc/key-spacing.d.ts create mode 100644 src/rules/jsonc/no-bigint-literals.d.ts create mode 100644 src/rules/jsonc/no-binary-expression.d.ts create mode 100644 src/rules/jsonc/no-binary-numeric-literals.d.ts create mode 100644 src/rules/jsonc/no-comments.d.ts create mode 100644 src/rules/jsonc/no-dupe-keys.d.ts create mode 100644 src/rules/jsonc/no-escape-sequence-in-identifier.d.ts create mode 100644 src/rules/jsonc/no-floating-decimal.d.ts create mode 100644 src/rules/jsonc/no-hexadecimal-numeric-literals.d.ts create mode 100644 src/rules/jsonc/no-infinity.d.ts create mode 100644 src/rules/jsonc/no-irregular-whitespace.d.ts create mode 100644 src/rules/jsonc/no-multi-str.d.ts create mode 100644 src/rules/jsonc/no-nan.d.ts create mode 100644 src/rules/jsonc/no-number-props.d.ts create mode 100644 src/rules/jsonc/no-numeric-separators.d.ts create mode 100644 src/rules/jsonc/no-octal-escape.d.ts create mode 100644 src/rules/jsonc/no-octal-numeric-literals.d.ts create mode 100644 src/rules/jsonc/no-octal.d.ts create mode 100644 src/rules/jsonc/no-parenthesized.d.ts create mode 100644 src/rules/jsonc/no-plus-sign.d.ts create mode 100644 src/rules/jsonc/no-regexp-literals.d.ts create mode 100644 src/rules/jsonc/no-sparse-arrays.d.ts create mode 100644 src/rules/jsonc/no-template-literals.d.ts create mode 100644 src/rules/jsonc/no-undefined-value.d.ts create mode 100644 src/rules/jsonc/no-unicode-codepoint-escapes.d.ts create mode 100644 src/rules/jsonc/no-useless-escape.d.ts create mode 100644 src/rules/jsonc/object-curly-newline.d.ts create mode 100644 src/rules/jsonc/object-curly-spacing.d.ts create mode 100644 src/rules/jsonc/object-property-newline.d.ts create mode 100644 src/rules/jsonc/quote-props.d.ts create mode 100644 src/rules/jsonc/quotes.d.ts create mode 100644 src/rules/jsonc/sort-array-values.d.ts create mode 100644 src/rules/jsonc/sort-keys.d.ts create mode 100644 src/rules/jsonc/space-unary-ops.d.ts create mode 100644 src/rules/jsonc/valid-json-number.d.ts create mode 100644 src/rules/jsonc/vue-custom-block/no-parsing-error.d.ts diff --git a/package.json b/package.json index 57757f84..80c37d8d 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "eslint-plugin-import": "~2.26.0", "eslint-plugin-inclusive-language": "~2.2.0", "eslint-plugin-jsdoc": "~39.6.4", + "eslint-plugin-jsonc": "~2.5.0", "eslint-plugin-mdx": "~2.0.5", "eslint-plugin-n": "~15.6.0", "eslint-plugin-node": "~11.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7ab93095..5dd05b3d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,7 @@ specifiers: eslint-plugin-import: ~2.26.0 eslint-plugin-inclusive-language: ~2.2.0 eslint-plugin-jsdoc: ~39.6.4 + eslint-plugin-jsonc: ~2.5.0 eslint-plugin-mdx: ~2.0.5 eslint-plugin-n: ~15.6.0 eslint-plugin-node: ~11.1.0 @@ -54,6 +55,7 @@ devDependencies: eslint-plugin-import: 2.26.0_ejk3zt536nc2nr7uicalblhboi eslint-plugin-inclusive-language: 2.2.0 eslint-plugin-jsdoc: 39.6.4_eslint@8.31.0 + eslint-plugin-jsonc: 2.5.0_eslint@8.31.0 eslint-plugin-mdx: 2.0.5_eslint@8.31.0 eslint-plugin-n: 15.6.0_eslint@8.31.0 eslint-plugin-node: 11.1.0_eslint@8.31.0 @@ -1802,6 +1804,18 @@ packages: - supports-color dev: true + /eslint-plugin-jsonc/2.5.0_eslint@8.31.0: + resolution: {integrity: sha512-G257khwkrOQ5MJpSzz4yQh5K12W4xFZRcHmVlhVFWh2GCLDX+JwHnmkQoUoFDbOieSPBMsPFZDTJScwrXiWlIg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: '>=6.0.0' + dependencies: + eslint: 8.31.0 + eslint-utils: 3.0.0_eslint@8.31.0 + jsonc-eslint-parser: 2.1.0 + natural-compare: 1.4.0 + dev: true + /eslint-plugin-markdown/3.0.0_eslint@8.31.0: resolution: {integrity: sha512-hRs5RUJGbeHDLfS7ELanT0e29Ocyssf/7kBM+p7KluY5AwngGkDf8Oyu4658/NZSGTTq05FZeWbkxXtbVyHPwg==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} diff --git a/scripts/generate-rule-files/src/plugins-map.ts b/scripts/generate-rule-files/src/plugins-map.ts index 8182f124..ff788854 100644 --- a/scripts/generate-rule-files/src/plugins-map.ts +++ b/scripts/generate-rule-files/src/plugins-map.ts @@ -4,6 +4,7 @@ import * as eslintPluginDeprecation from 'eslint-plugin-deprecation'; import * as eslintPluginImport from 'eslint-plugin-import'; // @ts-expect-error import eslintPluginJSDoc from 'eslint-plugin-jsdoc'; +import eslintPluginJsonc from 'eslint-plugin-jsonc'; import * as eslintPluginMdx from 'eslint-plugin-mdx'; // @ts-expect-error import eslintPluginNode from 'eslint-plugin-node'; @@ -51,6 +52,13 @@ export const PLUGIN_REGISTRY: Readonly> = { prefix: 'jsdoc', rules: (eslintPluginJSDoc as Plugin).rules, }, + jsonc: { + name: 'Jsonc', + prefix: 'jsonc', + rules: + // @ts-expect-error: throw error when plugin successfully updated their type defs + eslintPluginJsonc.rules as Plugin['rules'], + }, mdx: { name: 'Mdx', rules: eslintPluginMdx.rules, diff --git a/src/config/extends/eslint-plugin-jsonc.d.ts b/src/config/extends/eslint-plugin-jsonc.d.ts new file mode 100644 index 00000000..9f34a442 --- /dev/null +++ b/src/config/extends/eslint-plugin-jsonc.d.ts @@ -0,0 +1,13 @@ +/** + * Eslint Jsonc extensions. + * + * @see [Eslint Jsonc extensions](https://github.com/ota-meshi/eslint-plugin-jsonc#configuration) + */ +export type JsoncExtensions = + | 'plugin:jsdoc/base' + | 'plugin:jsdoc/recommended' + | 'plugin:jsonc/recommended-with-json' + | 'plugin:jsonc/recommended-with-jsonc' + | 'plugin:jsonc/recommended-with-json5' + | 'plugin:jsonc/prettier' + | 'plugin:jsonc/all'; diff --git a/src/config/extends/index.d.ts b/src/config/extends/index.d.ts index 0117bbe1..d6ab38c8 100644 --- a/src/config/extends/index.d.ts +++ b/src/config/extends/index.d.ts @@ -2,6 +2,7 @@ import type { LiteralUnion } from '../../utility-types'; import type { EslintExtensions } from './eslint'; import type { ImportExtensions } from './eslint-plugin-import'; import type { JsdocExtensions } from './eslint-plugin-jsdoc'; +import type { JsoncExtensions } from './eslint-plugin-jsonc'; import type { MdxExtensions } from './eslint-plugin-mdx'; import type { NExtensions } from './eslint-plugin-n'; import type { NodeExtensions } from './eslint-plugin-node'; @@ -20,6 +21,7 @@ export type KnownExtensions = LiteralUnion< | ImportExtensions | IntlifyVueI18nExtensions | JsdocExtensions + | JsoncExtensions | MdxExtensions | NExtensions | NodeExtensions diff --git a/src/parser-options.d.ts b/src/parser-options.d.ts index 6400249e..ade3ef51 100644 --- a/src/parser-options.d.ts +++ b/src/parser-options.d.ts @@ -134,7 +134,10 @@ export type DebugLevel = /** Parser. */ export type Parser = LiteralUnion< - 'babel-eslint' | '@typescript-eslint/parser' | 'vue-eslint-parser' + | 'babel-eslint' + | '@typescript-eslint/parser' + | 'jsonc-eslint-parser' + | 'vue-eslint-parser' >; /** diff --git a/src/rules/index.d.ts b/src/rules/index.d.ts index 2471f92c..2edc7e56 100644 --- a/src/rules/index.d.ts +++ b/src/rules/index.d.ts @@ -2,6 +2,7 @@ import type { DeprecationRules } from './deprecation'; import type { EslintRules } from './eslint'; import type { ImportRules } from './import'; import type { JSDocRules } from './jsdoc'; +import type { JsoncRules } from './jsonc'; import type { NRules } from './n'; import type { NodeRules } from './node'; import type { RuleConfig } from './rule-config'; @@ -22,6 +23,7 @@ export type Rules = Partial< EslintRules & ImportRules & JSDocRules & + JsoncRules & NodeRules & NRules & SpellcheckRules & diff --git a/src/rules/jsonc/array-bracket-newline.d.ts b/src/rules/jsonc/array-bracket-newline.d.ts new file mode 100644 index 00000000..dc13bdcd --- /dev/null +++ b/src/rules/jsonc/array-bracket-newline.d.ts @@ -0,0 +1,38 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export type ArrayBracketNewlineOption = + | ('always' | 'never' | 'consistent') + | { + multiline?: boolean; + minItems?: number | null; + }; + +/** + * Options. + */ +export type ArrayBracketNewlineOptions = [ArrayBracketNewlineOption?]; + +/** + * Enforce line breaks after opening and before closing array brackets. + * + * @see [array-bracket-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-bracket-newline.html) + */ +export type ArrayBracketNewlineRuleConfig = + RuleConfig; + +/** + * Enforce line breaks after opening and before closing array brackets. + * + * @see [array-bracket-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-bracket-newline.html) + */ +export interface ArrayBracketNewlineRule { + /** + * Enforce line breaks after opening and before closing array brackets. + * + * @see [array-bracket-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-bracket-newline.html) + */ + 'jsonc/array-bracket-newline': ArrayBracketNewlineRuleConfig; +} diff --git a/src/rules/jsonc/array-bracket-spacing.d.ts b/src/rules/jsonc/array-bracket-spacing.d.ts new file mode 100644 index 00000000..0efecf26 --- /dev/null +++ b/src/rules/jsonc/array-bracket-spacing.d.ts @@ -0,0 +1,45 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Config. + */ +export interface ArrayBracketSpacingConfig { + singleValue?: boolean; + objectsInArrays?: boolean; + arraysInArrays?: boolean; +} + +/** + * Option. + */ +export type ArrayBracketSpacingOption = 'always' | 'never'; + +/** + * Options. + */ +export type ArrayBracketSpacingOptions = [ + ArrayBracketSpacingOption?, + ArrayBracketSpacingConfig?, +]; + +/** + * Disallow or enforce spaces inside of brackets. + * + * @see [array-bracket-spacing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-bracket-spacing.html) + */ +export type ArrayBracketSpacingRuleConfig = + RuleConfig; + +/** + * Disallow or enforce spaces inside of brackets. + * + * @see [array-bracket-spacing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-bracket-spacing.html) + */ +export interface ArrayBracketSpacingRule { + /** + * Disallow or enforce spaces inside of brackets. + * + * @see [array-bracket-spacing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-bracket-spacing.html) + */ + 'jsonc/array-bracket-spacing': ArrayBracketSpacingRuleConfig; +} diff --git a/src/rules/jsonc/array-element-newline.d.ts b/src/rules/jsonc/array-element-newline.d.ts new file mode 100644 index 00000000..adb68630 --- /dev/null +++ b/src/rules/jsonc/array-element-newline.d.ts @@ -0,0 +1,47 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export type ArrayElementNewlineOption = + | [] + | [ + | BasicConfig + | { + ArrayExpression?: BasicConfig; + ArrayPattern?: BasicConfig; + }, + ]; +export type BasicConfig = + | ('always' | 'never' | 'consistent') + | { + multiline?: boolean; + minItems?: number | null; + }; + +/** + * Options. + */ +export type ArrayElementNewlineOptions = ArrayElementNewlineOption; + +/** + * Enforce line breaks between array elements. + * + * @see [array-element-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-element-newline.html) + */ +export type ArrayElementNewlineRuleConfig = + RuleConfig; + +/** + * Enforce line breaks between array elements. + * + * @see [array-element-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-element-newline.html) + */ +export interface ArrayElementNewlineRule { + /** + * Enforce line breaks between array elements. + * + * @see [array-element-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/array-element-newline.html) + */ + 'jsonc/array-element-newline': ArrayElementNewlineRuleConfig; +} diff --git a/src/rules/jsonc/auto.d.ts b/src/rules/jsonc/auto.d.ts new file mode 100644 index 00000000..c94e4e55 --- /dev/null +++ b/src/rules/jsonc/auto.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Apply jsonc rules similar to your configured ESLint core rules. + * + * @see [auto](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/auto.html) + */ +export type AutoRuleConfig = RuleConfig<[]>; + +/** + * Apply jsonc rules similar to your configured ESLint core rules. + * + * @see [auto](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/auto.html) + */ +export interface AutoRule { + /** + * Apply jsonc rules similar to your configured ESLint core rules. + * + * @see [auto](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/auto.html) + */ + 'jsonc/auto': AutoRuleConfig; +} diff --git a/src/rules/jsonc/comma-dangle.d.ts b/src/rules/jsonc/comma-dangle.d.ts new file mode 100644 index 00000000..953ccee9 --- /dev/null +++ b/src/rules/jsonc/comma-dangle.d.ts @@ -0,0 +1,50 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export type CommaDangleOption = + | [] + | [ + | Value + | { + arrays?: ValueWithIgnore; + objects?: ValueWithIgnore; + imports?: ValueWithIgnore; + exports?: ValueWithIgnore; + functions?: ValueWithIgnore; + }, + ]; +export type Value = 'always-multiline' | 'always' | 'never' | 'only-multiline'; +export type ValueWithIgnore = + | 'always-multiline' + | 'always' + | 'ignore' + | 'never' + | 'only-multiline'; + +/** + * Options. + */ +export type CommaDangleOptions = CommaDangleOption; + +/** + * Require or disallow trailing commas. + * + * @see [comma-dangle](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/comma-dangle.html) + */ +export type CommaDangleRuleConfig = RuleConfig; + +/** + * Require or disallow trailing commas. + * + * @see [comma-dangle](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/comma-dangle.html) + */ +export interface CommaDangleRule { + /** + * Require or disallow trailing commas. + * + * @see [comma-dangle](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/comma-dangle.html) + */ + 'jsonc/comma-dangle': CommaDangleRuleConfig; +} diff --git a/src/rules/jsonc/comma-style.d.ts b/src/rules/jsonc/comma-style.d.ts new file mode 100644 index 00000000..211997fd --- /dev/null +++ b/src/rules/jsonc/comma-style.d.ts @@ -0,0 +1,41 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Config. + */ +export interface CommaStyleConfig { + exceptions?: { + [k: string]: boolean; + }; +} + +/** + * Option. + */ +export type CommaStyleOption = 'first' | 'last'; + +/** + * Options. + */ +export type CommaStyleOptions = [CommaStyleOption?, CommaStyleConfig?]; + +/** + * Enforce consistent comma style. + * + * @see [comma-style](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/comma-style.html) + */ +export type CommaStyleRuleConfig = RuleConfig; + +/** + * Enforce consistent comma style. + * + * @see [comma-style](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/comma-style.html) + */ +export interface CommaStyleRule { + /** + * Enforce consistent comma style. + * + * @see [comma-style](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/comma-style.html) + */ + 'jsonc/comma-style': CommaStyleRuleConfig; +} diff --git a/src/rules/jsonc/indent.d.ts b/src/rules/jsonc/indent.d.ts new file mode 100644 index 00000000..1f15049a --- /dev/null +++ b/src/rules/jsonc/indent.d.ts @@ -0,0 +1,69 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Config. + */ +export interface IndentConfig { + SwitchCase?: number; + VariableDeclarator?: + | (number | ('first' | 'off')) + | { + var?: number | ('first' | 'off'); + let?: number | ('first' | 'off'); + const?: number | ('first' | 'off'); + }; + outerIIFEBody?: number | 'off'; + MemberExpression?: number | 'off'; + FunctionDeclaration?: { + parameters?: number | ('first' | 'off'); + body?: number; + }; + FunctionExpression?: { + parameters?: number | ('first' | 'off'); + body?: number; + }; + StaticBlock?: { + body?: number; + }; + CallExpression?: { + arguments?: number | ('first' | 'off'); + }; + ArrayExpression?: number | ('first' | 'off'); + ObjectExpression?: number | ('first' | 'off'); + ImportDeclaration?: number | ('first' | 'off'); + flatTernaryExpressions?: boolean; + offsetTernaryExpressions?: boolean; + ignoredNodes?: string[]; + ignoreComments?: boolean; +} + +/** + * Option. + */ +export type IndentOption = 'tab' | number; + +/** + * Options. + */ +export type IndentOptions = [IndentOption?, IndentConfig?]; + +/** + * Enforce consistent indentation. + * + * @see [indent](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/indent.html) + */ +export type IndentRuleConfig = RuleConfig; + +/** + * Enforce consistent indentation. + * + * @see [indent](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/indent.html) + */ +export interface IndentRule { + /** + * Enforce consistent indentation. + * + * @see [indent](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/indent.html) + */ + 'jsonc/indent': IndentRuleConfig; +} diff --git a/src/rules/jsonc/index.d.ts b/src/rules/jsonc/index.d.ts new file mode 100644 index 00000000..6f86624a --- /dev/null +++ b/src/rules/jsonc/index.d.ts @@ -0,0 +1,92 @@ +import type { ArrayBracketNewlineRule } from './array-bracket-newline'; +import type { ArrayBracketSpacingRule } from './array-bracket-spacing'; +import type { ArrayElementNewlineRule } from './array-element-newline'; +import type { AutoRule } from './auto'; +import type { CommaDangleRule } from './comma-dangle'; +import type { CommaStyleRule } from './comma-style'; +import type { IndentRule } from './indent'; +import type { KeyNameCasingRule } from './key-name-casing'; +import type { KeySpacingRule } from './key-spacing'; +import type { NoBigintLiteralsRule } from './no-bigint-literals'; +import type { NoBinaryExpressionRule } from './no-binary-expression'; +import type { NoBinaryNumericLiteralsRule } from './no-binary-numeric-literals'; +import type { NoCommentsRule } from './no-comments'; +import type { NoDupeKeysRule } from './no-dupe-keys'; +import type { NoEscapeSequenceInIdentifierRule } from './no-escape-sequence-in-identifier'; +import type { NoFloatingDecimalRule } from './no-floating-decimal'; +import type { NoHexadecimalNumericLiteralsRule } from './no-hexadecimal-numeric-literals'; +import type { NoInfinityRule } from './no-infinity'; +import type { NoIrregularWhitespaceRule } from './no-irregular-whitespace'; +import type { NoMultiStrRule } from './no-multi-str'; +import type { NoNanRule } from './no-nan'; +import type { NoNumberPropsRule } from './no-number-props'; +import type { NoNumericSeparatorsRule } from './no-numeric-separators'; +import type { NoOctalRule } from './no-octal'; +import type { NoOctalEscapeRule } from './no-octal-escape'; +import type { NoOctalNumericLiteralsRule } from './no-octal-numeric-literals'; +import type { NoParenthesizedRule } from './no-parenthesized'; +import type { NoPlusSignRule } from './no-plus-sign'; +import type { NoRegexpLiteralsRule } from './no-regexp-literals'; +import type { NoSparseArraysRule } from './no-sparse-arrays'; +import type { NoTemplateLiteralsRule } from './no-template-literals'; +import type { NoUndefinedValueRule } from './no-undefined-value'; +import type { NoUnicodeCodepointEscapesRule } from './no-unicode-codepoint-escapes'; +import type { NoUselessEscapeRule } from './no-useless-escape'; +import type { ObjectCurlyNewlineRule } from './object-curly-newline'; +import type { ObjectCurlySpacingRule } from './object-curly-spacing'; +import type { ObjectPropertyNewlineRule } from './object-property-newline'; +import type { QuotePropsRule } from './quote-props'; +import type { QuotesRule } from './quotes'; +import type { SortArrayValuesRule } from './sort-array-values'; +import type { SortKeysRule } from './sort-keys'; +import type { SpaceUnaryOpsRule } from './space-unary-ops'; +import type { ValidJsonNumberRule } from './valid-json-number'; +import type { VueCustomBlockNoParsingErrorRule } from './vue-custom-block/no-parsing-error'; + +/** + * All Jsonc rules. + */ +export type JsoncRules = ArrayBracketNewlineRule & + ArrayBracketSpacingRule & + ArrayElementNewlineRule & + AutoRule & + CommaDangleRule & + CommaStyleRule & + IndentRule & + KeyNameCasingRule & + KeySpacingRule & + NoBigintLiteralsRule & + NoBinaryExpressionRule & + NoBinaryNumericLiteralsRule & + NoCommentsRule & + NoDupeKeysRule & + NoEscapeSequenceInIdentifierRule & + NoFloatingDecimalRule & + NoHexadecimalNumericLiteralsRule & + NoInfinityRule & + NoIrregularWhitespaceRule & + NoMultiStrRule & + NoNanRule & + NoNumberPropsRule & + NoNumericSeparatorsRule & + NoOctalEscapeRule & + NoOctalNumericLiteralsRule & + NoOctalRule & + NoParenthesizedRule & + NoPlusSignRule & + NoRegexpLiteralsRule & + NoSparseArraysRule & + NoTemplateLiteralsRule & + NoUndefinedValueRule & + NoUnicodeCodepointEscapesRule & + NoUselessEscapeRule & + ObjectCurlyNewlineRule & + ObjectCurlySpacingRule & + ObjectPropertyNewlineRule & + QuotePropsRule & + QuotesRule & + SortArrayValuesRule & + SortKeysRule & + SpaceUnaryOpsRule & + ValidJsonNumberRule & + VueCustomBlockNoParsingErrorRule; diff --git a/src/rules/jsonc/key-name-casing.d.ts b/src/rules/jsonc/key-name-casing.d.ts new file mode 100644 index 00000000..d58cf77c --- /dev/null +++ b/src/rules/jsonc/key-name-casing.d.ts @@ -0,0 +1,39 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export interface KeyNameCasingOption { + camelCase?: boolean; + PascalCase?: boolean; + SCREAMING_SNAKE_CASE?: boolean; + 'kebab-case'?: boolean; + snake_case?: boolean; + ignores?: string[]; +} + +/** + * Options. + */ +export type KeyNameCasingOptions = [KeyNameCasingOption?]; + +/** + * Enforce naming convention to property key names. + * + * @see [key-name-casing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/key-name-casing.html) + */ +export type KeyNameCasingRuleConfig = RuleConfig; + +/** + * Enforce naming convention to property key names. + * + * @see [key-name-casing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/key-name-casing.html) + */ +export interface KeyNameCasingRule { + /** + * Enforce naming convention to property key names. + * + * @see [key-name-casing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/key-name-casing.html) + */ + 'jsonc/key-name-casing': KeyNameCasingRuleConfig; +} diff --git a/src/rules/jsonc/key-spacing.d.ts b/src/rules/jsonc/key-spacing.d.ts new file mode 100644 index 00000000..2735a27b --- /dev/null +++ b/src/rules/jsonc/key-spacing.d.ts @@ -0,0 +1,83 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export type KeySpacingOption = + | { + align?: + | ('colon' | 'value') + | { + mode?: 'strict' | 'minimum'; + on?: 'colon' | 'value'; + beforeColon?: boolean; + afterColon?: boolean; + }; + mode?: 'strict' | 'minimum'; + beforeColon?: boolean; + afterColon?: boolean; + } + | { + singleLine?: { + mode?: 'strict' | 'minimum'; + beforeColon?: boolean; + afterColon?: boolean; + }; + multiLine?: { + align?: + | ('colon' | 'value') + | { + mode?: 'strict' | 'minimum'; + on?: 'colon' | 'value'; + beforeColon?: boolean; + afterColon?: boolean; + }; + mode?: 'strict' | 'minimum'; + beforeColon?: boolean; + afterColon?: boolean; + }; + } + | { + singleLine?: { + mode?: 'strict' | 'minimum'; + beforeColon?: boolean; + afterColon?: boolean; + }; + multiLine?: { + mode?: 'strict' | 'minimum'; + beforeColon?: boolean; + afterColon?: boolean; + }; + align?: { + mode?: 'strict' | 'minimum'; + on?: 'colon' | 'value'; + beforeColon?: boolean; + afterColon?: boolean; + }; + }; + +/** + * Options. + */ +export type KeySpacingOptions = [KeySpacingOption?]; + +/** + * Enforce consistent spacing between keys and values in object literal properties. + * + * @see [key-spacing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/key-spacing.html) + */ +export type KeySpacingRuleConfig = RuleConfig; + +/** + * Enforce consistent spacing between keys and values in object literal properties. + * + * @see [key-spacing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/key-spacing.html) + */ +export interface KeySpacingRule { + /** + * Enforce consistent spacing between keys and values in object literal properties. + * + * @see [key-spacing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/key-spacing.html) + */ + 'jsonc/key-spacing': KeySpacingRuleConfig; +} diff --git a/src/rules/jsonc/no-bigint-literals.d.ts b/src/rules/jsonc/no-bigint-literals.d.ts new file mode 100644 index 00000000..184b27d7 --- /dev/null +++ b/src/rules/jsonc/no-bigint-literals.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow BigInt literals. + * + * @see [no-bigint-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-bigint-literals.html) + */ +export type NoBigintLiteralsRuleConfig = RuleConfig<[]>; + +/** + * Disallow BigInt literals. + * + * @see [no-bigint-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-bigint-literals.html) + */ +export interface NoBigintLiteralsRule { + /** + * Disallow BigInt literals. + * + * @see [no-bigint-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-bigint-literals.html) + */ + 'jsonc/no-bigint-literals': NoBigintLiteralsRuleConfig; +} diff --git a/src/rules/jsonc/no-binary-expression.d.ts b/src/rules/jsonc/no-binary-expression.d.ts new file mode 100644 index 00000000..10378ebf --- /dev/null +++ b/src/rules/jsonc/no-binary-expression.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow binary expression. + * + * @see [no-binary-expression](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-binary-expression.html) + */ +export type NoBinaryExpressionRuleConfig = RuleConfig<[]>; + +/** + * Disallow binary expression. + * + * @see [no-binary-expression](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-binary-expression.html) + */ +export interface NoBinaryExpressionRule { + /** + * Disallow binary expression. + * + * @see [no-binary-expression](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-binary-expression.html) + */ + 'jsonc/no-binary-expression': NoBinaryExpressionRuleConfig; +} diff --git a/src/rules/jsonc/no-binary-numeric-literals.d.ts b/src/rules/jsonc/no-binary-numeric-literals.d.ts new file mode 100644 index 00000000..f52fcec7 --- /dev/null +++ b/src/rules/jsonc/no-binary-numeric-literals.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow binary numeric literals. + * + * @see [no-binary-numeric-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-binary-numeric-literals.html) + */ +export type NoBinaryNumericLiteralsRuleConfig = RuleConfig<[]>; + +/** + * Disallow binary numeric literals. + * + * @see [no-binary-numeric-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-binary-numeric-literals.html) + */ +export interface NoBinaryNumericLiteralsRule { + /** + * Disallow binary numeric literals. + * + * @see [no-binary-numeric-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-binary-numeric-literals.html) + */ + 'jsonc/no-binary-numeric-literals': NoBinaryNumericLiteralsRuleConfig; +} diff --git a/src/rules/jsonc/no-comments.d.ts b/src/rules/jsonc/no-comments.d.ts new file mode 100644 index 00000000..1f11c2d3 --- /dev/null +++ b/src/rules/jsonc/no-comments.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow comments. + * + * @see [no-comments](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-comments.html) + */ +export type NoCommentsRuleConfig = RuleConfig<[]>; + +/** + * Disallow comments. + * + * @see [no-comments](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-comments.html) + */ +export interface NoCommentsRule { + /** + * Disallow comments. + * + * @see [no-comments](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-comments.html) + */ + 'jsonc/no-comments': NoCommentsRuleConfig; +} diff --git a/src/rules/jsonc/no-dupe-keys.d.ts b/src/rules/jsonc/no-dupe-keys.d.ts new file mode 100644 index 00000000..034e44b8 --- /dev/null +++ b/src/rules/jsonc/no-dupe-keys.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow duplicate keys in object literals. + * + * @see [no-dupe-keys](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-dupe-keys.html) + */ +export type NoDupeKeysRuleConfig = RuleConfig<[]>; + +/** + * Disallow duplicate keys in object literals. + * + * @see [no-dupe-keys](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-dupe-keys.html) + */ +export interface NoDupeKeysRule { + /** + * Disallow duplicate keys in object literals. + * + * @see [no-dupe-keys](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-dupe-keys.html) + */ + 'jsonc/no-dupe-keys': NoDupeKeysRuleConfig; +} diff --git a/src/rules/jsonc/no-escape-sequence-in-identifier.d.ts b/src/rules/jsonc/no-escape-sequence-in-identifier.d.ts new file mode 100644 index 00000000..5803982b --- /dev/null +++ b/src/rules/jsonc/no-escape-sequence-in-identifier.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow escape sequences in identifiers. + * + * @see [no-escape-sequence-in-identifier](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-escape-sequence-in-identifier.html) + */ +export type NoEscapeSequenceInIdentifierRuleConfig = RuleConfig<[]>; + +/** + * Disallow escape sequences in identifiers. + * + * @see [no-escape-sequence-in-identifier](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-escape-sequence-in-identifier.html) + */ +export interface NoEscapeSequenceInIdentifierRule { + /** + * Disallow escape sequences in identifiers. + * + * @see [no-escape-sequence-in-identifier](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-escape-sequence-in-identifier.html) + */ + 'jsonc/no-escape-sequence-in-identifier': NoEscapeSequenceInIdentifierRuleConfig; +} diff --git a/src/rules/jsonc/no-floating-decimal.d.ts b/src/rules/jsonc/no-floating-decimal.d.ts new file mode 100644 index 00000000..f0592fd5 --- /dev/null +++ b/src/rules/jsonc/no-floating-decimal.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow leading or trailing decimal points in numeric literals. + * + * @see [no-floating-decimal](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-floating-decimal.html) + */ +export type NoFloatingDecimalRuleConfig = RuleConfig<[]>; + +/** + * Disallow leading or trailing decimal points in numeric literals. + * + * @see [no-floating-decimal](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-floating-decimal.html) + */ +export interface NoFloatingDecimalRule { + /** + * Disallow leading or trailing decimal points in numeric literals. + * + * @see [no-floating-decimal](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-floating-decimal.html) + */ + 'jsonc/no-floating-decimal': NoFloatingDecimalRuleConfig; +} diff --git a/src/rules/jsonc/no-hexadecimal-numeric-literals.d.ts b/src/rules/jsonc/no-hexadecimal-numeric-literals.d.ts new file mode 100644 index 00000000..bb018459 --- /dev/null +++ b/src/rules/jsonc/no-hexadecimal-numeric-literals.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow hexadecimal numeric literals. + * + * @see [no-hexadecimal-numeric-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-hexadecimal-numeric-literals.html) + */ +export type NoHexadecimalNumericLiteralsRuleConfig = RuleConfig<[]>; + +/** + * Disallow hexadecimal numeric literals. + * + * @see [no-hexadecimal-numeric-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-hexadecimal-numeric-literals.html) + */ +export interface NoHexadecimalNumericLiteralsRule { + /** + * Disallow hexadecimal numeric literals. + * + * @see [no-hexadecimal-numeric-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-hexadecimal-numeric-literals.html) + */ + 'jsonc/no-hexadecimal-numeric-literals': NoHexadecimalNumericLiteralsRuleConfig; +} diff --git a/src/rules/jsonc/no-infinity.d.ts b/src/rules/jsonc/no-infinity.d.ts new file mode 100644 index 00000000..892445e8 --- /dev/null +++ b/src/rules/jsonc/no-infinity.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow Infinity. + * + * @see [no-infinity](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-infinity.html) + */ +export type NoInfinityRuleConfig = RuleConfig<[]>; + +/** + * Disallow Infinity. + * + * @see [no-infinity](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-infinity.html) + */ +export interface NoInfinityRule { + /** + * Disallow Infinity. + * + * @see [no-infinity](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-infinity.html) + */ + 'jsonc/no-infinity': NoInfinityRuleConfig; +} diff --git a/src/rules/jsonc/no-irregular-whitespace.d.ts b/src/rules/jsonc/no-irregular-whitespace.d.ts new file mode 100644 index 00000000..78109f76 --- /dev/null +++ b/src/rules/jsonc/no-irregular-whitespace.d.ts @@ -0,0 +1,38 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export interface NoIrregularWhitespaceOption { + skipComments?: boolean; + skipStrings?: boolean; + skipTemplates?: boolean; + skipRegExps?: boolean; +} + +/** + * Options. + */ +export type NoIrregularWhitespaceOptions = [NoIrregularWhitespaceOption?]; + +/** + * Disallow irregular whitespace. + * + * @see [no-irregular-whitespace](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html) + */ +export type NoIrregularWhitespaceRuleConfig = + RuleConfig; + +/** + * Disallow irregular whitespace. + * + * @see [no-irregular-whitespace](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html) + */ +export interface NoIrregularWhitespaceRule { + /** + * Disallow irregular whitespace. + * + * @see [no-irregular-whitespace](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-irregular-whitespace.html) + */ + 'jsonc/no-irregular-whitespace': NoIrregularWhitespaceRuleConfig; +} diff --git a/src/rules/jsonc/no-multi-str.d.ts b/src/rules/jsonc/no-multi-str.d.ts new file mode 100644 index 00000000..ddf88085 --- /dev/null +++ b/src/rules/jsonc/no-multi-str.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow multiline strings. + * + * @see [no-multi-str](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-multi-str.html) + */ +export type NoMultiStrRuleConfig = RuleConfig<[]>; + +/** + * Disallow multiline strings. + * + * @see [no-multi-str](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-multi-str.html) + */ +export interface NoMultiStrRule { + /** + * Disallow multiline strings. + * + * @see [no-multi-str](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-multi-str.html) + */ + 'jsonc/no-multi-str': NoMultiStrRuleConfig; +} diff --git a/src/rules/jsonc/no-nan.d.ts b/src/rules/jsonc/no-nan.d.ts new file mode 100644 index 00000000..d3011a5b --- /dev/null +++ b/src/rules/jsonc/no-nan.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow NaN. + * + * @see [no-nan](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-nan.html) + */ +export type NoNanRuleConfig = RuleConfig<[]>; + +/** + * Disallow NaN. + * + * @see [no-nan](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-nan.html) + */ +export interface NoNanRule { + /** + * Disallow NaN. + * + * @see [no-nan](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-nan.html) + */ + 'jsonc/no-nan': NoNanRuleConfig; +} diff --git a/src/rules/jsonc/no-number-props.d.ts b/src/rules/jsonc/no-number-props.d.ts new file mode 100644 index 00000000..9c0b927d --- /dev/null +++ b/src/rules/jsonc/no-number-props.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow number property keys. + * + * @see [no-number-props](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-number-props.html) + */ +export type NoNumberPropsRuleConfig = RuleConfig<[]>; + +/** + * Disallow number property keys. + * + * @see [no-number-props](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-number-props.html) + */ +export interface NoNumberPropsRule { + /** + * Disallow number property keys. + * + * @see [no-number-props](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-number-props.html) + */ + 'jsonc/no-number-props': NoNumberPropsRuleConfig; +} diff --git a/src/rules/jsonc/no-numeric-separators.d.ts b/src/rules/jsonc/no-numeric-separators.d.ts new file mode 100644 index 00000000..fbbb8d1f --- /dev/null +++ b/src/rules/jsonc/no-numeric-separators.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow numeric separators. + * + * @see [no-numeric-separators](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-numeric-separators.html) + */ +export type NoNumericSeparatorsRuleConfig = RuleConfig<[]>; + +/** + * Disallow numeric separators. + * + * @see [no-numeric-separators](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-numeric-separators.html) + */ +export interface NoNumericSeparatorsRule { + /** + * Disallow numeric separators. + * + * @see [no-numeric-separators](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-numeric-separators.html) + */ + 'jsonc/no-numeric-separators': NoNumericSeparatorsRuleConfig; +} diff --git a/src/rules/jsonc/no-octal-escape.d.ts b/src/rules/jsonc/no-octal-escape.d.ts new file mode 100644 index 00000000..6f953235 --- /dev/null +++ b/src/rules/jsonc/no-octal-escape.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow octal escape sequences in string literals. + * + * @see [no-octal-escape](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-octal-escape.html) + */ +export type NoOctalEscapeRuleConfig = RuleConfig<[]>; + +/** + * Disallow octal escape sequences in string literals. + * + * @see [no-octal-escape](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-octal-escape.html) + */ +export interface NoOctalEscapeRule { + /** + * Disallow octal escape sequences in string literals. + * + * @see [no-octal-escape](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-octal-escape.html) + */ + 'jsonc/no-octal-escape': NoOctalEscapeRuleConfig; +} diff --git a/src/rules/jsonc/no-octal-numeric-literals.d.ts b/src/rules/jsonc/no-octal-numeric-literals.d.ts new file mode 100644 index 00000000..ea5bea88 --- /dev/null +++ b/src/rules/jsonc/no-octal-numeric-literals.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow octal numeric literals. + * + * @see [no-octal-numeric-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-octal-numeric-literals.html) + */ +export type NoOctalNumericLiteralsRuleConfig = RuleConfig<[]>; + +/** + * Disallow octal numeric literals. + * + * @see [no-octal-numeric-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-octal-numeric-literals.html) + */ +export interface NoOctalNumericLiteralsRule { + /** + * Disallow octal numeric literals. + * + * @see [no-octal-numeric-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-octal-numeric-literals.html) + */ + 'jsonc/no-octal-numeric-literals': NoOctalNumericLiteralsRuleConfig; +} diff --git a/src/rules/jsonc/no-octal.d.ts b/src/rules/jsonc/no-octal.d.ts new file mode 100644 index 00000000..d003b97a --- /dev/null +++ b/src/rules/jsonc/no-octal.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow legacy octal literals. + * + * @see [no-octal](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-octal.html) + */ +export type NoOctalRuleConfig = RuleConfig<[]>; + +/** + * Disallow legacy octal literals. + * + * @see [no-octal](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-octal.html) + */ +export interface NoOctalRule { + /** + * Disallow legacy octal literals. + * + * @see [no-octal](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-octal.html) + */ + 'jsonc/no-octal': NoOctalRuleConfig; +} diff --git a/src/rules/jsonc/no-parenthesized.d.ts b/src/rules/jsonc/no-parenthesized.d.ts new file mode 100644 index 00000000..7ce01334 --- /dev/null +++ b/src/rules/jsonc/no-parenthesized.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow parentheses around the expression. + * + * @see [no-parenthesized](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-parenthesized.html) + */ +export type NoParenthesizedRuleConfig = RuleConfig<[]>; + +/** + * Disallow parentheses around the expression. + * + * @see [no-parenthesized](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-parenthesized.html) + */ +export interface NoParenthesizedRule { + /** + * Disallow parentheses around the expression. + * + * @see [no-parenthesized](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-parenthesized.html) + */ + 'jsonc/no-parenthesized': NoParenthesizedRuleConfig; +} diff --git a/src/rules/jsonc/no-plus-sign.d.ts b/src/rules/jsonc/no-plus-sign.d.ts new file mode 100644 index 00000000..05ec2276 --- /dev/null +++ b/src/rules/jsonc/no-plus-sign.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow plus sign. + * + * @see [no-plus-sign](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-plus-sign.html) + */ +export type NoPlusSignRuleConfig = RuleConfig<[]>; + +/** + * Disallow plus sign. + * + * @see [no-plus-sign](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-plus-sign.html) + */ +export interface NoPlusSignRule { + /** + * Disallow plus sign. + * + * @see [no-plus-sign](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-plus-sign.html) + */ + 'jsonc/no-plus-sign': NoPlusSignRuleConfig; +} diff --git a/src/rules/jsonc/no-regexp-literals.d.ts b/src/rules/jsonc/no-regexp-literals.d.ts new file mode 100644 index 00000000..0de4a7dd --- /dev/null +++ b/src/rules/jsonc/no-regexp-literals.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow RegExp literals. + * + * @see [no-regexp-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-regexp-literals.html) + */ +export type NoRegexpLiteralsRuleConfig = RuleConfig<[]>; + +/** + * Disallow RegExp literals. + * + * @see [no-regexp-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-regexp-literals.html) + */ +export interface NoRegexpLiteralsRule { + /** + * Disallow RegExp literals. + * + * @see [no-regexp-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-regexp-literals.html) + */ + 'jsonc/no-regexp-literals': NoRegexpLiteralsRuleConfig; +} diff --git a/src/rules/jsonc/no-sparse-arrays.d.ts b/src/rules/jsonc/no-sparse-arrays.d.ts new file mode 100644 index 00000000..a33af0ee --- /dev/null +++ b/src/rules/jsonc/no-sparse-arrays.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow sparse arrays. + * + * @see [no-sparse-arrays](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-sparse-arrays.html) + */ +export type NoSparseArraysRuleConfig = RuleConfig<[]>; + +/** + * Disallow sparse arrays. + * + * @see [no-sparse-arrays](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-sparse-arrays.html) + */ +export interface NoSparseArraysRule { + /** + * Disallow sparse arrays. + * + * @see [no-sparse-arrays](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-sparse-arrays.html) + */ + 'jsonc/no-sparse-arrays': NoSparseArraysRuleConfig; +} diff --git a/src/rules/jsonc/no-template-literals.d.ts b/src/rules/jsonc/no-template-literals.d.ts new file mode 100644 index 00000000..62f4b215 --- /dev/null +++ b/src/rules/jsonc/no-template-literals.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow template literals. + * + * @see [no-template-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-template-literals.html) + */ +export type NoTemplateLiteralsRuleConfig = RuleConfig<[]>; + +/** + * Disallow template literals. + * + * @see [no-template-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-template-literals.html) + */ +export interface NoTemplateLiteralsRule { + /** + * Disallow template literals. + * + * @see [no-template-literals](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-template-literals.html) + */ + 'jsonc/no-template-literals': NoTemplateLiteralsRuleConfig; +} diff --git a/src/rules/jsonc/no-undefined-value.d.ts b/src/rules/jsonc/no-undefined-value.d.ts new file mode 100644 index 00000000..ac2f2d6d --- /dev/null +++ b/src/rules/jsonc/no-undefined-value.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow `undefined`. + * + * @see [no-undefined-value](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-undefined-value.html) + */ +export type NoUndefinedValueRuleConfig = RuleConfig<[]>; + +/** + * Disallow `undefined`. + * + * @see [no-undefined-value](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-undefined-value.html) + */ +export interface NoUndefinedValueRule { + /** + * Disallow `undefined`. + * + * @see [no-undefined-value](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-undefined-value.html) + */ + 'jsonc/no-undefined-value': NoUndefinedValueRuleConfig; +} diff --git a/src/rules/jsonc/no-unicode-codepoint-escapes.d.ts b/src/rules/jsonc/no-unicode-codepoint-escapes.d.ts new file mode 100644 index 00000000..154361c0 --- /dev/null +++ b/src/rules/jsonc/no-unicode-codepoint-escapes.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow Unicode code point escape sequences. + * + * @see [no-unicode-codepoint-escapes](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-unicode-codepoint-escapes.html) + */ +export type NoUnicodeCodepointEscapesRuleConfig = RuleConfig<[]>; + +/** + * Disallow Unicode code point escape sequences. + * + * @see [no-unicode-codepoint-escapes](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-unicode-codepoint-escapes.html) + */ +export interface NoUnicodeCodepointEscapesRule { + /** + * Disallow Unicode code point escape sequences. + * + * @see [no-unicode-codepoint-escapes](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-unicode-codepoint-escapes.html) + */ + 'jsonc/no-unicode-codepoint-escapes': NoUnicodeCodepointEscapesRuleConfig; +} diff --git a/src/rules/jsonc/no-useless-escape.d.ts b/src/rules/jsonc/no-useless-escape.d.ts new file mode 100644 index 00000000..2d87ef78 --- /dev/null +++ b/src/rules/jsonc/no-useless-escape.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow unnecessary escape usage. + * + * @see [no-useless-escape](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-useless-escape.html) + */ +export type NoUselessEscapeRuleConfig = RuleConfig<[]>; + +/** + * Disallow unnecessary escape usage. + * + * @see [no-useless-escape](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-useless-escape.html) + */ +export interface NoUselessEscapeRule { + /** + * Disallow unnecessary escape usage. + * + * @see [no-useless-escape](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/no-useless-escape.html) + */ + 'jsonc/no-useless-escape': NoUselessEscapeRuleConfig; +} diff --git a/src/rules/jsonc/object-curly-newline.d.ts b/src/rules/jsonc/object-curly-newline.d.ts new file mode 100644 index 00000000..d879e566 --- /dev/null +++ b/src/rules/jsonc/object-curly-newline.d.ts @@ -0,0 +1,71 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export type ObjectCurlyNewlineOption = + | ( + | ('always' | 'never') + | { + multiline?: boolean; + minProperties?: number; + consistent?: boolean; + } + ) + | { + ObjectExpression?: + | ('always' | 'never') + | { + multiline?: boolean; + minProperties?: number; + consistent?: boolean; + }; + ObjectPattern?: + | ('always' | 'never') + | { + multiline?: boolean; + minProperties?: number; + consistent?: boolean; + }; + ImportDeclaration?: + | ('always' | 'never') + | { + multiline?: boolean; + minProperties?: number; + consistent?: boolean; + }; + ExportDeclaration?: + | ('always' | 'never') + | { + multiline?: boolean; + minProperties?: number; + consistent?: boolean; + }; + }; + +/** + * Options. + */ +export type ObjectCurlyNewlineOptions = [ObjectCurlyNewlineOption?]; + +/** + * Enforce consistent line breaks inside braces. + * + * @see [object-curly-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-newline.html) + */ +export type ObjectCurlyNewlineRuleConfig = + RuleConfig; + +/** + * Enforce consistent line breaks inside braces. + * + * @see [object-curly-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-newline.html) + */ +export interface ObjectCurlyNewlineRule { + /** + * Enforce consistent line breaks inside braces. + * + * @see [object-curly-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-newline.html) + */ + 'jsonc/object-curly-newline': ObjectCurlyNewlineRuleConfig; +} diff --git a/src/rules/jsonc/object-curly-spacing.d.ts b/src/rules/jsonc/object-curly-spacing.d.ts new file mode 100644 index 00000000..27f3b75a --- /dev/null +++ b/src/rules/jsonc/object-curly-spacing.d.ts @@ -0,0 +1,44 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Config. + */ +export interface ObjectCurlySpacingConfig { + arraysInObjects?: boolean; + objectsInObjects?: boolean; +} + +/** + * Option. + */ +export type ObjectCurlySpacingOption = 'always' | 'never'; + +/** + * Options. + */ +export type ObjectCurlySpacingOptions = [ + ObjectCurlySpacingOption?, + ObjectCurlySpacingConfig?, +]; + +/** + * Enforce consistent spacing inside braces. + * + * @see [object-curly-spacing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-spacing.html) + */ +export type ObjectCurlySpacingRuleConfig = + RuleConfig; + +/** + * Enforce consistent spacing inside braces. + * + * @see [object-curly-spacing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-spacing.html) + */ +export interface ObjectCurlySpacingRule { + /** + * Enforce consistent spacing inside braces. + * + * @see [object-curly-spacing](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-curly-spacing.html) + */ + 'jsonc/object-curly-spacing': ObjectCurlySpacingRuleConfig; +} diff --git a/src/rules/jsonc/object-property-newline.d.ts b/src/rules/jsonc/object-property-newline.d.ts new file mode 100644 index 00000000..58221a78 --- /dev/null +++ b/src/rules/jsonc/object-property-newline.d.ts @@ -0,0 +1,36 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export interface ObjectPropertyNewlineOption { + allowAllPropertiesOnSameLine?: boolean; + allowMultiplePropertiesPerLine?: boolean; +} + +/** + * Options. + */ +export type ObjectPropertyNewlineOptions = [ObjectPropertyNewlineOption?]; + +/** + * Enforce placing object properties on separate lines. + * + * @see [object-property-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-property-newline.html) + */ +export type ObjectPropertyNewlineRuleConfig = + RuleConfig; + +/** + * Enforce placing object properties on separate lines. + * + * @see [object-property-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-property-newline.html) + */ +export interface ObjectPropertyNewlineRule { + /** + * Enforce placing object properties on separate lines. + * + * @see [object-property-newline](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/object-property-newline.html) + */ + 'jsonc/object-property-newline': ObjectPropertyNewlineRuleConfig; +} diff --git a/src/rules/jsonc/quote-props.d.ts b/src/rules/jsonc/quote-props.d.ts new file mode 100644 index 00000000..7bd34a20 --- /dev/null +++ b/src/rules/jsonc/quote-props.d.ts @@ -0,0 +1,44 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export type QuotePropsOption = + | [] + | ['always' | 'as-needed' | 'consistent' | 'consistent-as-needed'] + | [] + | ['always' | 'as-needed' | 'consistent' | 'consistent-as-needed'] + | [ + 'always' | 'as-needed' | 'consistent' | 'consistent-as-needed', + { + keywords?: boolean; + unnecessary?: boolean; + numbers?: boolean; + }, + ]; + +/** + * Options. + */ +export type QuotePropsOptions = QuotePropsOption; + +/** + * Require quotes around object literal property names. + * + * @see [quote-props](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/quote-props.html) + */ +export type QuotePropsRuleConfig = RuleConfig; + +/** + * Require quotes around object literal property names. + * + * @see [quote-props](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/quote-props.html) + */ +export interface QuotePropsRule { + /** + * Require quotes around object literal property names. + * + * @see [quote-props](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/quote-props.html) + */ + 'jsonc/quote-props': QuotePropsRuleConfig; +} diff --git a/src/rules/jsonc/quotes.d.ts b/src/rules/jsonc/quotes.d.ts new file mode 100644 index 00000000..73053448 --- /dev/null +++ b/src/rules/jsonc/quotes.d.ts @@ -0,0 +1,42 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Config. + */ +export type QuotesConfig = + | 'avoid-escape' + | { + avoidEscape?: boolean; + allowTemplateLiterals?: boolean; + }; + +/** + * Option. + */ +export type QuotesOption = 'single' | 'double' | 'backtick'; + +/** + * Options. + */ +export type QuotesOptions = [QuotesOption?, QuotesConfig?]; + +/** + * Enforce use of double or single quotes. + * + * @see [quotes](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/quotes.html) + */ +export type QuotesRuleConfig = RuleConfig; + +/** + * Enforce use of double or single quotes. + * + * @see [quotes](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/quotes.html) + */ +export interface QuotesRule { + /** + * Enforce use of double or single quotes. + * + * @see [quotes](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/quotes.html) + */ + 'jsonc/quotes': QuotesRuleConfig; +} diff --git a/src/rules/jsonc/sort-array-values.d.ts b/src/rules/jsonc/sort-array-values.d.ts new file mode 100644 index 00000000..70369c75 --- /dev/null +++ b/src/rules/jsonc/sort-array-values.d.ts @@ -0,0 +1,78 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +/** + * @minItems 1 + */ +export type SortArrayValuesOption = [ + { + pathPattern: string; + order: + | ( + | string + | { + valuePattern?: string; + order?: { + type?: 'asc' | 'desc'; + caseSensitive?: boolean; + natural?: boolean; + }; + } + )[] + | { + type?: 'asc' | 'desc'; + caseSensitive?: boolean; + natural?: boolean; + }; + minValues?: number; + }, + ...{ + pathPattern: string; + order: + | ( + | string + | { + valuePattern?: string; + order?: { + type?: 'asc' | 'desc'; + caseSensitive?: boolean; + natural?: boolean; + }; + } + )[] + | { + type?: 'asc' | 'desc'; + caseSensitive?: boolean; + natural?: boolean; + }; + minValues?: number; + }[], +]; + +/** + * Options. + */ +export type SortArrayValuesOptions = SortArrayValuesOption; + +/** + * Require array values to be sorted. + * + * @see [sort-array-values](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/sort-array-values.html) + */ +export type SortArrayValuesRuleConfig = RuleConfig; + +/** + * Require array values to be sorted. + * + * @see [sort-array-values](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/sort-array-values.html) + */ +export interface SortArrayValuesRule { + /** + * Require array values to be sorted. + * + * @see [sort-array-values](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/sort-array-values.html) + */ + 'jsonc/sort-array-values': SortArrayValuesRuleConfig; +} diff --git a/src/rules/jsonc/sort-keys.d.ts b/src/rules/jsonc/sort-keys.d.ts new file mode 100644 index 00000000..5dd1ebb5 --- /dev/null +++ b/src/rules/jsonc/sort-keys.d.ts @@ -0,0 +1,88 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export type SortKeysOption = + | [ + { + pathPattern: string; + hasProperties?: string[]; + order: + | ( + | string + | { + keyPattern?: string; + order?: { + type?: 'asc' | 'desc'; + caseSensitive?: boolean; + natural?: boolean; + }; + } + )[] + | { + type?: 'asc' | 'desc'; + caseSensitive?: boolean; + natural?: boolean; + }; + minKeys?: number; + }, + ...{ + pathPattern: string; + hasProperties?: string[]; + order: + | ( + | string + | { + keyPattern?: string; + order?: { + type?: 'asc' | 'desc'; + caseSensitive?: boolean; + natural?: boolean; + }; + } + )[] + | { + type?: 'asc' | 'desc'; + caseSensitive?: boolean; + natural?: boolean; + }; + minKeys?: number; + }[], + ] + | [] + | ['asc' | 'desc'] + | [ + 'asc' | 'desc', + { + caseSensitive?: boolean; + natural?: boolean; + minKeys?: number; + }, + ]; + +/** + * Options. + */ +export type SortKeysOptions = SortKeysOption; + +/** + * Require object keys to be sorted. + * + * @see [sort-keys](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/sort-keys.html) + */ +export type SortKeysRuleConfig = RuleConfig; + +/** + * Require object keys to be sorted. + * + * @see [sort-keys](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/sort-keys.html) + */ +export interface SortKeysRule { + /** + * Require object keys to be sorted. + * + * @see [sort-keys](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/sort-keys.html) + */ + 'jsonc/sort-keys': SortKeysRuleConfig; +} diff --git a/src/rules/jsonc/space-unary-ops.d.ts b/src/rules/jsonc/space-unary-ops.d.ts new file mode 100644 index 00000000..3cd77a18 --- /dev/null +++ b/src/rules/jsonc/space-unary-ops.d.ts @@ -0,0 +1,38 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Option. + */ +export interface SpaceUnaryOpsOption { + words?: boolean; + nonwords?: boolean; + overrides?: { + [k: string]: boolean; + }; +} + +/** + * Options. + */ +export type SpaceUnaryOpsOptions = [SpaceUnaryOpsOption?]; + +/** + * Disallow spaces after unary operators. + * + * @see [space-unary-ops](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/space-unary-ops.html) + */ +export type SpaceUnaryOpsRuleConfig = RuleConfig; + +/** + * Disallow spaces after unary operators. + * + * @see [space-unary-ops](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/space-unary-ops.html) + */ +export interface SpaceUnaryOpsRule { + /** + * Disallow spaces after unary operators. + * + * @see [space-unary-ops](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/space-unary-ops.html) + */ + 'jsonc/space-unary-ops': SpaceUnaryOpsRuleConfig; +} diff --git a/src/rules/jsonc/valid-json-number.d.ts b/src/rules/jsonc/valid-json-number.d.ts new file mode 100644 index 00000000..b9146ed1 --- /dev/null +++ b/src/rules/jsonc/valid-json-number.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../rule-config'; + +/** + * Disallow invalid number for JSON. + * + * @see [valid-json-number](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/valid-json-number.html) + */ +export type ValidJsonNumberRuleConfig = RuleConfig<[]>; + +/** + * Disallow invalid number for JSON. + * + * @see [valid-json-number](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/valid-json-number.html) + */ +export interface ValidJsonNumberRule { + /** + * Disallow invalid number for JSON. + * + * @see [valid-json-number](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/valid-json-number.html) + */ + 'jsonc/valid-json-number': ValidJsonNumberRuleConfig; +} diff --git a/src/rules/jsonc/vue-custom-block/no-parsing-error.d.ts b/src/rules/jsonc/vue-custom-block/no-parsing-error.d.ts new file mode 100644 index 00000000..d2c061c7 --- /dev/null +++ b/src/rules/jsonc/vue-custom-block/no-parsing-error.d.ts @@ -0,0 +1,22 @@ +import type { RuleConfig } from '../../rule-config'; + +/** + * Disallow parsing errors in Vue custom blocks. + * + * @see [vue-custom-block/no-parsing-error](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/vue-custom-block/no-parsing-error.html) + */ +export type VueCustomBlockNoParsingErrorRuleConfig = RuleConfig<[]>; + +/** + * Disallow parsing errors in Vue custom blocks. + * + * @see [vue-custom-block/no-parsing-error](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/vue-custom-block/no-parsing-error.html) + */ +export interface VueCustomBlockNoParsingErrorRule { + /** + * Disallow parsing errors in Vue custom blocks. + * + * @see [vue-custom-block/no-parsing-error](https://ota-meshi.github.io/eslint-plugin-jsonc/rules/vue-custom-block/no-parsing-error.html) + */ + 'jsonc/vue-custom-block/no-parsing-error': VueCustomBlockNoParsingErrorRuleConfig; +}