From f2fc3ef55305e9378c9427f07806a2947d72213d Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 19 Dec 2024 12:46:05 +0100 Subject: [PATCH 1/5] Update @stylistic/eslint-plugin to 2.12.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0c75e65c7..5cc1e2d9b 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ }, "devDependencies": { "@ota-meshi/site-kit-eslint-editor-vue": "^0.2.4", - "@stylistic/eslint-plugin": "^2.12.0", + "@stylistic/eslint-plugin": "^2.12.1", "@types/eslint": "^8.56.2", "@types/eslint-visitor-keys": "^3.3.2", "@types/natural-compare": "^1.4.3", From a0af71813bc34f4efe614b75f3a51f703570baf8 Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 19 Dec 2024 12:46:35 +0100 Subject: [PATCH 2/5] Update typescript to 5.7.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5cc1e2d9b..c768c1079 100644 --- a/package.json +++ b/package.json @@ -95,7 +95,7 @@ "nyc": "^17.1.0", "pathe": "^1.1.2", "prettier": "^3.3.3", - "typescript": "^5.6.3", + "typescript": "^5.7.2", "vitepress": "^1.4.1" } } From 719830b43ff5427bf653c1328635c87e6150c4de Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 19 Dec 2024 12:47:54 +0100 Subject: [PATCH 3/5] Update eslint-plugin-eslint-plugin to 6.4.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c768c1079..8d9c25a62 100644 --- a/package.json +++ b/package.json @@ -81,7 +81,7 @@ "esbuild": "^0.24.0", "eslint": "^8.57.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-eslint-plugin": "~6.3.1", + "eslint-plugin-eslint-plugin": "~6.4.0", "eslint-plugin-import": "^2.31.0", "eslint-plugin-jsonc": "^2.16.0", "eslint-plugin-node-dependencies": "^0.12.0", From b4523ba38cf90531cb5cf7af3e06b2721ff4462e Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 19 Dec 2024 13:04:41 +0100 Subject: [PATCH 4/5] Fix `eslint-plugin/no-meta-schema-default` lint issues --- lib/rules/html-button-has-type.js | 15 +++--------- lib/rules/no-irregular-whitespace.js | 30 +++++------------------- lib/rules/require-macro-variable-name.js | 27 +++++---------------- lib/rules/sort-keys.js | 14 ++++------- 4 files changed, 20 insertions(+), 66 deletions(-) diff --git a/lib/rules/html-button-has-type.js b/lib/rules/html-button-has-type.js index 31192ec99..b61a008c6 100644 --- a/lib/rules/html-button-has-type.js +++ b/lib/rules/html-button-has-type.js @@ -35,18 +35,9 @@ module.exports = { { type: 'object', properties: { - button: { - default: optionDefaults.button, - type: 'boolean' - }, - submit: { - default: optionDefaults.submit, - type: 'boolean' - }, - reset: { - default: optionDefaults.reset, - type: 'boolean' - } + button: { type: 'boolean' }, + submit: { type: 'boolean' }, + reset: { type: 'boolean' } }, additionalProperties: false } diff --git a/lib/rules/no-irregular-whitespace.js b/lib/rules/no-irregular-whitespace.js index 8d3f59c9e..a1705f459 100644 --- a/lib/rules/no-irregular-whitespace.js +++ b/lib/rules/no-irregular-whitespace.js @@ -31,30 +31,12 @@ module.exports = { { type: 'object', properties: { - skipComments: { - type: 'boolean', - default: false - }, - skipStrings: { - type: 'boolean', - default: true - }, - skipTemplates: { - type: 'boolean', - default: false - }, - skipRegExps: { - type: 'boolean', - default: false - }, - skipHTMLAttributeValues: { - type: 'boolean', - default: false - }, - skipHTMLTextContents: { - type: 'boolean', - default: false - } + skipComments: { type: 'boolean' }, + skipStrings: { type: 'boolean' }, + skipTemplates: { type: 'boolean' }, + skipRegExps: { type: 'boolean' }, + skipHTMLAttributeValues: { type: 'boolean' }, + skipHTMLTextContents: { type: 'boolean' } }, additionalProperties: false } diff --git a/lib/rules/require-macro-variable-name.js b/lib/rules/require-macro-variable-name.js index f48df6bba..02cb2f5af 100644 --- a/lib/rules/require-macro-variable-name.js +++ b/lib/rules/require-macro-variable-name.js @@ -28,26 +28,11 @@ module.exports = { { type: 'object', properties: { - defineProps: { - type: 'string', - default: DEFAULT_OPTIONS.defineProps - }, - defineEmits: { - type: 'string', - default: DEFAULT_OPTIONS.defineEmits - }, - defineSlots: { - type: 'string', - default: DEFAULT_OPTIONS.defineSlots - }, - useSlots: { - type: 'string', - default: DEFAULT_OPTIONS.useSlots - }, - useAttrs: { - type: 'string', - default: DEFAULT_OPTIONS.useAttrs - } + defineProps: { type: 'string' }, + defineEmits: { type: 'string' }, + defineSlots: { type: 'string' }, + useSlots: { type: 'string' }, + useAttrs: { type: 'string' } }, additionalProperties: false } @@ -60,7 +45,7 @@ module.exports = { }, /** @param {RuleContext} context */ create(context) { - const options = context.options[0] || DEFAULT_OPTIONS + const options = Object.assign({}, DEFAULT_OPTIONS, context.options[0]) const relevantMacros = new Set([ ...Object.keys(DEFAULT_OPTIONS), 'withDefaults' diff --git a/lib/rules/sort-keys.js b/lib/rules/sort-keys.js index 9598adf0b..edfa1360b 100644 --- a/lib/rules/sort-keys.js +++ b/lib/rules/sort-keys.js @@ -82,8 +82,7 @@ module.exports = { type: 'object', properties: { caseSensitive: { - type: 'boolean', - default: true + type: 'boolean' }, ignoreChildrenOf: { type: 'array' @@ -93,16 +92,13 @@ module.exports = { }, minKeys: { type: 'integer', - minimum: 2, - default: 2 + minimum: 2 }, natural: { - type: 'boolean', - default: false + type: 'boolean' }, runOutsideVue: { - type: 'boolean', - default: true + type: 'boolean' } }, additionalProperties: false @@ -137,7 +133,7 @@ module.exports = { (options && options.ignoreChildrenOf) || ['model'] ) const insensitive = options && options.caseSensitive === false - const minKeys = options && options.minKeys + const minKeys = options?.minKeys ?? 2 const natural = options && options.natural const isValidOrder = isValidOrders[order + (insensitive ? 'I' : '') + (natural ? 'N' : '')] From 7847e9e112ea458cf3cc0304a541ac096e42073b Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Thu, 19 Dec 2024 13:04:53 +0100 Subject: [PATCH 5/5] Disable `eslint-plugin/require-meta-default-options` rule for now --- eslint.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/eslint.config.js b/eslint.config.js index ea76a9d73..92e6d3fa2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -45,6 +45,7 @@ module.exports = [ // turn off some rules from shared configs in all files { rules: { + 'eslint-plugin/require-meta-default-options': 'off', // TODO: enable when all rules have defaultOptions 'eslint-plugin/require-meta-docs-recommended': 'off', // use `categories` instead 'eslint-plugin/require-meta-schema-description': 'off',