immosquare-cleaner 0.1.46 → 0.1.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/immosquare-cleaner/version.rb +1 -1
- data/linters/rubocop-3.3.4.yml +2 -0
- data/linters/rubocop.yml +2 -0
- data/node_modules/@eslint/eslintrc/node_modules/ignore/LICENSE-MIT +21 -0
- data/node_modules/@eslint/eslintrc/node_modules/ignore/README.md +412 -0
- data/node_modules/@eslint/eslintrc/node_modules/ignore/index.d.ts +61 -0
- data/node_modules/@eslint/eslintrc/node_modules/ignore/index.js +618 -0
- data/node_modules/@eslint/eslintrc/node_modules/ignore/legacy.js +539 -0
- data/node_modules/@eslint/eslintrc/node_modules/ignore/package.json +73 -0
- data/node_modules/@eslint/js/package.json +1 -1
- data/node_modules/@eslint/plugin-kit/LICENSE +201 -0
- data/node_modules/@eslint/plugin-kit/README.md +224 -0
- data/node_modules/@eslint/plugin-kit/dist/cjs/index.cjs +555 -0
- data/node_modules/@eslint/plugin-kit/dist/cjs/index.d.cts +239 -0
- data/node_modules/@eslint/plugin-kit/dist/cjs/types.ts +7 -0
- data/node_modules/@eslint/plugin-kit/dist/esm/index.d.ts +239 -0
- data/node_modules/@eslint/plugin-kit/dist/esm/index.js +551 -0
- data/node_modules/@eslint/plugin-kit/dist/esm/types.d.ts +6 -0
- data/node_modules/@eslint/plugin-kit/dist/esm/types.ts +7 -0
- data/node_modules/@eslint/plugin-kit/package.json +62 -0
- data/node_modules/eslint/README.md +2 -2
- data/node_modules/eslint/lib/config/config.js +278 -0
- data/node_modules/eslint/lib/config/flat-config-array.js +3 -204
- data/node_modules/eslint/lib/languages/js/source-code/source-code.js +29 -94
- data/node_modules/eslint/lib/linter/apply-disable-directives.js +17 -28
- data/node_modules/eslint/lib/linter/file-context.js +134 -0
- data/node_modules/eslint/lib/linter/linter.js +37 -42
- data/node_modules/eslint/lib/rules/id-length.js +1 -0
- data/node_modules/eslint/lib/rules/no-invalid-regexp.js +34 -18
- data/node_modules/eslint/lib/rules/require-unicode-regexp.js +95 -14
- data/node_modules/eslint/lib/rules/utils/regular-expressions.js +11 -3
- data/node_modules/eslint/lib/types/index.d.ts +1635 -0
- data/node_modules/eslint/lib/types/rules/best-practices.d.ts +1075 -0
- data/node_modules/eslint/lib/types/rules/deprecated.d.ts +294 -0
- data/node_modules/eslint/lib/types/rules/ecmascript-6.d.ts +561 -0
- data/node_modules/eslint/lib/types/rules/index.d.ts +50 -0
- data/node_modules/eslint/lib/types/rules/node-commonjs.d.ts +160 -0
- data/node_modules/eslint/lib/types/rules/possible-errors.d.ts +598 -0
- data/node_modules/eslint/lib/types/rules/strict-mode.d.ts +38 -0
- data/node_modules/eslint/lib/types/rules/stylistic-issues.d.ts +1932 -0
- data/node_modules/eslint/lib/types/rules/variables.d.ts +221 -0
- data/node_modules/eslint/lib/types/use-at-your-own-risk.d.ts +85 -0
- data/node_modules/eslint/package.json +20 -8
- data/node_modules/ignore/index.d.ts +1 -1
- data/node_modules/ignore/index.js +25 -7
- data/node_modules/ignore/legacy.js +34 -14
- data/node_modules/ignore/package.json +12 -11
- data/node_modules/npm-check-updates/build/index.js +282 -282
- data/node_modules/npm-check-updates/build/index.js.map +1 -1
- data/node_modules/npm-check-updates/package.json +1 -1
- data/package.json +3 -3
- metadata +31 -4
- data/linters/rubocop-2.7.6.yml +0 -88
- data/node_modules/eslint/lib/linter/config-comment-parser.js +0 -169
@@ -0,0 +1,221 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview This file contains the rule types for ESLint. It was initially extracted
|
3
|
+
* from the `@types/eslint` package.
|
4
|
+
*/
|
5
|
+
|
6
|
+
/*
|
7
|
+
* MIT License
|
8
|
+
* Copyright (c) Microsoft Corporation.
|
9
|
+
*
|
10
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
+
* of this software and associated documentation files (the "Software"), to deal
|
12
|
+
* in the Software without restriction, including without limitation the rights
|
13
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
+
* copies of the Software, and to permit persons to whom the Software is
|
15
|
+
* furnished to do so, subject to the following conditions:
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
17
|
+
* copies or substantial portions of the Software.
|
18
|
+
*
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
25
|
+
* SOFTWARE
|
26
|
+
*/
|
27
|
+
|
28
|
+
import { Linter } from "../index";
|
29
|
+
|
30
|
+
export interface Variables extends Linter.RulesRecord {
|
31
|
+
/**
|
32
|
+
* Rule to require or disallow initialization in variable declarations.
|
33
|
+
*
|
34
|
+
* @since 1.0.0-rc-1
|
35
|
+
* @see https://eslint.org/docs/rules/init-declarations
|
36
|
+
*/
|
37
|
+
"init-declarations":
|
38
|
+
| Linter.RuleEntry<["always"]>
|
39
|
+
| Linter.RuleEntry<
|
40
|
+
[
|
41
|
+
"never",
|
42
|
+
Partial<{
|
43
|
+
ignoreForLoopInit: boolean;
|
44
|
+
}>,
|
45
|
+
]
|
46
|
+
>;
|
47
|
+
|
48
|
+
/**
|
49
|
+
* Rule to disallow deleting variables.
|
50
|
+
*
|
51
|
+
* @remarks
|
52
|
+
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
53
|
+
*
|
54
|
+
* @since 0.0.9
|
55
|
+
* @see https://eslint.org/docs/rules/no-delete-var
|
56
|
+
*/
|
57
|
+
"no-delete-var": Linter.RuleEntry<[]>;
|
58
|
+
|
59
|
+
/**
|
60
|
+
* Rule to disallow labels that share a name with a variable.
|
61
|
+
*
|
62
|
+
* @since 0.0.9
|
63
|
+
* @see https://eslint.org/docs/rules/no-label-var
|
64
|
+
*/
|
65
|
+
"no-label-var": Linter.RuleEntry<[]>;
|
66
|
+
|
67
|
+
/**
|
68
|
+
* Rule to disallow specified global variables.
|
69
|
+
*
|
70
|
+
* @since 2.3.0
|
71
|
+
* @see https://eslint.org/docs/rules/no-restricted-globals
|
72
|
+
*/
|
73
|
+
"no-restricted-globals": Linter.RuleEntry<
|
74
|
+
[
|
75
|
+
...Array<
|
76
|
+
| string
|
77
|
+
| {
|
78
|
+
name: string;
|
79
|
+
message?: string | undefined;
|
80
|
+
}
|
81
|
+
>,
|
82
|
+
]
|
83
|
+
>;
|
84
|
+
|
85
|
+
/**
|
86
|
+
* Rule to disallow variable declarations from shadowing variables declared in the outer scope.
|
87
|
+
*
|
88
|
+
* @since 0.0.9
|
89
|
+
* @see https://eslint.org/docs/rules/no-shadow
|
90
|
+
*/
|
91
|
+
"no-shadow": Linter.RuleEntry<
|
92
|
+
[
|
93
|
+
Partial<{
|
94
|
+
/**
|
95
|
+
* @default false
|
96
|
+
*/
|
97
|
+
builtinGlobals: boolean;
|
98
|
+
/**
|
99
|
+
* @default 'functions'
|
100
|
+
*/
|
101
|
+
hoist: "functions" | "all" | "never";
|
102
|
+
allow: string[];
|
103
|
+
}>,
|
104
|
+
]
|
105
|
+
>;
|
106
|
+
|
107
|
+
/**
|
108
|
+
* Rule to disallow identifiers from shadowing restricted names.
|
109
|
+
*
|
110
|
+
* @remarks
|
111
|
+
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
112
|
+
*
|
113
|
+
* @since 0.1.4
|
114
|
+
* @see https://eslint.org/docs/rules/no-shadow-restricted-names
|
115
|
+
*/
|
116
|
+
"no-shadow-restricted-names": Linter.RuleEntry<[]>;
|
117
|
+
|
118
|
+
/**
|
119
|
+
* Rule to disallow the use of undeclared variables unless mentioned in `global` comments.
|
120
|
+
*
|
121
|
+
* @remarks
|
122
|
+
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
123
|
+
*
|
124
|
+
* @since 0.0.9
|
125
|
+
* @see https://eslint.org/docs/rules/no-undef
|
126
|
+
*/
|
127
|
+
"no-undef": Linter.RuleEntry<
|
128
|
+
[
|
129
|
+
Partial<{
|
130
|
+
/**
|
131
|
+
* @default false
|
132
|
+
*/
|
133
|
+
typeof: boolean;
|
134
|
+
}>,
|
135
|
+
]
|
136
|
+
>;
|
137
|
+
|
138
|
+
/**
|
139
|
+
* Rule to disallow initializing variables to `undefined`.
|
140
|
+
*
|
141
|
+
* @since 0.0.6
|
142
|
+
* @see https://eslint.org/docs/rules/no-undef-init
|
143
|
+
*/
|
144
|
+
"no-undef-init": Linter.RuleEntry<[]>;
|
145
|
+
|
146
|
+
/**
|
147
|
+
* Rule to disallow the use of `undefined` as an identifier.
|
148
|
+
*
|
149
|
+
* @since 0.7.1
|
150
|
+
* @see https://eslint.org/docs/rules/no-undefined
|
151
|
+
*/
|
152
|
+
"no-undefined": Linter.RuleEntry<[]>;
|
153
|
+
|
154
|
+
/**
|
155
|
+
* Rule to disallow unused variables.
|
156
|
+
*
|
157
|
+
* @remarks
|
158
|
+
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
|
159
|
+
*
|
160
|
+
* @since 0.0.9
|
161
|
+
* @see https://eslint.org/docs/rules/no-unused-vars
|
162
|
+
*/
|
163
|
+
"no-unused-vars": Linter.RuleEntry<
|
164
|
+
[
|
165
|
+
| "all"
|
166
|
+
| "local"
|
167
|
+
| Partial<{
|
168
|
+
/**
|
169
|
+
* @default 'all'
|
170
|
+
*/
|
171
|
+
vars: "all" | "local";
|
172
|
+
varsIgnorePattern: string;
|
173
|
+
/**
|
174
|
+
* @default 'after-used'
|
175
|
+
*/
|
176
|
+
args: "after-used" | "all" | "none";
|
177
|
+
/**
|
178
|
+
* @default false
|
179
|
+
*/
|
180
|
+
ignoreRestSiblings: boolean;
|
181
|
+
argsIgnorePattern: string;
|
182
|
+
/**
|
183
|
+
* @default 'none'
|
184
|
+
*/
|
185
|
+
caughtErrors: "none" | "all";
|
186
|
+
caughtErrorsIgnorePattern: string;
|
187
|
+
destructuredArrayIgnorePattern: string;
|
188
|
+
}>,
|
189
|
+
]
|
190
|
+
>;
|
191
|
+
|
192
|
+
/**
|
193
|
+
* Rule to disallow the use of variables before they are defined.
|
194
|
+
*
|
195
|
+
* @since 0.0.9
|
196
|
+
* @see https://eslint.org/docs/rules/no-use-before-define
|
197
|
+
*/
|
198
|
+
"no-use-before-define": Linter.RuleEntry<
|
199
|
+
[
|
200
|
+
| Partial<{
|
201
|
+
/**
|
202
|
+
* @default true
|
203
|
+
*/
|
204
|
+
functions: boolean;
|
205
|
+
/**
|
206
|
+
* @default true
|
207
|
+
*/
|
208
|
+
classes: boolean;
|
209
|
+
/**
|
210
|
+
* @default true
|
211
|
+
*/
|
212
|
+
variables: boolean;
|
213
|
+
/**
|
214
|
+
* @default false
|
215
|
+
*/
|
216
|
+
allowNamedExports: boolean;
|
217
|
+
}>
|
218
|
+
| "nofunc",
|
219
|
+
]
|
220
|
+
>;
|
221
|
+
}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
/**
|
2
|
+
* @fileoverview This file contains the types for the use-at-your-own-risk
|
3
|
+
* entrypoint. It was initially extracted from the `@types/eslint` package.
|
4
|
+
*/
|
5
|
+
|
6
|
+
/*
|
7
|
+
* MIT License
|
8
|
+
* Copyright (c) Microsoft Corporation.
|
9
|
+
*
|
10
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
11
|
+
* of this software and associated documentation files (the "Software"), to deal
|
12
|
+
* in the Software without restriction, including without limitation the rights
|
13
|
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
14
|
+
* copies of the Software, and to permit persons to whom the Software is
|
15
|
+
* furnished to do so, subject to the following conditions:
|
16
|
+
* The above copyright notice and this permission notice shall be included in all
|
17
|
+
* copies or substantial portions of the Software.
|
18
|
+
*
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
20
|
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
21
|
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
22
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
23
|
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
24
|
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
25
|
+
* SOFTWARE
|
26
|
+
*/
|
27
|
+
|
28
|
+
|
29
|
+
import { ESLint, Rule } from "./index.js";
|
30
|
+
|
31
|
+
/** @deprecated */
|
32
|
+
export const builtinRules: Map<string, Rule.RuleModule>;
|
33
|
+
|
34
|
+
/** @deprecated */
|
35
|
+
export class FileEnumerator {
|
36
|
+
constructor(
|
37
|
+
params?: {
|
38
|
+
cwd?: string;
|
39
|
+
configArrayFactory?: any;
|
40
|
+
extensions?: any;
|
41
|
+
globInputPaths?: boolean;
|
42
|
+
errorOnUnmatchedPattern?: boolean;
|
43
|
+
ignore?: boolean;
|
44
|
+
},
|
45
|
+
);
|
46
|
+
isTargetPath(filePath: string, providedConfig?: any): boolean;
|
47
|
+
iterateFiles(
|
48
|
+
patternOrPatterns: string | string[],
|
49
|
+
): IterableIterator<{ config: any; filePath: string; ignored: boolean }>;
|
50
|
+
}
|
51
|
+
|
52
|
+
export { /** @deprecated */ ESLint as FlatESLint };
|
53
|
+
|
54
|
+
/** @deprecated */
|
55
|
+
export class LegacyESLint {
|
56
|
+
static configType: "eslintrc";
|
57
|
+
|
58
|
+
static readonly version: string;
|
59
|
+
|
60
|
+
static outputFixes(results: ESLint.LintResult[]): Promise<void>;
|
61
|
+
|
62
|
+
static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[];
|
63
|
+
|
64
|
+
constructor(options?: ESLint.LegacyOptions);
|
65
|
+
|
66
|
+
lintFiles(patterns: string | string[]): Promise<ESLint.LintResult[]>;
|
67
|
+
|
68
|
+
lintText(
|
69
|
+
code: string,
|
70
|
+
options?: { filePath?: string | undefined; warnIgnored?: boolean | undefined },
|
71
|
+
): Promise<ESLint.LintResult[]>;
|
72
|
+
|
73
|
+
getRulesMetaForResults(results: ESLint.LintResult[]): ESLint.LintResultData["rulesMeta"];
|
74
|
+
|
75
|
+
hasFlag(flag: string): false;
|
76
|
+
|
77
|
+
calculateConfigForFile(filePath: string): Promise<any>;
|
78
|
+
|
79
|
+
isPathIgnored(filePath: string): Promise<boolean>;
|
80
|
+
|
81
|
+
loadFormatter(nameOrPath?: string): Promise<ESLint.Formatter>;
|
82
|
+
}
|
83
|
+
|
84
|
+
/** @deprecated */
|
85
|
+
export function shouldUseFlatConfig(): Promise<boolean>;
|
@@ -1,16 +1,26 @@
|
|
1
1
|
{
|
2
2
|
"name": "eslint",
|
3
|
-
"version": "9.
|
3
|
+
"version": "9.10.0",
|
4
4
|
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
|
5
5
|
"description": "An AST-based pattern checker for JavaScript.",
|
6
6
|
"bin": {
|
7
7
|
"eslint": "./bin/eslint.js"
|
8
8
|
},
|
9
9
|
"main": "./lib/api.js",
|
10
|
+
"types": "./lib/types/index.d.ts",
|
10
11
|
"exports": {
|
12
|
+
".": {
|
13
|
+
"types": "./lib/types/index.d.ts",
|
14
|
+
"default": "./lib/api.js"
|
15
|
+
},
|
11
16
|
"./package.json": "./package.json",
|
12
|
-
"
|
13
|
-
|
17
|
+
"./use-at-your-own-risk": {
|
18
|
+
"types": "./lib/types/use-at-your-own-risk.d.ts",
|
19
|
+
"default": "./lib/unsupported-api.js"
|
20
|
+
},
|
21
|
+
"./rules": {
|
22
|
+
"types": "./lib/types/rules/index.d.ts"
|
23
|
+
}
|
14
24
|
},
|
15
25
|
"scripts": {
|
16
26
|
"build:docs:update-links": "node tools/fetch-docs-links.js",
|
@@ -34,7 +44,8 @@
|
|
34
44
|
"test:cli": "mocha",
|
35
45
|
"test:fuzz": "node Makefile.js fuzz",
|
36
46
|
"test:performance": "node Makefile.js perf",
|
37
|
-
"test:emfile": "node tools/check-emfile-handling.js"
|
47
|
+
"test:emfile": "node tools/check-emfile-handling.js",
|
48
|
+
"test:types": "tsc -p tests/lib/types/tsconfig.json"
|
38
49
|
},
|
39
50
|
"gitHooks": {
|
40
51
|
"pre-commit": "lint-staged"
|
@@ -70,7 +81,8 @@
|
|
70
81
|
"@eslint-community/regexpp": "^4.11.0",
|
71
82
|
"@eslint/config-array": "^0.18.0",
|
72
83
|
"@eslint/eslintrc": "^3.1.0",
|
73
|
-
"@eslint/js": "9.
|
84
|
+
"@eslint/js": "9.10.0",
|
85
|
+
"@eslint/plugin-kit": "^0.1.0",
|
74
86
|
"@humanwhocodes/module-importer": "^1.0.1",
|
75
87
|
"@humanwhocodes/retry": "^0.3.0",
|
76
88
|
"@nodelib/fs.walk": "^1.2.8",
|
@@ -93,7 +105,6 @@
|
|
93
105
|
"is-glob": "^4.0.0",
|
94
106
|
"is-path-inside": "^3.0.3",
|
95
107
|
"json-stable-stringify-without-jsonify": "^1.0.1",
|
96
|
-
"levn": "^0.4.1",
|
97
108
|
"lodash.merge": "^4.6.2",
|
98
109
|
"minimatch": "^3.1.2",
|
99
110
|
"natural-compare": "^1.4.0",
|
@@ -104,10 +115,11 @@
|
|
104
115
|
"devDependencies": {
|
105
116
|
"@babel/core": "^7.4.3",
|
106
117
|
"@babel/preset-env": "^7.4.3",
|
107
|
-
"@eslint/core": "^0.
|
108
|
-
"@eslint/json": "^0.
|
118
|
+
"@eslint/core": "^0.5.0",
|
119
|
+
"@eslint/json": "^0.4.0",
|
109
120
|
"@trunkio/launcher": "^1.3.0",
|
110
121
|
"@types/estree": "^1.0.5",
|
122
|
+
"@types/json-schema": "^7.0.15",
|
111
123
|
"@types/node": "^20.11.5",
|
112
124
|
"@wdio/browser-runner": "^9.0.5",
|
113
125
|
"@wdio/cli": "^9.0.5",
|
@@ -67,21 +67,38 @@ const cleanRangeBackSlash = slashes => {
|
|
67
67
|
// '`foo/`' should not continue with the '`..`'
|
68
68
|
const REPLACERS = [
|
69
69
|
|
70
|
+
[
|
71
|
+
// remove BOM
|
72
|
+
// TODO:
|
73
|
+
// Other similar zero-width characters?
|
74
|
+
/^\uFEFF/,
|
75
|
+
() => EMPTY
|
76
|
+
],
|
77
|
+
|
70
78
|
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
|
71
79
|
[
|
72
80
|
// (a\ ) -> (a )
|
73
81
|
// (a ) -> (a)
|
82
|
+
// (a ) -> (a)
|
74
83
|
// (a \ ) -> (a )
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
84
|
+
/((?:\\\\)*?)(\\?\s+)$/,
|
85
|
+
(_, m1, m2) => m1 + (
|
86
|
+
m2.indexOf('\\') === 0
|
87
|
+
? SPACE
|
88
|
+
: EMPTY
|
89
|
+
)
|
79
90
|
],
|
80
91
|
|
81
92
|
// replace (\ ) with ' '
|
93
|
+
// (\ ) -> ' '
|
94
|
+
// (\\ ) -> '\\ '
|
95
|
+
// (\\\ ) -> '\\ '
|
82
96
|
[
|
83
|
-
|
84
|
-
() =>
|
97
|
+
/(\\+?)\s/g,
|
98
|
+
(_, m1) => {
|
99
|
+
const {length} = m1
|
100
|
+
return m1.slice(0, length - length % 2) + SPACE
|
101
|
+
}
|
85
102
|
],
|
86
103
|
|
87
104
|
// Escape metacharacters
|
@@ -309,7 +326,8 @@ const makeRegex = (pattern, ignoreCase) => {
|
|
309
326
|
|
310
327
|
if (!source) {
|
311
328
|
source = REPLACERS.reduce(
|
312
|
-
(prev,
|
329
|
+
(prev, [matcher, replacer]) =>
|
330
|
+
prev.replace(matcher, replacer.bind(pattern)),
|
313
331
|
pattern
|
314
332
|
)
|
315
333
|
regexCache[pattern] = source
|
@@ -6,6 +6,12 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
6
6
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
7
7
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
8
8
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
9
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
10
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
11
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
12
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
13
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
14
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
9
15
|
// A simple implementation of make-array
|
10
16
|
function makeArray(subject) {
|
11
17
|
return Array.isArray(subject) ? subject : [subject];
|
@@ -71,18 +77,29 @@ var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) {
|
|
71
77
|
// you could use option `mark: true` with `glob`
|
72
78
|
|
73
79
|
// '`foo/`' should not continue with the '`..`'
|
74
|
-
var REPLACERS = [
|
80
|
+
var REPLACERS = [[
|
81
|
+
// remove BOM
|
82
|
+
// TODO:
|
83
|
+
// Other similar zero-width characters?
|
84
|
+
/^\uFEFF/, function () {
|
85
|
+
return EMPTY;
|
86
|
+
}],
|
75
87
|
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
|
76
88
|
[
|
77
89
|
// (a\ ) -> (a )
|
78
90
|
// (a ) -> (a)
|
91
|
+
// (a ) -> (a)
|
79
92
|
// (a \ ) -> (a )
|
80
|
-
|
81
|
-
return
|
93
|
+
/((?:\\\\)*?)(\\?\s+)$/, function (_, m1, m2) {
|
94
|
+
return m1 + (m2.indexOf('\\') === 0 ? SPACE : EMPTY);
|
82
95
|
}],
|
83
96
|
// replace (\ ) with ' '
|
84
|
-
|
85
|
-
|
97
|
+
// (\ ) -> ' '
|
98
|
+
// (\\ ) -> '\\ '
|
99
|
+
// (\\\ ) -> '\\ '
|
100
|
+
[/(\\+?)\s/g, function (_, m1) {
|
101
|
+
var length = m1.length;
|
102
|
+
return m1.slice(0, length - length % 2) + SPACE;
|
86
103
|
}],
|
87
104
|
// Escape metacharacters
|
88
105
|
// which is written down by users but means special for regular expressions.
|
@@ -271,8 +288,11 @@ var regexCache = Object.create(null);
|
|
271
288
|
var makeRegex = function makeRegex(pattern, ignoreCase) {
|
272
289
|
var source = regexCache[pattern];
|
273
290
|
if (!source) {
|
274
|
-
source = REPLACERS.reduce(function (prev,
|
275
|
-
|
291
|
+
source = REPLACERS.reduce(function (prev, _ref) {
|
292
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
293
|
+
matcher = _ref2[0],
|
294
|
+
replacer = _ref2[1];
|
295
|
+
return prev.replace(matcher, replacer.bind(pattern));
|
276
296
|
}, pattern);
|
277
297
|
regexCache[pattern] = source;
|
278
298
|
}
|
@@ -347,13 +367,13 @@ checkPath.convert = function (p) {
|
|
347
367
|
};
|
348
368
|
var Ignore = /*#__PURE__*/function () {
|
349
369
|
function Ignore() {
|
350
|
-
var
|
351
|
-
|
352
|
-
ignorecase =
|
353
|
-
|
354
|
-
ignoreCase =
|
355
|
-
|
356
|
-
allowRelativePaths =
|
370
|
+
var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
371
|
+
_ref3$ignorecase = _ref3.ignorecase,
|
372
|
+
ignorecase = _ref3$ignorecase === void 0 ? true : _ref3$ignorecase,
|
373
|
+
_ref3$ignoreCase = _ref3.ignoreCase,
|
374
|
+
ignoreCase = _ref3$ignoreCase === void 0 ? ignorecase : _ref3$ignoreCase,
|
375
|
+
_ref3$allowRelativePa = _ref3.allowRelativePaths,
|
376
|
+
allowRelativePaths = _ref3$allowRelativePa === void 0 ? false : _ref3$allowRelativePa;
|
357
377
|
_classCallCheck(this, Ignore);
|
358
378
|
define(this, KEY_IGNORE, true);
|
359
379
|
this._rules = [];
|
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "ignore",
|
3
|
-
"version": "5.2
|
3
|
+
"version": "5.3.2",
|
4
4
|
"description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.",
|
5
5
|
"files": [
|
6
6
|
"legacy.js",
|
@@ -17,6 +17,7 @@
|
|
17
17
|
"tap": "tap --reporter classic",
|
18
18
|
"test:git": "npm run tap test/git-check-ignore.js",
|
19
19
|
"test:ignore": "npm run tap test/ignore.js",
|
20
|
+
"test:ignore:only": "IGNORE_ONLY_IGNORES=1 npm run tap test/ignore.js",
|
20
21
|
"test:others": "npm run tap test/others.js",
|
21
22
|
"test:cases": "npm run tap test/*.js -- --coverage",
|
22
23
|
"test:no-coverage": "npm run tap test/*.js -- --no-check-coverage",
|
@@ -51,21 +52,21 @@
|
|
51
52
|
"url": "https://github.com/kaelzhang/node-ignore/issues"
|
52
53
|
},
|
53
54
|
"devDependencies": {
|
54
|
-
"@babel/cli": "^7.
|
55
|
-
"@babel/core": "^7.
|
56
|
-
"@babel/preset-env": "^7.
|
55
|
+
"@babel/cli": "^7.22.9",
|
56
|
+
"@babel/core": "^7.22.9",
|
57
|
+
"@babel/preset-env": "^7.22.9",
|
57
58
|
"codecov": "^3.8.2",
|
58
59
|
"debug": "^4.3.4",
|
59
|
-
"eslint": "^8.
|
60
|
+
"eslint": "^8.46.0",
|
60
61
|
"eslint-config-ostai": "^3.0.0",
|
61
|
-
"eslint-plugin-import": "^2.
|
62
|
-
"mkdirp": "^
|
62
|
+
"eslint-plugin-import": "^2.28.0",
|
63
|
+
"mkdirp": "^3.0.1",
|
63
64
|
"pre-suf": "^1.1.1",
|
64
|
-
"rimraf": "^
|
65
|
+
"rimraf": "^6.0.1",
|
65
66
|
"spawn-sync": "^2.0.0",
|
66
|
-
"tap": "^16.3.
|
67
|
-
"tmp": "0.2.
|
68
|
-
"typescript": "^
|
67
|
+
"tap": "^16.3.9",
|
68
|
+
"tmp": "0.2.3",
|
69
|
+
"typescript": "^5.1.6"
|
69
70
|
},
|
70
71
|
"engines": {
|
71
72
|
"node": ">= 4"
|