travis-lint

raw JSON →
1.0.0 verified Fri May 01 auth: no javascript abandoned

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.

error TypeError: First argument must be a string or Buffer
cause 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');
error ReferenceError: lint is not defined
cause Forgot to require the module or misspelled the import.
fix
Add: const lint = require('travis-lint');
deprecated Package 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.
gotcha The 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')
gotcha Callback 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)))
npm install travis-lint
yarn add travis-lint
pnpm add travis-lint

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); });
  }
});