@boehringer-ingelheim/eslint-config
Version:
Shared eslint configuration used at Boehringer Ingelheim for code styling
29 lines • 1.4 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.includeIgnoreFile = void 0;
const node_path_1 = __importDefault(require("node:path"));
const node_process_1 = require("node:process");
const config_helpers_1 = require("@eslint/config-helpers");
/**
* Reads an ignore file (e.g. `.gitignore`) and returns an object with the ignore patterns.
*
* @param {string} [ignoreFilePath='.gitignore'] - The path to the ignore file. Defaults to `.gitignore`.
* @throws {TypeError} If the provided path is not a string.
* @throws {Error} If the provided path is an empty string.
* @returns {import('@eslint/config-helpers').FlatConfig} The result of including the ignore file at the resolved absolute path.
*/
const includeIgnoreFile = (ignoreFilePath = '.gitignore') => {
if (typeof ignoreFilePath !== 'string') {
throw new TypeError('Expected a string');
}
if (ignoreFilePath === '') {
throw new Error('Expected a non-empty string');
}
const absolutePath = node_path_1.default.resolve((0, node_process_1.cwd)(), ignoreFilePath);
return (0, config_helpers_1.includeIgnoreFile)(absolutePath);
};
exports.includeIgnoreFile = includeIgnoreFile;
//# sourceMappingURL=include-ignore-file.js.map