Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ota-meshi/eslint-plugin-json-schema-validator
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.9.0
Choose a base ref
...
head repository: ota-meshi/eslint-plugin-json-schema-validator
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.0.0
Choose a head ref
  • 4 commits
  • 9 files changed
  • 4 contributors

Commits on Mar 20, 2024

  1. Copy the full SHA
    0495670 View commit details

Commits on Mar 23, 2024

  1. chore: fix site (#304)

    ota-meshi authored Mar 23, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f65a640 View commit details
  2. fix: useSchemastoreCatalog is enabled by default according to docs. (

    …#305)
    
    * fix: `useSchemastoreCatalog` is enabled by default according to docs.
    
    * Create sixty-mice-arrive.md
    
    * add test
    ota-meshi authored Mar 23, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ada5a08 View commit details
  3. chore: release eslint-plugin-json-schema-validator (#306)

    Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    github-actions[bot] and github-actions[bot] authored Mar 23, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    754f001 View commit details
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# eslint-plugin-json-schema-validator

## 5.0.0

### Major Changes

- [#305](https://github.com/ota-meshi/eslint-plugin-json-schema-validator/pull/305) [`ada5a08`](https://github.com/ota-meshi/eslint-plugin-json-schema-validator/commit/ada5a0818d0f067a99dcfe3e134acac218479536) Thanks [@ota-meshi](https://github.com/ota-meshi)! - fix: `useSchemastoreCatalog` is enabled by default according to docs.

## 4.9.0

### Minor Changes
8 changes: 4 additions & 4 deletions docs/.vuepress/components/playground-block.vue
Original file line number Diff line number Diff line change
@@ -218,13 +218,13 @@ export default {
};
function equalsRules(a, b) {
const akeys = Object.keys(a).filter((k) => a[k] !== "off");
const bkeys = Object.keys(b).filter((k) => b[k] !== "off");
if (akeys.length !== bkeys.length) {
const aKeys = Object.keys(a).filter((k) => a[k] !== "off");
const bKeys = Object.keys(b).filter((k) => b[k] !== "off");
if (aKeys.length !== bKeys.length) {
return false;
}
for (const k of akeys) {
for (const k of aKeys) {
if (a[k] !== b[k]) {
return false;
}
8 changes: 6 additions & 2 deletions docs/.vuepress/components/stylelint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
module.exports = {
extends: ["stylelint-config-standard", "stylelint-config-recommended-vue"],
extends: [
"stylelint-config-standard",
"stylelint-config-recommended-vue",
"@stylistic/stylelint-config",
],
rules: {
"no-descending-specificity": null,
indentation: null,
"@stylistic/indentation": null,
},
};
4 changes: 4 additions & 0 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,10 @@ const schema = require("../../lib/utils/schema");
schema.loadJson("https://www.schemastore.org/api/json/catalog.json", {});
schema.loadSchema("https://json.schemastore.org/eslintrc.json", {});
schema.loadSchema("https://json.schemastore.org/prettierrc.json", {});
schema.loadSchema(
"https://json.schemastore.org/partial-eslint-plugins.json",
{},
);

function ruleToLink({
meta: {
6 changes: 5 additions & 1 deletion docs/.vuepress/styles/stylelint.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
module.exports = {
extends: ["stylelint-config-standard", "stylelint-stylus/standard"],
extends: [
"stylelint-config-standard",
"stylelint-stylus/standard",
"@stylistic/stylelint-config",
],
rules: {
"no-descending-specificity": null,
"selector-class-pattern": null,
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint-plugin-json-schema-validator",
"version": "4.9.0",
"version": "5.0.0",
"description": "ESLint plugin that validates data using JSON Schema Validator.",
"repository": "git+https://github.com/ota-meshi/eslint-plugin-json-schema-validator.git",
"homepage": "https://ota-meshi.github.io/eslint-plugin-json-schema-validator/",
@@ -67,10 +67,11 @@
"@changesets/changelog-github": "^0.5.0",
"@changesets/cli": "^2.24.2",
"@ota-meshi/eslint-plugin": "^0.15.0",
"@stylistic/stylelint-config": "^1.0.1",
"@types/debug": "^4.1.5",
"@types/eslint": "^8.56.2",
"@types/eslint-scope": "^3.7.0",
"@types/eslint-visitor-keys": "^1.0.0",
"@types/eslint-visitor-keys": "^3.0.0",
"@types/estree": "^1.0.0",
"@types/mocha": "^10.0.0",
"@types/node": "^20.0.0",
3 changes: 2 additions & 1 deletion src/rules/no-invalid.ts
Original file line number Diff line number Diff line change
@@ -403,7 +403,8 @@ export default createRule("no-invalid", {
relativeFilename: string,
): Validator[] | null {
const option = context.options[0] || {};
if (!option.useSchemastoreCatalog) {
const useSchemastoreCatalog = option.useSchemastoreCatalog !== false;
if (!useSchemastoreCatalog) {
return null;
}

1 change: 0 additions & 1 deletion src/utils/validator-factory.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ import type {
ValidateFunction,
RegExpEngine,
} from "./ajv";
import { URL } from "url";
import type { RuleContext } from "../types";
import Ajv from "./ajv";
import { draft7 as migrateToDraft7 } from "json-schema-migrate";
9 changes: 9 additions & 0 deletions tests/src/rules/no-invalid.ts
Original file line number Diff line number Diff line change
@@ -42,6 +42,15 @@ tester.run(
},
],
invalid: [
{
filename: ".eslintrc.json",
code: '{ "extends": [ 42 ] }',
errors: [
'"extends" must be string.',
'"extends" must match exactly one schema in oneOf.',
'"extends[0]" must be string.',
],
},
{
filename: ".eslintrc.json",
code: '{ "extends": [ 42 ] }',