Skip to content

Commit 237932c

Browse files
authored
refactor: hourcekeeping, bump all (dev) deps, stricter rule options typings (#402)
1 parent 45931be commit 237932c

File tree

69 files changed

+746
-638
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+746
-638
lines changed

.changeset/tame-boxes-shop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"eslint-plugin-jsonc": minor
3+
---
4+
5+
refactor: hourcekeeping, bump all (dev) deps, stricter rule `options` typings

docs/.vitepress/theme/components/components/EslintPluginEditor.vue

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ import { rules } from "../../../../../lib/utils/rules";
2424
export default {
2525
name: "EslintPluginEditor",
2626
components: { EslintEditor },
27-
model: {
28-
prop: "code",
29-
},
3027
props: {
3128
code: {
3229
type: String,

eslint.config.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import myPlugin from "@ota-meshi/eslint-plugin";
2+
import globals from "globals";
23

34
export default [
45
{
@@ -145,6 +146,7 @@ export default [
145146
files: ["docs/.vitepress/**/*.{js,mjs,ts,mts,vue}"],
146147
languageOptions: {
147148
sourceType: "module",
149+
globals: globals.browser,
148150
},
149151
rules: {
150152
"eslint-plugin/require-meta-docs-description": "off",

lib/rules/array-bracket-newline.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,10 @@ import { createRule } from "../utils";
55
import { isTokenOnSameLine } from "../utils/eslint-ast-utils";
66
import type { Token } from "../types";
77
import { isCommentToken } from "@eslint-community/eslint-utils";
8-
type Schema0 =
8+
export type RuleOptions =
99
| ("always" | "never" | "consistent")
10-
| {
11-
multiline?: boolean;
12-
minItems?: number | null;
13-
};
14-
export default createRule("array-bracket-newline", {
10+
| { multiline?: boolean; minItems?: number | null };
11+
export default createRule<[RuleOptions]>("array-bracket-newline", {
1512
meta: {
1613
docs: {
1714
description:
@@ -66,7 +63,7 @@ export default createRule("array-bracket-newline", {
6663
* @param option An option value to parse.
6764
* @returns Normalized option object.
6865
*/
69-
function normalizeOptionValue(option: Schema0) {
66+
function normalizeOptionValue(option: RuleOptions) {
7067
let consistent = false;
7168
let multiline = false;
7269
let minItems = 0;
@@ -100,7 +97,7 @@ export default createRule("array-bracket-newline", {
10097
* @param options An option value to parse.
10198
* @returns Normalized option object.
10299
*/
103-
function normalizeOptions(options: Schema0) {
100+
function normalizeOptions(options: RuleOptions) {
104101
const value = normalizeOptionValue(options);
105102

106103
return { JSONArrayExpression: value, JSONArrayPattern: value };

0 commit comments

Comments
 (0)