├── .eslintrc ├── .gitignore ├── .travis.yml ├── HISTORY.md ├── README.md ├── bin ├── eslint-check └── eslint-install ├── docs ├── options.md └── tape.md ├── index.js ├── lib ├── delegate_bin.js └── errorify.js ├── mocha.js ├── package.json ├── presets.json ├── tape.browser.js ├── tape.js └── test ├── mocha.js └── tape.js /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "standard", 4 | "standard-jsx" 5 | ] 6 | } 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '4' 4 | cache: 5 | directories: 6 | - node_modules 7 | -------------------------------------------------------------------------------- /HISTORY.md: -------------------------------------------------------------------------------- 1 | ## [v0.3.0] 2 | > Jun 3, 2016 3 | 4 | - Add `eslint-install semistandard` preset. 5 | 6 | [v0.3.0]: https://github.com/rstacruz/eslint-engine/compare/v0.2.0...v0.3.0 7 | 8 | ## [v0.2.0] 9 | > May 31, 2016 10 | 11 | - Add mocha support. 12 | - Add `eslint-install xo` preset. 13 | 14 | [v0.2.0]: https://github.com/rstacruz/eslint-engine/compare/v0.1.0...v0.2.0 15 | 16 | ## [v0.1.0] 17 | > May 31, 2016 18 | 19 | - `eslint-install`: Install eslint-engine as a project dependency. 20 | 21 | [v0.1.0]: https://github.com/rstacruz/eslint-engine/compare/v0.0.1...v0.1.0 22 | 23 | ## [v0.0.1] 24 | > May 31, 2016 25 | 26 | - Initial release. 27 | 28 | [v0.0.1]: https://github.com/rstacruz/eslint-engine/tree/v0.0.1 29 | 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eslint-engine 2 | 3 | > Check JavaScript syntax using [eslint][] conveniently in your project 4 | 5 | eslint-engine is a streamlined way to use eslint in your project. Just type `eslint-check` and you're done. 6 | 7 | ![](https://raw.githubusercontent.com/rstacruz/tape-standard/gh-pages/screenshot.png) 8 | 9 | [![Status](https://travis-ci.org/rstacruz/tape-eslint.svg?branch=master)](https://travis-ci.org/rstacruz/tape-eslint "See test builds") 10 | 11 | [eslint]: http://eslint.org/ 12 | 13 | ## Usage 14 | 15 | Install it: 16 | 17 | ```sh 18 | npm install -g eslint-engine 19 | ``` 20 | 21 | Then in your project, install `eslint` as a devDependency and create an `.eslintrc`. Or use one of these presets to help you out: 22 | 23 | ```sh 24 | # pick one 25 | eslint-install standard 26 | eslint-install airbnb 27 | eslint-install xo 28 | eslint-install --help # view all 29 | ``` 30 | 31 | Now run a check: 32 | 33 | ```sh 34 | $ eslint-check 35 | 36 | index.js:53:11: Expected indentation of 8 space characters but found 10. (indent) 37 | index.js:57:39: Trailing spaces not allowed. (no-trailing-spaces) 38 | index.js:59:48: There should be no space before ','. (comma-spacing) 39 | ``` 40 | 41 | ## Features 42 | 43 | - __Convenient:__ eslint-engine checks all the JS files in your project while ignoring some [common ignorables](index.js). It can also be ran as a global command, unlike eslint. 44 | 45 | ```sh 46 | # with eslint-engine 47 | eslint-check 48 | 49 | # with eslint 50 | ./node_modules/.bin/eslint '**/*.js' --ignore-pattern='node_modules' 51 | ``` 52 | 53 | - __Easy to install:__ presets for popular eslint configs can be installed easily. 54 | 55 | ```sh 56 | # with eslint-engine 57 | eslint-install standard 58 | 59 | # with eslint 60 | echo "{ extends: ['standard', 'standard-jsx'] }" > .eslintrc 61 | npm install --save eslint eslint-config-standard ... #snip 62 | ./node_modules/.bin/eslint ... #snip 63 | ``` 64 | 65 | - __Test runner integrations:__ eslint-engine can integrate with tape, ava, and mocha to provide you with fast linting as part of your test suite. 66 | 67 | ## Config 68 | 69 | `eslint.ignore` — You can add ignores via package.json. 70 | 71 | ```js 72 | /* package.json */ 73 | { 74 | "eslint": { 75 | "ignore": "lib/xyz" 76 | } 77 | } 78 | ``` 79 | 80 | `eslint.include` — You can add additional files as well. 81 | 82 | ```js 83 | /* package.json */ 84 | { 85 | "eslint": { 86 | "include": "bin/*" 87 | } 88 | } 89 | ``` 90 | 91 | ## Alternative usage 92 | 93 | ### via Tape/Ava 94 | 95 | Add this test file to your [tape] or [ava] suite: 96 | 97 | ```js 98 | test('eslint', require('eslint-engine/tape')()) 99 | ``` 100 | 101 | ### via Mocha 102 | 103 | Add this test file to your [mocha] suite: 104 | 105 | ```js 106 | describe('eslint', require('eslint-engine/mocha')()) 107 | ``` 108 | 109 | ### via API 110 | 111 | Access the programmatic API this way: 112 | 113 | ```js 114 | var eslint = require('eslint-engine') 115 | 116 | eslint(options, (err, res) => { 117 | res.errorCount 118 | res.results.forEach(item => { 119 | item.filePath 120 | item.messages.forEach(msg => { 121 | msg.line 122 | msg.column 123 | msg.message 124 | msg.ruleId 125 | }) 126 | }) 127 | }) 128 | ``` 129 | 130 | ## Thanks 131 | 132 | **eslint-engine** © 2016+, Rico Sta. Cruz. Released under the [MIT] License.
133 | Authored and maintained by Rico Sta. Cruz with help from contributors ([list][contributors]). 134 | 135 | > [ricostacruz.com](http://ricostacruz.com)  ·  136 | > GitHub [@rstacruz](https://github.com/rstacruz)  ·  137 | > Twitter [@rstacruz](https://twitter.com/rstacruz) 138 | 139 | [MIT]: http://mit-license.org/ 140 | [contributors]: http://github.com/rstacruz/eslint-engine/contributors 141 | [standard]: https://www.npmjs.com/package/standard 142 | [tape]: https://github.com/substack/tape 143 | [ava]: https://www.npmjs.com/package/ava 144 | [mocha]: https://www.npmjs.com/package/mocha 145 | -------------------------------------------------------------------------------- /bin/eslint-check: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var basename = require('path').basename 3 | var eslint = require('../index') 4 | var delegateBin = require('../lib/delegate_bin') 5 | var errorify = require('../lib/errorify') 6 | 7 | if (!module.parent) { 8 | delegateBin('eslint-engine', 'bin/eslint-check') || cli() 9 | } 10 | 11 | function cli (options) { 12 | if (!options) options = {} 13 | if (!options.name) options.name = basename(process.argv[1]) 14 | 15 | var cli = meow(options) 16 | var eslintOpts = { files: cli.input.length ? cli.input : undefined } 17 | eslint(eslintOpts, function (err, res) { 18 | if (err) throw err 19 | errorify(res, function (_, msg) { 20 | console.log(msg.description) 21 | }) 22 | if (res.errorCount > 0) process.exit(1) 23 | }) 24 | } 25 | 26 | function meow (options) { 27 | return require('meow')([ 28 | 'Usage:', 29 | ' $ ' + options.name + '[files] [options]', 30 | '', 31 | 'Options:', 32 | ' -e, --env Specify the environment', 33 | '', 34 | 'Other options:', 35 | ' -h, --help show usage information', 36 | ' -v, --version print version info and exit' 37 | ].join('\n'), { 38 | boolean: ['help', 'version'], 39 | string: ['env'], 40 | alias: { 41 | e: 'env', 42 | h: 'help', v: 'version' 43 | } 44 | }) 45 | } 46 | -------------------------------------------------------------------------------- /bin/eslint-install: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var PRESETS = require('../presets.json') 4 | var join = require('path').join 5 | 6 | function install (preset) { 7 | var data = PRESETS[preset] 8 | 9 | console.log('Updating package.json') 10 | updatePackage() 11 | 12 | if (data.rc) { 13 | console.log('Writing .eslintrc') 14 | require('fs').writeFileSync('.eslintrc', JSON.stringify(data.rc, null, 2) + '\n', 'utf-8') 15 | } 16 | 17 | if (data.npm) { 18 | var pkgs = ['eslint-engine'].concat(data.npm) 19 | console.log('Installing: ' + pkgs.join(' ')) 20 | var args = ['install', '--save-dev', '--save-exact'].concat(pkgs) 21 | var pid = require('child_process').spawn('npm', args, { stdio: 'inherit' }) 22 | pid.on('close', function (code) { 23 | if (code !== 0) process.exit(code) 24 | }) 25 | } 26 | } 27 | 28 | if (!module.parent) { 29 | var cli = meow() 30 | var preset = cli.input[0] 31 | if (preset && PRESETS[preset]) { 32 | install(preset) 33 | } else { 34 | console.log('Usage: eslint-install ') 35 | console.log('See --help for details.') 36 | process.exit(1) 37 | } 38 | } 39 | 40 | function meow () { 41 | return require('meow')([ 42 | 'Usage:', 43 | ' $ eslint-install ', 44 | '', 45 | 'Available presets:', 46 | ' ' + Object.keys(PRESETS).join('\n '), 47 | '', 48 | 'Options:', 49 | ' -h, --help show usage information', 50 | ' -v, --version print version info and exit' 51 | ].join('\n'), { 52 | boolean: ['help', 'version'], 53 | alias: { 54 | h: 'help', v: 'version' 55 | } 56 | }) 57 | } 58 | 59 | function updatePackage () { 60 | var fname = join(process.cwd(), 'package.json') 61 | var pkg = require(fname) 62 | 63 | if (!pkg.scripts) pkg.scripts = {} 64 | if (!pkg.scripts.lint) pkg.scripts.lint = 'eslint-check' 65 | 66 | require('fs').writeFileSync(fname, JSON.stringify(pkg, null, 2) + '\n', 'utf-8') 67 | } 68 | -------------------------------------------------------------------------------- /docs/options.md: -------------------------------------------------------------------------------- 1 | # Options 2 | 3 | ## files 4 | tape-eslint scans `**/*.js` and `**/*.jsx` by default. To configure what files to consume, use: 5 | 6 | ```js 7 | test('eslint', require('tape-eslint')({ 8 | files: [ 'index.js', 'test/*.js' ] 9 | })) 10 | ``` 11 | 12 | ## ignore 13 | Some files are [ignored by default][ignores]. To add more files to ignore, use: 14 | 15 | ```js 16 | test('eslint', require('tape-eslint')({ 17 | ignore: [ 'app/**' ] 18 | })) 19 | ``` 20 | 21 | ## eslint 22 | To specify options to pass onto `eslint.CLIEngine`, add them here. See [eslint's source](https://github.com/eslint/eslint/blob/v1.10.3/lib/cli-engine.js#L47-L60) for details. 23 | 24 | ```js 25 | // to specify a different config file 26 | test('eslint', require('tape-eslint')({ 27 | eslint: { 28 | configFile: path.join(__dirname, 'eslintrc.json') 29 | } 30 | })) 31 | ``` 32 | 33 | ```js 34 | // to specify your eslint config inline 35 | test('eslint', require('tape-eslint')({ 36 | eslint: { 37 | baseConfig: { extends: ['standard', 'standard-react'] } 38 | } 39 | })) 40 | ``` 41 | 42 | [ignores]: ../index.js 43 | -------------------------------------------------------------------------------- /docs/tape.md: -------------------------------------------------------------------------------- 1 | # Tape 2 | 3 | ## Rationale 4 | 5 | This offers a finer alternative to adding the *eslint* command as a separate test step in your `npm test`. 6 | 7 | * Runs in the same node process as tape, removing maybe 500ms of startup time. 8 | * Painlessly integrate eslint into your travisci.org tests. 9 | * You can get fast realtime linting feedback with [tape-watch]. 10 | 11 | (Your speed gains may be a bit different from my Pentium II, of course.) 12 | 13 | [tape-watch]: https://github.com/rstacruz/tape-watch.git 14 | 15 | ## Browserify 16 | 17 | If you use [Browserify] on your tests (eg: [smokestack], [tape-run], [budo], [hihat], [zuul], and so on), doing `require('tape-eslint')()` is a noop. In practice, this means you can use `tape-eslint` even if your tests are powered by browserify, and your test will now work in both the browser and Node. 18 | 19 | [zuul]: https://www.npmjs.com/package/zuul 20 | [tape-run]: https://www.npmjs.com/package/tape-run 21 | [budo]: https://github.com/mattdesl/budo 22 | [hihat]: https://www.npmjs.com/package/hihat 23 | [smokestack]: https://www.npmjs.com/package/smokestack 24 | [Browserify]: http://browserify.org/ 25 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var deglob = require('deglob') 2 | var assign = require('object-assign') 3 | 4 | var cwd = process.cwd() 5 | var eslint = requireHere('eslint') 6 | 7 | // https://github.com/sindresorhus/xo/blob/7644b9d9faf517b5b8f049b2083f13e7a803596c/index.js#L12-L21 8 | var DEFAULT_IGNORE = [ 9 | 'node_modules/**', 10 | 'bower_components/**', 11 | 'coverage/**', 12 | '{tmp,temp}/**', 13 | '**/*.min.js', 14 | '**/bundle.js', 15 | 'fixture{-*,}.{js,jsx}', 16 | '{test/,}fixture{s,}/**', 17 | 'vendor/**', 18 | 'dist/**' 19 | ] 20 | 21 | var DEGLOB_OPTIONS = { 22 | useGitIgnore: true, 23 | usePackageJson: true, 24 | configKey: 'eslint', 25 | ignore: DEFAULT_IGNORE 26 | } 27 | 28 | var DEFAULT_PATTERNS = [ 29 | '**/*.js', 30 | '**/*.jsx' 31 | ] 32 | 33 | /* 34 | * A simpler interface to eslint. 35 | * 36 | * runEslint({ files: ['lib/*.js'] }, (err, res) => { 37 | * // ... 38 | * }) 39 | * 40 | * Available options: 41 | * 42 | * - `files` *(Array)* - file globs 43 | * - `include` *(Array)* - additional file globs 44 | * - `ignore` *(Array)* - ignore globs 45 | * - `eslint` *(Object)* — eslint config to use 46 | */ 47 | 48 | module.exports = function runEslint (options, cb) { 49 | try { 50 | if (!options) options = {} 51 | 52 | var pkg = getPackage() 53 | if (pkg.eslint) { 54 | if (pkg.eslint.include) { 55 | options.include = pkg.eslint.include.concat(options.include || []) 56 | } 57 | } 58 | 59 | var deglobOptions = DEGLOB_OPTIONS 60 | if (options.ignore) { 61 | deglobOptions = assign({}, deglobOptions, { 62 | ignore: deglobOptions.ignore.concat(options.ignore) 63 | }) 64 | } 65 | 66 | var files = options.files || DEFAULT_PATTERNS 67 | if (options.include) files = files.concat(options.include) 68 | 69 | deglob(files, deglobOptions, function (err, files) { 70 | if (err) return cb(err) 71 | var cli = new eslint.CLIEngine(options.eslint) 72 | var res = cli.executeOnFiles(files) 73 | cb(null, res) 74 | }) 75 | } catch (err) { 76 | cb(err) 77 | } 78 | } 79 | 80 | function getPackage () { 81 | try { 82 | return require('./package.json') 83 | } catch (err) { 84 | return {} 85 | } 86 | } 87 | 88 | function requireHere (module) { 89 | var resolveModule = require('resolve').sync 90 | return require(resolveModule(module, { basedir: cwd })) 91 | } 92 | -------------------------------------------------------------------------------- /lib/delegate_bin.js: -------------------------------------------------------------------------------- 1 | const join = require('path').join 2 | const resolve = require('path').resolve 3 | const spawnSync = require('child_process').spawnSync 4 | 5 | /** 6 | * Delegates to a the local version of an executable if available. 7 | */ 8 | 9 | module.exports = function delegateBin (mod, bin) { 10 | var binPath = join(process.cwd(), 'node_modules', mod, bin) 11 | 12 | if (exists(binPath) && resolve(process.argv[1]) !== resolve(binPath)) { 13 | var node = process.argv[0] // /usr/bin/node 14 | var args = [binPath].concat(process.argv.slice(2)) 15 | var result = spawnSync(node, args, { stdio: 'inherit' }) 16 | if (result.error) { 17 | console.error('! Error: failed to invoke ' + bin + ' from node_modules.') 18 | console.error(' ' + result.error.message) 19 | process.exit(result.status || 1) 20 | } 21 | process.exit(result.status) 22 | } 23 | } 24 | 25 | function exists (filename) { 26 | try { 27 | return require('fs').statSync(filename) 28 | } catch (e) {} 29 | } 30 | -------------------------------------------------------------------------------- /lib/errorify.js: -------------------------------------------------------------------------------- 1 | var cwd = process.cwd() 2 | var firstSlash = new RegExp('^' + require('path').sep.replace('\\', '\\\\')) 3 | 4 | /* 5 | * Converts eslint errors into `t.fail()` errors. 6 | * This works like Array.prototype.reduce. 7 | * 8 | * var err = errorify(res, (err, msg, { line, column, message, ruleId }) { 9 | * err.stack += msg 10 | * }, new Error('Issues found:')) 11 | */ 12 | 13 | module.exports = function errorify (res, fn, acc) { 14 | res.results.forEach(function (result) { 15 | if (result.errorCount || result.warningCount) { 16 | result.messages.forEach(function (msg) { 17 | var filePath = strip(result.filePath) 18 | var description = '' + filePath + 19 | ':' + msg.line + ':' + msg.column + ': ' + 20 | msg.message + ' (' + msg.ruleId + ')' 21 | acc = fn(acc, { 22 | description: description, 23 | line: msg.line, 24 | column: msg.column, 25 | filePath: filePath, 26 | fullPath: result.fullPath, 27 | message: msg.message, 28 | ruleId: msg.ruleId 29 | }) 30 | }) 31 | } 32 | }) 33 | return acc 34 | } 35 | 36 | function strip (str) { 37 | return str.replace(cwd, '').replace(firstSlash, '') 38 | } 39 | -------------------------------------------------------------------------------- /mocha.js: -------------------------------------------------------------------------------- 1 | var eslint = require('./index') 2 | var errorify = require('./lib/errorify') 3 | 4 | module.exports = function mochaEslint (options) { 5 | return function () { 6 | this.timeout(10000) 7 | 8 | global.it('passes', function (done) { 9 | eslint(options, function (err, res) { 10 | if (err) return done(err) 11 | var count = res.errorCount + res.warningCount 12 | if (count === 0) { 13 | return done() 14 | } else { 15 | err = new Error('' + count + (count === 1 ? ' issue' : ' issues') + ' found:') 16 | err.stack = '' 17 | errorify(res, function (_, msg) { 18 | err.message += '\n ' + msg.description 19 | }) 20 | return done(err) 21 | } 22 | }) 23 | }) 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "eslint-engine", 3 | "description": "Check JavaScript syntax using eslint", 4 | "version": "0.3.0", 5 | "author": "Rico Sta. Cruz ", 6 | "bin": { 7 | "eslint-check": "bin/eslint-check", 8 | "eslint-install": "bin/eslint-install" 9 | }, 10 | "browser": { 11 | "tape": "tape.browser.js" 12 | }, 13 | "bugs": { 14 | "url": "https://github.com/rstacruz/eslint-engine/issues" 15 | }, 16 | "dependencies": { 17 | "deglob": "1.0.2", 18 | "meow": "3.7.0", 19 | "object-assign": "4.0.1", 20 | "resolve": "1.1.7" 21 | }, 22 | "devDependencies": { 23 | "eslint": "2.11.0", 24 | "eslint-config-standard": "5.3.1", 25 | "eslint-config-standard-jsx": "1.2.0", 26 | "eslint-plugin-promise": "1.3.1", 27 | "eslint-plugin-react": "5.1.1", 28 | "eslint-plugin-standard": "1.3.2", 29 | "mocha": "2.5.3", 30 | "standard": "5.4.1", 31 | "tape": "4.4.0" 32 | }, 33 | "eslint": { 34 | "include": "bin/*" 35 | }, 36 | "homepage": "https://github.com/rstacruz/eslint-engine#readme", 37 | "keywords": [ 38 | "JavaScript Standard Style", 39 | "check", 40 | "checker", 41 | "code", 42 | "code checker", 43 | "code linter", 44 | "code standards", 45 | "code style", 46 | "enforce", 47 | "eslint", 48 | "eslintconfig", 49 | "hint", 50 | "jscs", 51 | "jshint", 52 | "lint", 53 | "lint", 54 | "policy", 55 | "quality", 56 | "simple", 57 | "standard", 58 | "standard style", 59 | "style", 60 | "style checker", 61 | "style linter", 62 | "tape", 63 | "verify" 64 | ], 65 | "license": "MIT", 66 | "main": "index.js", 67 | "repository": { 68 | "type": "git", 69 | "url": "git+https://github.com/rstacruz/eslint-engine.git" 70 | }, 71 | "scripts": { 72 | "test": "node test/tape.js", 73 | "lint": "eslint-check" 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /presets.json: -------------------------------------------------------------------------------- 1 | { 2 | "standard": { 3 | "rc": { 4 | "extends": [ 5 | "standard", 6 | "standard-jsx" 7 | ] 8 | }, 9 | "npm": [ 10 | "eslint@2", 11 | "eslint-config-standard@5", 12 | "eslint-config-standard-jsx@1", 13 | "eslint-plugin-promise", 14 | "eslint-plugin-react", 15 | "eslint-plugin-standard" 16 | ] 17 | }, 18 | "standard-nojsx": { 19 | "rc": { 20 | "extends": [ 21 | "standard" 22 | ] 23 | }, 24 | "npm": [ 25 | "eslint@2", 26 | "eslint-config-standard", 27 | "eslint-plugin-promise", 28 | "eslint-plugin-standard" 29 | ] 30 | }, 31 | "semistandard": { 32 | "rc": { 33 | "extends": [ 34 | "semistandard", 35 | "standard-jsx" 36 | ] 37 | }, 38 | "npm": [ 39 | "eslint@2", 40 | "eslint-config-standard@5", 41 | "eslint-config-semistandard@6", 42 | "eslint-config-standard-jsx@1", 43 | "eslint-plugin-promise", 44 | "eslint-plugin-react", 45 | "eslint-plugin-standard" 46 | ] 47 | }, 48 | "airbnb": { 49 | "rc": { 50 | "extends": [ 51 | "airbnb" 52 | ] 53 | }, 54 | "npm": [ 55 | "eslint@2", 56 | "eslint-config-airbnb@9", 57 | "eslint-plugin-import", 58 | "eslint-plugin-react", 59 | "eslint-plugin-jsx-a11y" 60 | ] 61 | }, 62 | "xo": { 63 | "rc": { 64 | "plugins": [ 65 | "xo" 66 | ], 67 | "extends": [ 68 | "xo", 69 | "plugin:xo/recommended" 70 | ] 71 | }, 72 | "npm": [ 73 | "eslint@2", 74 | "eslint-config-xo@0", 75 | "eslint-plugin-xo@0" 76 | ] 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /tape.browser.js: -------------------------------------------------------------------------------- 1 | module.exports = function tapeEslint (options) { 2 | return function (t) { 3 | t.pass('tape-eslint not supported on this platform') 4 | t.end() 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /tape.js: -------------------------------------------------------------------------------- 1 | var eslint = require('./index') 2 | var errorify = require('./lib/errorify') 3 | 4 | module.exports = function tapeEslint (options) { 5 | return function (t) { 6 | eslint(options, function (err, res) { 7 | if (err) return t.fail(err) 8 | var count = res.errorCount + res.warningCount 9 | if (count === 0) t.pass('passed') 10 | else errorify(res, function (_, msg) { t.fail(msg.description) }) 11 | t.end() 12 | }) 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /test/mocha.js: -------------------------------------------------------------------------------- 1 | global.describe('eslint', require('../mocha')()) 2 | -------------------------------------------------------------------------------- /test/tape.js: -------------------------------------------------------------------------------- 1 | var test = require('tape') 2 | 3 | test('standard', require('../tape')()) 4 | --------------------------------------------------------------------------------