Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tame-boxes-shop.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"eslint-plugin-jsonc": minor
---

refactor: hourcekeeping, bump all (dev) deps, stricter rule `options` typings
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ import { rules } from "../../../../../lib/utils/rules";
export default {
name: "EslintPluginEditor",
components: { EslintEditor },
model: {
prop: "code",
},
props: {
code: {
type: String,
Expand Down
2 changes: 2 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import myPlugin from "@ota-meshi/eslint-plugin";
import globals from "globals";

export default [
{
Expand Down Expand Up @@ -145,6 +146,7 @@ export default [
files: ["docs/.vitepress/**/*.{js,mjs,ts,mts,vue}"],
languageOptions: {
sourceType: "module",
globals: globals.browser,
},
rules: {
"eslint-plugin/require-meta-docs-description": "off",
Expand Down
13 changes: 5 additions & 8 deletions lib/rules/array-bracket-newline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,10 @@ import { createRule } from "../utils";
import { isTokenOnSameLine } from "../utils/eslint-ast-utils";
import type { Token } from "../types";
import { isCommentToken } from "@eslint-community/eslint-utils";
type Schema0 =
export type RuleOptions =
| ("always" | "never" | "consistent")
| {
multiline?: boolean;
minItems?: number | null;
};
export default createRule("array-bracket-newline", {
| { multiline?: boolean; minItems?: number | null };
export default createRule<[RuleOptions]>("array-bracket-newline", {
meta: {
docs: {
description:
Expand Down Expand Up @@ -66,7 +63,7 @@ export default createRule("array-bracket-newline", {
* @param option An option value to parse.
* @returns Normalized option object.
*/
function normalizeOptionValue(option: Schema0) {
function normalizeOptionValue(option: RuleOptions) {
let consistent = false;
let multiline = false;
let minItems = 0;
Expand Down Expand Up @@ -100,7 +97,7 @@ export default createRule("array-bracket-newline", {
* @param options An option value to parse.
* @returns Normalized option object.
*/
function normalizeOptions(options: Schema0) {
function normalizeOptions(options: RuleOptions) {
const value = normalizeOptionValue(options);

return { JSONArrayExpression: value, JSONArrayPattern: value };
Expand Down
Loading
Loading