{"id":49376,"library":"slate-schema-violations","title":"Slate Schema Violations","description":"Provides a set of named constants for the built-in validation violations in Slate's schema. This package is part of the Slate editor framework ecosystem and is used internally by `slate-schema` to represent rule-breaking reasons with human-readable identifiers. Version 0.1.39 is the latest stable release. It has no regular release cadence and is a lightweight utility with no dependencies. Key differentiator: it avoids magic strings for violation types.","status":"maintenance","version":"0.1.39","language":"javascript","source_language":"en","source_url":"git://github.com/ianstormtaylor/slate","tags":["javascript","constants","schema","slate","violation"],"install":[{"cmd":"npm install slate-schema-violations","lang":"bash","label":"npm"},{"cmd":"yarn add slate-schema-violations","lang":"bash","label":"yarn"},{"cmd":"pnpm add slate-schema-violations","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS require is supported but ESM import is preferred.","wrong":"const { CHILD_TYPE_INVALID } = require('slate-schema-violations')","symbol":"CHILD_TYPE_INVALID","correct":"import { CHILD_TYPE_INVALID } from 'slate-schema-violations'"},{"note":"This package is also available as a default object containing all violations, but named imports are recommended.","wrong":"import CHILD_REQUIRED from 'slate-schema-violations'","symbol":"CHILD_REQUIRED","correct":"import { CHILD_REQUIRED } from 'slate-schema-violations'"},{"note":"You can import all constants as a namespace.","wrong":"const Violations = require('slate-schema-violations')","symbol":"Violations (all constants)","correct":"import * as Violations from 'slate-schema-violations'"}],"quickstart":{"code":"import { CHILD_TYPE_INVALID, CHILD_REQUIRED, PARENT_TYPE_INVALID, PARENT_REQUIRED, TEXT_NODE } from 'slate-schema-violations';\nconsole.log(CHILD_TYPE_INVALID); // 'child_type_invalid'\nconsole.log(CHILD_REQUIRED); // 'child_required'","lang":"typescript","description":"Demonstrates importing and using a few violation constants from the package."},"warnings":[{"fix":"Migrate to Slate's new architecture; this package is no longer maintained.","message":"Package is deprecated in favor of using custom rules with Slate's new plugin system (Slate >= 0.50).","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Use these constants as keys in schema rules for clarity.","message":"All constants are simply string values; no actual validation logic.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Import specific constants by name or use import * as Violations.","message":"The package does not export a default object in ESM; named exports only.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.39':51 'avoid':74 'break':43 'built':13 'built-in':12 'cadenc':62 'constant':9,81 'depend':70 'differenti':72 'ecosystem':30 'editor':28 'framework':29 'human':47 'human-read':46 'identifi':49 'intern':34 'javascript':80 'key':71 'latest':54 'lightweight':66 'magic':75 'name':8 'packag':22 'part':24 'provid':4 'readabl':48 'reason':44 'regular':60 'releas':56,61 'repres':40 'rule':42 'rule-break':41 'schema':2,20,38,82 'set':6 'slate':1,18,27,37,83 'slate-schema':36 'stabl':55 'string':76 'type':79 'use':33 'util':67 'valid':15 'version':50 'violat':3,16,78,84","created_at":"2026-06-07T17:01:27.736357+00:00","updated_at":"2026-06-07T17:01:27.736357+00:00","problems":[{"fix":"Run npm install slate-schema-violations --save","cause":"Package not installed or path resolution issue.","error":"Cannot find module 'slate-schema-violations'"},{"fix":"Use named import: import { CHILD_TYPE_INVALID } from 'slate-schema-violations'","cause":"Importing a default export that does not exist.","error":"TypeError: Cannot read properties of undefined (reading 'CHILD_TYPE_INVALID')"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"git://github.com/ianstormtaylor/slate","github":"git://github.com/ianstormtaylor/slate","docs":null,"changelog":null,"pypi":null,"npm":"slate-schema-violations","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}