Scans a repository directory, searching for configured linters
JavaScript
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.editorconfig
.eslintrc.json
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

detect-repo-linters

NPM version Downloads Build Status Coverage Status Dependency status Dev Dependency status Greenkeeper badge

Scans a repository directory, searching for configured linters.

Installation

$ npm install detect-repo-linters

Usage

detectRepoLinters(dir, [callback]) -> Promise

You may consume the result using promises or callbacks, it's up to you.

const detectRepoLinters = require('detect-repo-linters');

detectRepoLinters('./some-repository-directory')
.then((linters) => {
    // linters is an array of linter names that looks like:
    // ['editorconfig', 'eslint', 'stylelint']
});

At the moment the following linters are detected:

Feel free to a PR to include other linters as part of the detection!

Tests

$ npm test
$ npm test-cov to get coverage report

License

Released under the MIT License.