Registry / testing / ramllint

ramllint

JSON →
library1.2.6jsnpmunverified

A static analysis linter for RAML API specifications, enforcing style and consistency rules across API documentation. Version 1.2.6 is the latest stable release, built for Node.js >=0.12.3. It provides both a library and CLI interface to validate RAML files against configurable rules for URLs, naming conventions, and structure. Unlike generic YAML validators, ramllint focuses on RAML-specific patterns and integrates with CI pipelines. The package appears to be in maintenance mode with no recent updates.

npm install ramllint
INSTALL
IMPORT
SIG · RAMLLINT
R
ramllint
testingjavascriptv1.2.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Linter
var Linter = require('ramllint');
import Linter from 'ramllint';
This package uses CommonJS; ESM imports are not supported. The module exports a constructor function.
Linter
const ramllint = new Linter();
const ramllint = new ramllint.Linter();
The required value is the constructor itself, not a namespace.
Linter
const Linter = require('ramllint'); const linter = new Linter(options);
const linter = require('ramllint').create();
Linter must be instantiated with `new`. There is no `create` method.

Shows how to instantiate the linter and lint a RAML file with the callback API.

var Linter = require('ramllint'); var linter = new Linter(); linter.lint('./api.raml', function (results) { if (results.length === 0) { console.log('No errors found.'); } else { console.log('Errors:', results); } });
ramllint --version
Debug
Known issues
gotchaThe `lint` callback only returns `error` level results; warning and info entries are excluded.
fix
Use `linter.results()` to get all log entries after calling `lint`.
affects: >=1.0.0
gotchaThe `require('ramllint')` returns the Linter constructor, not an instance. Forgetting `new` will cause errors.
fix
Always instantiate with `new Linter()`.
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: Class constructor Linter cannot be invoked without 'new'
Calling `Linter()` without `new` in ES6 classes (but the package uses ES5 function constructor; still requires `new`).
fix
Use `new Linter()` instead of `Linter()`.
Error: Cannot find module 'ramllint'
Package not installed or global install not resolved.
fix
Run `npm install ramllint --save` or `npm install -g ramllint`.
Upgrade
Version history
1.2.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
ramllint — npm install ramllint · libregistry