@dcf-micro/eslint-config 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/chunks/eslint-plugin-prettier.mjs +1716 -0
  2. package/dist/chunks/index.mjs +1341 -0
  3. package/dist/chunks/index10.mjs +39595 -0
  4. package/dist/chunks/index11.mjs +24 -0
  5. package/dist/chunks/index12.mjs +75273 -0
  6. package/dist/chunks/index13.mjs +55129 -0
  7. package/dist/chunks/index14.mjs +24 -0
  8. package/dist/chunks/index15.mjs +1441 -0
  9. package/dist/chunks/index2.mjs +31864 -0
  10. package/dist/chunks/index3.mjs +8154 -0
  11. package/dist/chunks/index4.mjs +24 -0
  12. package/dist/chunks/index5.mjs +44093 -0
  13. package/dist/chunks/index6.mjs +10371 -0
  14. package/dist/chunks/index7.mjs +21890 -0
  15. package/dist/chunks/index8.mjs +14424 -0
  16. package/dist/chunks/index9.mjs +194 -0
  17. package/dist/chunks/jiti.mjs +320 -0
  18. package/dist/index.d.mts +3897 -0
  19. package/dist/index.d.ts +3897 -0
  20. package/dist/index.mjs +4 -0
  21. package/dist/shared/eslint-config.BDBLGvXj.mjs +5282 -0
  22. package/dist/shared/eslint-config.BEdqg1el.mjs +12256 -0
  23. package/dist/shared/eslint-config.BKmXKm8B.mjs +5533 -0
  24. package/dist/shared/eslint-config.BjUMgISS.mjs +9012 -0
  25. package/dist/shared/eslint-config.Bk-3rH6Y.mjs +1355 -0
  26. package/dist/shared/eslint-config.BytuZ0Ec.mjs +20 -0
  27. package/dist/shared/eslint-config.C1V0I4Np.mjs +16900 -0
  28. package/dist/shared/eslint-config.CGxZQKHV.mjs +2091 -0
  29. package/dist/shared/eslint-config.COweQ1RR.mjs +5 -0
  30. package/dist/shared/eslint-config.CSnk9Q4w.mjs +9339 -0
  31. package/dist/shared/eslint-config.CWvTq0mr.mjs +2914 -0
  32. package/dist/shared/eslint-config.Ca4PTK8E.mjs +646 -0
  33. package/dist/shared/eslint-config.CmPTszkJ.mjs +3583 -0
  34. package/dist/shared/eslint-config.CqEANaNA.mjs +139622 -0
  35. package/dist/shared/eslint-config.CsePEcYJ.mjs +71 -0
  36. package/dist/shared/eslint-config.Cw6mETSZ.mjs +2580 -0
  37. package/dist/shared/eslint-config.DTVnsecK.mjs +1751 -0
  38. package/dist/shared/eslint-config.DWoU09EE.mjs +6958 -0
  39. package/dist/shared/eslint-config.DZvqTQUU.mjs +3818 -0
  40. package/dist/shared/eslint-config.Dhg7lT0g.mjs +1807 -0
  41. package/dist/shared/eslint-config.Du5y5qmf.mjs +200673 -0
  42. package/dist/shared/eslint-config.FKVuBSa4.mjs +394 -0
  43. package/dist/shared/eslint-config.I8d-HnmI.mjs +2654 -0
  44. package/dist/shared/eslint-config.YntqsQY1.mjs +40 -0
  45. package/dist/shared/eslint-config.uGTBNMD0.mjs +687 -0
  46. package/package.json +56 -0
@@ -0,0 +1,646 @@
1
+ var ignore;
2
+ var hasRequiredIgnore;
3
+
4
+ function requireIgnore () {
5
+ if (hasRequiredIgnore) return ignore;
6
+ hasRequiredIgnore = 1;
7
+ // A simple implementation of make-array
8
+ function makeArray (subject) {
9
+ return Array.isArray(subject)
10
+ ? subject
11
+ : [subject]
12
+ }
13
+
14
+ const EMPTY = '';
15
+ const SPACE = ' ';
16
+ const ESCAPE = '\\';
17
+ const REGEX_TEST_BLANK_LINE = /^\s+$/;
18
+ const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
19
+ const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
20
+ const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
21
+ const REGEX_SPLITALL_CRLF = /\r?\n/g;
22
+ // /foo,
23
+ // ./foo,
24
+ // ../foo,
25
+ // .
26
+ // ..
27
+ const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
28
+
29
+ const SLASH = '/';
30
+
31
+ // Do not use ternary expression here, since "istanbul ignore next" is buggy
32
+ let TMP_KEY_IGNORE = 'node-ignore';
33
+ /* istanbul ignore else */
34
+ if (typeof Symbol !== 'undefined') {
35
+ TMP_KEY_IGNORE = Symbol.for('node-ignore');
36
+ }
37
+ const KEY_IGNORE = TMP_KEY_IGNORE;
38
+
39
+ const define = (object, key, value) =>
40
+ Object.defineProperty(object, key, {value});
41
+
42
+ const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
43
+
44
+ const RETURN_FALSE = () => false;
45
+
46
+ // Sanitize the range of a regular expression
47
+ // The cases are complicated, see test cases for details
48
+ const sanitizeRange = range => range.replace(
49
+ REGEX_REGEXP_RANGE,
50
+ (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0)
51
+ ? match
52
+ // Invalid range (out of order) which is ok for gitignore rules but
53
+ // fatal for JavaScript regular expression, so eliminate it.
54
+ : EMPTY
55
+ );
56
+
57
+ // See fixtures #59
58
+ const cleanRangeBackSlash = slashes => {
59
+ const {length} = slashes;
60
+ return slashes.slice(0, length - length % 2)
61
+ };
62
+
63
+ // > If the pattern ends with a slash,
64
+ // > it is removed for the purpose of the following description,
65
+ // > but it would only find a match with a directory.
66
+ // > In other words, foo/ will match a directory foo and paths underneath it,
67
+ // > but will not match a regular file or a symbolic link foo
68
+ // > (this is consistent with the way how pathspec works in general in Git).
69
+ // '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'
70
+ // -> ignore-rules will not deal with it, because it costs extra `fs.stat` call
71
+ // you could use option `mark: true` with `glob`
72
+
73
+ // '`foo/`' should not continue with the '`..`'
74
+ const REPLACERS = [
75
+
76
+ [
77
+ // remove BOM
78
+ // TODO:
79
+ // Other similar zero-width characters?
80
+ /^\uFEFF/,
81
+ () => EMPTY
82
+ ],
83
+
84
+ // > Trailing spaces are ignored unless they are quoted with backslash ("\")
85
+ [
86
+ // (a\ ) -> (a )
87
+ // (a ) -> (a)
88
+ // (a ) -> (a)
89
+ // (a \ ) -> (a )
90
+ /((?:\\\\)*?)(\\?\s+)$/,
91
+ (_, m1, m2) => m1 + (
92
+ m2.indexOf('\\') === 0
93
+ ? SPACE
94
+ : EMPTY
95
+ )
96
+ ],
97
+
98
+ // replace (\ ) with ' '
99
+ // (\ ) -> ' '
100
+ // (\\ ) -> '\\ '
101
+ // (\\\ ) -> '\\ '
102
+ [
103
+ /(\\+?)\s/g,
104
+ (_, m1) => {
105
+ const {length} = m1;
106
+ return m1.slice(0, length - length % 2) + SPACE
107
+ }
108
+ ],
109
+
110
+ // Escape metacharacters
111
+ // which is written down by users but means special for regular expressions.
112
+
113
+ // > There are 12 characters with special meanings:
114
+ // > - the backslash \,
115
+ // > - the caret ^,
116
+ // > - the dollar sign $,
117
+ // > - the period or dot .,
118
+ // > - the vertical bar or pipe symbol |,
119
+ // > - the question mark ?,
120
+ // > - the asterisk or star *,
121
+ // > - the plus sign +,
122
+ // > - the opening parenthesis (,
123
+ // > - the closing parenthesis ),
124
+ // > - and the opening square bracket [,
125
+ // > - the opening curly brace {,
126
+ // > These special characters are often called "metacharacters".
127
+ [
128
+ /[\\$.|*+(){^]/g,
129
+ match => `\\${match}`
130
+ ],
131
+
132
+ [
133
+ // > a question mark (?) matches a single character
134
+ /(?!\\)\?/g,
135
+ () => '[^/]'
136
+ ],
137
+
138
+ // leading slash
139
+ [
140
+
141
+ // > A leading slash matches the beginning of the pathname.
142
+ // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
143
+ // A leading slash matches the beginning of the pathname
144
+ /^\//,
145
+ () => '^'
146
+ ],
147
+
148
+ // replace special metacharacter slash after the leading slash
149
+ [
150
+ /\//g,
151
+ () => '\\/'
152
+ ],
153
+
154
+ [
155
+ // > A leading "**" followed by a slash means match in all directories.
156
+ // > For example, "**/foo" matches file or directory "foo" anywhere,
157
+ // > the same as pattern "foo".
158
+ // > "**/foo/bar" matches file or directory "bar" anywhere that is directly
159
+ // > under directory "foo".
160
+ // Notice that the '*'s have been replaced as '\\*'
161
+ /^\^*\\\*\\\*\\\//,
162
+
163
+ // '**/foo' <-> 'foo'
164
+ () => '^(?:.*\\/)?'
165
+ ],
166
+
167
+ // starting
168
+ [
169
+ // there will be no leading '/'
170
+ // (which has been replaced by section "leading slash")
171
+ // If starts with '**', adding a '^' to the regular expression also works
172
+ /^(?=[^^])/,
173
+ function startingReplacer () {
174
+ // If has a slash `/` at the beginning or middle
175
+ return !/\/(?!$)/.test(this)
176
+ // > Prior to 2.22.1
177
+ // > If the pattern does not contain a slash /,
178
+ // > Git treats it as a shell glob pattern
179
+ // Actually, if there is only a trailing slash,
180
+ // git also treats it as a shell glob pattern
181
+
182
+ // After 2.22.1 (compatible but clearer)
183
+ // > If there is a separator at the beginning or middle (or both)
184
+ // > of the pattern, then the pattern is relative to the directory
185
+ // > level of the particular .gitignore file itself.
186
+ // > Otherwise the pattern may also match at any level below
187
+ // > the .gitignore level.
188
+ ? '(?:^|\\/)'
189
+
190
+ // > Otherwise, Git treats the pattern as a shell glob suitable for
191
+ // > consumption by fnmatch(3)
192
+ : '^'
193
+ }
194
+ ],
195
+
196
+ // two globstars
197
+ [
198
+ // Use lookahead assertions so that we could match more than one `'/**'`
199
+ /\\\/\\\*\\\*(?=\\\/|$)/g,
200
+
201
+ // Zero, one or several directories
202
+ // should not use '*', or it will be replaced by the next replacer
203
+
204
+ // Check if it is not the last `'/**'`
205
+ (_, index, str) => index + 6 < str.length
206
+
207
+ // case: /**/
208
+ // > A slash followed by two consecutive asterisks then a slash matches
209
+ // > zero or more directories.
210
+ // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
211
+ // '/**/'
212
+ ? '(?:\\/[^\\/]+)*'
213
+
214
+ // case: /**
215
+ // > A trailing `"/**"` matches everything inside.
216
+
217
+ // #21: everything inside but it should not include the current folder
218
+ : '\\/.+'
219
+ ],
220
+
221
+ // normal intermediate wildcards
222
+ [
223
+ // Never replace escaped '*'
224
+ // ignore rule '\*' will match the path '*'
225
+
226
+ // 'abc.*/' -> go
227
+ // 'abc.*' -> skip this rule,
228
+ // coz trailing single wildcard will be handed by [trailing wildcard]
229
+ /(^|[^\\]+)(\\\*)+(?=.+)/g,
230
+
231
+ // '*.js' matches '.js'
232
+ // '*.js' doesn't match 'abc'
233
+ (_, p1, p2) => {
234
+ // 1.
235
+ // > An asterisk "*" matches anything except a slash.
236
+ // 2.
237
+ // > Other consecutive asterisks are considered regular asterisks
238
+ // > and will match according to the previous rules.
239
+ const unescaped = p2.replace(/\\\*/g, '[^\\/]*');
240
+ return p1 + unescaped
241
+ }
242
+ ],
243
+
244
+ [
245
+ // unescape, revert step 3 except for back slash
246
+ // For example, if a user escape a '\\*',
247
+ // after step 3, the result will be '\\\\\\*'
248
+ /\\\\\\(?=[$.|*+(){^])/g,
249
+ () => ESCAPE
250
+ ],
251
+
252
+ [
253
+ // '\\\\' -> '\\'
254
+ /\\\\/g,
255
+ () => ESCAPE
256
+ ],
257
+
258
+ [
259
+ // > The range notation, e.g. [a-zA-Z],
260
+ // > can be used to match one of the characters in a range.
261
+
262
+ // `\` is escaped by step 3
263
+ /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
264
+ (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE
265
+ // '\\[bar]' -> '\\\\[bar\\]'
266
+ ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}`
267
+ : close === ']'
268
+ ? endEscape.length % 2 === 0
269
+ // A normal case, and it is a range notation
270
+ // '[bar]'
271
+ // '[bar\\\\]'
272
+ ? `[${sanitizeRange(range)}${endEscape}]`
273
+ // Invalid range notaton
274
+ // '[bar\\]' -> '[bar\\\\]'
275
+ : '[]'
276
+ : '[]'
277
+ ],
278
+
279
+ // ending
280
+ [
281
+ // 'js' will not match 'js.'
282
+ // 'ab' will not match 'abc'
283
+ /(?:[^*])$/,
284
+
285
+ // WTF!
286
+ // https://git-scm.com/docs/gitignore
287
+ // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
288
+ // which re-fixes #24, #38
289
+
290
+ // > If there is a separator at the end of the pattern then the pattern
291
+ // > will only match directories, otherwise the pattern can match both
292
+ // > files and directories.
293
+
294
+ // 'js*' will not match 'a.js'
295
+ // 'js/' will not match 'a.js'
296
+ // 'js' will match 'a.js' and 'a.js/'
297
+ match => /\/$/.test(match)
298
+ // foo/ will not match 'foo'
299
+ ? `${match}$`
300
+ // foo matches 'foo' and 'foo/'
301
+ : `${match}(?=$|\\/$)`
302
+ ],
303
+
304
+ // trailing wildcard
305
+ [
306
+ /(\^|\\\/)?\\\*$/,
307
+ (_, p1) => {
308
+ const prefix = p1
309
+ // '\^':
310
+ // '/*' does not match EMPTY
311
+ // '/*' does not match everything
312
+
313
+ // '\\\/':
314
+ // 'abc/*' does not match 'abc/'
315
+ ? `${p1}[^/]+`
316
+
317
+ // 'a*' matches 'a'
318
+ // 'a*' matches 'aa'
319
+ : '[^/]*';
320
+
321
+ return `${prefix}(?=$|\\/$)`
322
+ }
323
+ ],
324
+ ];
325
+
326
+ // A simple cache, because an ignore rule only has only one certain meaning
327
+ const regexCache = Object.create(null);
328
+
329
+ // @param {pattern}
330
+ const makeRegex = (pattern, ignoreCase) => {
331
+ let source = regexCache[pattern];
332
+
333
+ if (!source) {
334
+ source = REPLACERS.reduce(
335
+ (prev, [matcher, replacer]) =>
336
+ prev.replace(matcher, replacer.bind(pattern)),
337
+ pattern
338
+ );
339
+ regexCache[pattern] = source;
340
+ }
341
+
342
+ return ignoreCase
343
+ ? new RegExp(source, 'i')
344
+ : new RegExp(source)
345
+ };
346
+
347
+ const isString = subject => typeof subject === 'string';
348
+
349
+ // > A blank line matches no files, so it can serve as a separator for readability.
350
+ const checkPattern = pattern => pattern
351
+ && isString(pattern)
352
+ && !REGEX_TEST_BLANK_LINE.test(pattern)
353
+ && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)
354
+
355
+ // > A line starting with # serves as a comment.
356
+ && pattern.indexOf('#') !== 0;
357
+
358
+ const splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF);
359
+
360
+ class IgnoreRule {
361
+ constructor (
362
+ origin,
363
+ pattern,
364
+ negative,
365
+ regex
366
+ ) {
367
+ this.origin = origin;
368
+ this.pattern = pattern;
369
+ this.negative = negative;
370
+ this.regex = regex;
371
+ }
372
+ }
373
+
374
+ const createRule = (pattern, ignoreCase) => {
375
+ const origin = pattern;
376
+ let negative = false;
377
+
378
+ // > An optional prefix "!" which negates the pattern;
379
+ if (pattern.indexOf('!') === 0) {
380
+ negative = true;
381
+ pattern = pattern.substr(1);
382
+ }
383
+
384
+ pattern = pattern
385
+ // > Put a backslash ("\") in front of the first "!" for patterns that
386
+ // > begin with a literal "!", for example, `"\!important!.txt"`.
387
+ .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')
388
+ // > Put a backslash ("\") in front of the first hash for patterns that
389
+ // > begin with a hash.
390
+ .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#');
391
+
392
+ const regex = makeRegex(pattern, ignoreCase);
393
+
394
+ return new IgnoreRule(
395
+ origin,
396
+ pattern,
397
+ negative,
398
+ regex
399
+ )
400
+ };
401
+
402
+ const throwError = (message, Ctor) => {
403
+ throw new Ctor(message)
404
+ };
405
+
406
+ const checkPath = (path, originalPath, doThrow) => {
407
+ if (!isString(path)) {
408
+ return doThrow(
409
+ `path must be a string, but got \`${originalPath}\``,
410
+ TypeError
411
+ )
412
+ }
413
+
414
+ // We don't know if we should ignore EMPTY, so throw
415
+ if (!path) {
416
+ return doThrow(`path must not be empty`, TypeError)
417
+ }
418
+
419
+ // Check if it is a relative path
420
+ if (checkPath.isNotRelative(path)) {
421
+ const r = '`path.relative()`d';
422
+ return doThrow(
423
+ `path should be a ${r} string, but got "${originalPath}"`,
424
+ RangeError
425
+ )
426
+ }
427
+
428
+ return true
429
+ };
430
+
431
+ const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path);
432
+
433
+ checkPath.isNotRelative = isNotRelative;
434
+ checkPath.convert = p => p;
435
+
436
+ class Ignore {
437
+ constructor ({
438
+ ignorecase = true,
439
+ ignoreCase = ignorecase,
440
+ allowRelativePaths = false
441
+ } = {}) {
442
+ define(this, KEY_IGNORE, true);
443
+
444
+ this._rules = [];
445
+ this._ignoreCase = ignoreCase;
446
+ this._allowRelativePaths = allowRelativePaths;
447
+ this._initCache();
448
+ }
449
+
450
+ _initCache () {
451
+ this._ignoreCache = Object.create(null);
452
+ this._testCache = Object.create(null);
453
+ }
454
+
455
+ _addPattern (pattern) {
456
+ // #32
457
+ if (pattern && pattern[KEY_IGNORE]) {
458
+ this._rules = this._rules.concat(pattern._rules);
459
+ this._added = true;
460
+ return
461
+ }
462
+
463
+ if (checkPattern(pattern)) {
464
+ const rule = createRule(pattern, this._ignoreCase);
465
+ this._added = true;
466
+ this._rules.push(rule);
467
+ }
468
+ }
469
+
470
+ // @param {Array<string> | string | Ignore} pattern
471
+ add (pattern) {
472
+ this._added = false;
473
+
474
+ makeArray(
475
+ isString(pattern)
476
+ ? splitPattern(pattern)
477
+ : pattern
478
+ ).forEach(this._addPattern, this);
479
+
480
+ // Some rules have just added to the ignore,
481
+ // making the behavior changed.
482
+ if (this._added) {
483
+ this._initCache();
484
+ }
485
+
486
+ return this
487
+ }
488
+
489
+ // legacy
490
+ addPattern (pattern) {
491
+ return this.add(pattern)
492
+ }
493
+
494
+ // | ignored : unignored
495
+ // negative | 0:0 | 0:1 | 1:0 | 1:1
496
+ // -------- | ------- | ------- | ------- | --------
497
+ // 0 | TEST | TEST | SKIP | X
498
+ // 1 | TESTIF | SKIP | TEST | X
499
+
500
+ // - SKIP: always skip
501
+ // - TEST: always test
502
+ // - TESTIF: only test if checkUnignored
503
+ // - X: that never happen
504
+
505
+ // @param {boolean} whether should check if the path is unignored,
506
+ // setting `checkUnignored` to `false` could reduce additional
507
+ // path matching.
508
+
509
+ // @returns {TestResult} true if a file is ignored
510
+ _testOne (path, checkUnignored) {
511
+ let ignored = false;
512
+ let unignored = false;
513
+
514
+ this._rules.forEach(rule => {
515
+ const {negative} = rule;
516
+ if (
517
+ unignored === negative && ignored !== unignored
518
+ || negative && !ignored && !unignored && !checkUnignored
519
+ ) {
520
+ return
521
+ }
522
+
523
+ const matched = rule.regex.test(path);
524
+
525
+ if (matched) {
526
+ ignored = !negative;
527
+ unignored = negative;
528
+ }
529
+ });
530
+
531
+ return {
532
+ ignored,
533
+ unignored
534
+ }
535
+ }
536
+
537
+ // @returns {TestResult}
538
+ _test (originalPath, cache, checkUnignored, slices) {
539
+ const path = originalPath
540
+ // Supports nullable path
541
+ && checkPath.convert(originalPath);
542
+
543
+ checkPath(
544
+ path,
545
+ originalPath,
546
+ this._allowRelativePaths
547
+ ? RETURN_FALSE
548
+ : throwError
549
+ );
550
+
551
+ return this._t(path, cache, checkUnignored, slices)
552
+ }
553
+
554
+ _t (path, cache, checkUnignored, slices) {
555
+ if (path in cache) {
556
+ return cache[path]
557
+ }
558
+
559
+ if (!slices) {
560
+ // path/to/a.js
561
+ // ['path', 'to', 'a.js']
562
+ slices = path.split(SLASH);
563
+ }
564
+
565
+ slices.pop();
566
+
567
+ // If the path has no parent directory, just test it
568
+ if (!slices.length) {
569
+ return cache[path] = this._testOne(path, checkUnignored)
570
+ }
571
+
572
+ const parent = this._t(
573
+ slices.join(SLASH) + SLASH,
574
+ cache,
575
+ checkUnignored,
576
+ slices
577
+ );
578
+
579
+ // If the path contains a parent directory, check the parent first
580
+ return cache[path] = parent.ignored
581
+ // > It is not possible to re-include a file if a parent directory of
582
+ // > that file is excluded.
583
+ ? parent
584
+ : this._testOne(path, checkUnignored)
585
+ }
586
+
587
+ ignores (path) {
588
+ return this._test(path, this._ignoreCache, false).ignored
589
+ }
590
+
591
+ createFilter () {
592
+ return path => !this.ignores(path)
593
+ }
594
+
595
+ filter (paths) {
596
+ return makeArray(paths).filter(this.createFilter())
597
+ }
598
+
599
+ // @returns {TestResult}
600
+ test (path) {
601
+ return this._test(path, this._testCache, true)
602
+ }
603
+ }
604
+
605
+ const factory = options => new Ignore(options);
606
+
607
+ const isPathValid = path =>
608
+ checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
609
+
610
+ factory.isPathValid = isPathValid;
611
+
612
+ // Fixes typescript
613
+ factory.default = factory;
614
+
615
+ ignore = factory;
616
+
617
+ // Windows
618
+ // --------------------------------------------------------------
619
+ /* istanbul ignore if */
620
+ if (
621
+ // Detect `process` so that it can run in browsers.
622
+ typeof process !== 'undefined'
623
+ && (
624
+ process.env && process.env.IGNORE_TEST_WIN32
625
+ || process.platform === 'win32'
626
+ )
627
+ ) {
628
+ /* eslint no-control-regex: "off" */
629
+ const makePosix = str => /^\\\\\?\\/.test(str)
630
+ || /["<>|\u0000-\u001F]+/u.test(str)
631
+ ? str
632
+ : str.replace(/\\/g, '/');
633
+
634
+ checkPath.convert = makePosix;
635
+
636
+ // 'C:\\foo' <- 'C:\\foo' has been converted to 'C:/'
637
+ // 'd:\\foo'
638
+ const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
639
+ checkPath.isNotRelative = path =>
640
+ REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path)
641
+ || isNotRelative(path);
642
+ }
643
+ return ignore;
644
+ }
645
+
646
+ export { requireIgnore as r };