Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: validate rule meta.schema #9

Merged
merged 1 commit into from
Dec 5, 2024
Merged

Conversation

ntnyq
Copy link
Contributor

@ntnyq ntnyq commented Dec 4, 2024

Description

This PR adds meta.schema check to test-runner. Like ESLint test-runner does.

Linked Issues

eslint-stylistic/eslint-stylistic#616

Additional context

taze is added to exclude ajv version bumpping to keep it the same as ESLint uses.

@antfu antfu merged commit 81ea42c into antfu:main Dec 5, 2024
5 checks passed
// Forked from https://github.com/eslint/eslint/blob/7fe4114be2e714506fd406ea4474430ea3de0f93/lib/config/flat-config-helpers.js and https://github.com/eslint/eslint/blob/7fe4114be2e714506fd406ea4474430ea3de0f93/lib/shared/ajv.js

import Ajv from 'ajv'
import metaSchema from 'ajv/lib/refs/json-schema-draft-04.json'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I try to run tests with this, I get the following:

TypeError: Module "file:///path/to/node_modules/ajv/lib/refs/json-schema-draft-04.json" needs an import attribute of "type: json"

I'll try to put together a minimal reproducible case, but I'm curious if anybody else has worked around the same.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the meantime, downgrading to eslint-vitest-rule-tester@v0.6.1 solves the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants