Registry / devops / travis-lint

travis-lint

JSON →
library1.0.0jsnpmunverified

Travis-lint is a tool for linting .travis.yml files to catch common misconfigurations and syntax errors in Travis CI configuration. Version 1.0.0 is the final release; the package is unmaintained since 2014. It supports both programmatic and CLI usage, but relies on a callback-style API. Compared to alternatives like yamllint or Travis CI's web linter, this package is minimal and outdated; Travis CI now provides native validation.

npm install travis-lint
INSTALL
IMPORT
SIG · TRAVIS-LINT
T
travis-lint
devopsjavascriptv1.0.0
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.

lint
const lint = require('travis-lint');
import lint from 'travis-lint';
Package does not support ES modules; only CommonJS require works.

Read .travis.yml file synchronously and lint it, printing any warnings.

const fs = require('fs'); const lint = require('travis-lint'); const yaml = fs.readFileSync('.travis.yml', 'utf8'); lint(yaml, function(err, warnings) { if (err) throw err; if (warnings.length === 0) { console.log('No issues found.'); } else { warnings.forEach(function(w) { console.log(w); }); } });
travis-lint --version
Debug
Known issues
deprecatedPackage is unmaintained and may produce false positives/negatives for current Travis CI configuration.
fix
Use Travis CI's native linting (travis lint command) or yamllint with a Travis schema.
affects: >=1.0.0
gotchaThe lint function expects a string, not a Buffer. Passing fs.readFileSync without encoding may cause errors.
fix
Always provide encoding: fs.readFileSync('.travis.yml', 'utf8')
affects: >=1.0.0
gotchaCallback pattern is used; no promise or async/await support.
fix
Wrap in a Promise if needed: new Promise((resolve, reject) => lint(yaml, (err, w) => err ? reject(err) : resolve(w)))
affects: >=1.0.0
Errors
Common errors & fixes
TypeError: First argument must be a string or Buffer
lint() called with a non-string/non-Buffer value (e.g., undefined or stream).
fix
Ensure input is a string: const yaml = fs.readFileSync('.travis.yml', 'utf8');
ReferenceError: lint is not defined
Forgot to require the module or misspelled the import.
fix
Add: const lint = require('travis-lint');
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
js-yamlrequiredparses YAML content
Agent activity
4 hits · last 30 days
node
4
Resources
travis-lint — npm install travis-lint · libregistry