How to use ignore - 10 common examples

To help you get started, we’ve selected a few ignore examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flow-typed / flow-typed / definitions / npm / ignore_v4.x.x / flow_v0.25.0- / test_ignore.js View on Github external
// @flow
import ignore from 'ignore';

const ign = ignore();
ignore({});
ignore({ ignorecase: false });
// $ExpectError
ignore({ foo: true });

ign.add('.abc/*');
ign.add(['.abc/*', '!.abc/d/']);
ign.add('.abc/*').add('!.abc/d/');

ign.add(ignore());
ign.add([ignore(), ignore()]);
ign.add(ignore()).add(ignore());

// $ExpectError
ign.add(666);
// $ExpectError
github phodal / dilay / src / compile-check.ts View on Github external
*
 */

import * as fs from "fs";
import * as path from "path";
import ignore from 'ignore'

const colors = require('colors/safe');

import FrameworkHelper from "./helper/framework.helper";
import FileUtil from "./helper/file.util";

const parseIgnore = require('parse-gitignore');

let ignoreFiles = parseIgnore(fs.readFileSync(process.cwd() + '/' + '.gitignore'));
const ig = ignore().add(ignoreFiles);

function compile(filename: string, filePath: string, options: { projectType: string; program: any }) {
  const isDir = fs.lstatSync(filePath).isDirectory();
  const isFile = !isDir;

  const lines: string[] = [];

  // Do not show these regardless.
  if (filename) {
    let filteredPath = ig.filter([filename]);
    if (filteredPath.length === 0) {
      return lines;
    }
  }

  if (isFile) {
github shoutem / cli / src / services / platform-archive.js View on Github external
async loadIgnoreList() {
    const ignoreFilePath = path.join(this.path, SHOUTEM_IGNORE_FILE_NAME);
    const shoutemIgnores = readLinesInFile(ignoreFilePath);

    // no need to remove comments, 'ignores' does that for us
    return ignore().add(shoutemIgnores);
  }
}
github remoteinterview / zero / packages / core / lib / utils / zeroignore.js View on Github external
module.exports = () => {
  if (!zeroignore) {
    zeroignore = nodeignore();

    // add default ignores
    zeroignore.add(DEFAULTIGNORES);

    // read .zeroignore file if present
    var zeroignorePath = path.join(process.env.PROJECTPATH, ".zeroignore");
    if (fs.existsSync(zeroignorePath)) {
      zeroignore.add(fs.readFileSync(zeroignorePath, "utf8"));
    }
  }

  return zeroignore;
};
github mattfysh / testr.js / spec / testr.config.spec.js View on Github external
it('ignores specified modules, using actual from requirejs', function() {
		var module = require('ignore');
		expect(module.ignore).toBe(true);
		module.newprop = 'a';
		module = testr('ignore');
		expect(module.newprop).toBe('a');
	});
github mattfysh / testr.js / spec / testr.config.spec.js View on Github external
it('ignores specified modules, using actual from requirejs', function() {
		var module = require('ignore');
		expect(module.ignore).toBe(true);
		module.newprop = 'a';
		module = testr('ignore');
		expect(module.newprop).toBe('a');
	});
github mattfysh / testr.js / spec / testr.config.spec.js View on Github external
it('ignores specified modules, using actual from requirejs', function() {
		var module = require('ignore');
		expect(module.ignore).toBe(true);
		module.newprop = 'a';
		module = testr('ignore');
		expect(module.newprop).toBe('a');
	});
github tntim96 / JSCover / src / test-integration / resources / data / javascript-ignore.expected / ignore.js View on Github external
if (! _$jscoverage['ignore.js']) {
  _$jscoverage['ignore.js'] = {};
  _$jscoverage['ignore.js'].lineData = [];
  _$jscoverage['ignore.js'].lineData[1] = 0;
  _$jscoverage['ignore.js'].lineData[3] = 0;
  _$jscoverage['ignore.js'].lineData[4] = 0;
  _$jscoverage['ignore.js'].lineData[6] = 0;
  _$jscoverage['ignore.js'].lineData[7] = 0;
  _$jscoverage['ignore.js'].lineData[10] = 0;
  _$jscoverage['ignore.js'].lineData[14] = 0;
  _$jscoverage['ignore.js'].lineData[16] = 0;
  _$jscoverage['ignore.js'].lineData[17] = 0;
  _$jscoverage['ignore.js'].lineData[22] = 0;
  _$jscoverage['ignore.js'].lineData[23] = 0;
  _$jscoverage['ignore.js'].lineData[27] = 0;
  _$jscoverage['ignore.js'].lineData[32] = 0;
  _$jscoverage['ignore.js'].lineData[34] = 0;
github tntim96 / JSCover / src / test-integration / resources / data / javascript-ignore.expected / ignore.js View on Github external
if (! _$jscoverage['ignore.js']) {
  _$jscoverage['ignore.js'] = {};
  _$jscoverage['ignore.js'].lineData = [];
  _$jscoverage['ignore.js'].lineData[1] = 0;
  _$jscoverage['ignore.js'].lineData[3] = 0;
  _$jscoverage['ignore.js'].lineData[4] = 0;
  _$jscoverage['ignore.js'].lineData[6] = 0;
  _$jscoverage['ignore.js'].lineData[7] = 0;
  _$jscoverage['ignore.js'].lineData[10] = 0;
  _$jscoverage['ignore.js'].lineData[14] = 0;
  _$jscoverage['ignore.js'].lineData[16] = 0;
  _$jscoverage['ignore.js'].lineData[17] = 0;
  _$jscoverage['ignore.js'].lineData[22] = 0;
  _$jscoverage['ignore.js'].lineData[23] = 0;
  _$jscoverage['ignore.js'].lineData[27] = 0;
  _$jscoverage['ignore.js'].lineData[32] = 0;
  _$jscoverage['ignore.js'].lineData[34] = 0;
  _$jscoverage['ignore.js'].lineData[35] = 0;
  _$jscoverage['ignore.js'].lineData[37] = 0;
github tntim96 / JSCover / src / test-integration / resources / data / javascript-ignore.expected / ignore.js View on Github external
_$jscoverage['ignore.js'].lineData[14] = 0;
  _$jscoverage['ignore.js'].lineData[16] = 0;
  _$jscoverage['ignore.js'].lineData[17] = 0;
  _$jscoverage['ignore.js'].lineData[22] = 0;
  _$jscoverage['ignore.js'].lineData[23] = 0;
  _$jscoverage['ignore.js'].lineData[27] = 0;
  _$jscoverage['ignore.js'].lineData[32] = 0;
  _$jscoverage['ignore.js'].lineData[34] = 0;
  _$jscoverage['ignore.js'].lineData[35] = 0;
  _$jscoverage['ignore.js'].lineData[37] = 0;
  _$jscoverage['ignore.js'].lineData[38] = 0;
  _$jscoverage['ignore.js'].lineData[42] = 0;
  _$jscoverage['ignore.js'].lineData[43] = 0;
  _$jscoverage['ignore.js'].lineData[44] = 0;
}
_$jscoverage['ignore.js'].conditionals = [];
if (! _$jscoverage['ignore.js'].functionData) {
  _$jscoverage['ignore.js'].functionData = [];
  _$jscoverage['ignore.js'].functionData[0] = 0;
  _$jscoverage['ignore.js'].functionData[1] = 0;
  _$jscoverage['ignore.js'].functionData[2] = 0;
}
_$jscoverage['ignore.js'].lineData[1]++;
function createRequest() {
  _$jscoverage['ignore.js'].functionData[0]++;
  _$jscoverage['ignore.js'].lineData[3]++;
  if (window.XMLHttpRequest) {
    _$jscoverage['ignore.js'].conditionals[6] = 11;
    _$jscoverage['ignore.js'].lineData[4]++;
    return new XMLHttpRequest();
  } else {
    _$jscoverage['ignore.js'].conditionals[4] = 5;

ignore

Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.

MIT
Latest version published 3 months ago

Package Health Score

79 / 100
Full package analysis