Open FloEdelmann opened 4 days ago
It might just be a schema configuration bug that needs to be fixed upstream.
The error occurs when ajv compiles the schema, and the message indicates that the default is ignored
, which is correct, as we can just configure one item ["never"]
?
Hmm, but their test cases also pass only one option: https://github.com/eslint-stylistic/eslint-stylistic/blob/main/packages/eslint-plugin/rules/function-call-spacing/function-call-spacing._js_.test.ts
I haven't compared them in detail, but seems like eslint-stylistic
uses eslint-vitest-rule-tester
. I'm not sure if it has a pre-check for the schema like eslint.RuleTester
does internally.
default
inside anyOf
is indeed actually invalid: https://ajv.js.org/guide/modifying-data.html#assigning-defaults
With
useDefaults
optiondefault
keywords throws exception during schema compilation when used in:
- not in
properties
oritems
subschemas- in schemas inside
anyOf
,oneOf
andnot
(see #42)- in
if
schema- in schemas generated by user-defined macro keywords
So I'll report this to eslint-stylistic. Thanks for your help investigating!
I've opened an issue and a PR in eslint-stylistic:
I'll leave this issue open until a fixed version of eslint-stylistic is released.
Yesterday, tests in all PRs started to fail for the
vue/func-call-spacing
extension rule, e.g. here: https://github.com/vuejs/eslint-plugin-vue/actions/runs/11925499375/job/33237692823?pr=2611It is likely related to changes in eslint-stylistic v2.11.0, since with
@stylistic/eslint-plugin
v2.10.1, the tests still pass. Relevant changes: eslint-stylistic/eslint-stylistic@v2.10.1...v2.11.0
#diff-b89bec3716Unfortunately, I can't figure out how those changes influence our extension rule and tests, so @ota-meshi (or anyone else), could you please have a look at that?