-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathblacklist.ts
More file actions
48 lines (43 loc) · 1.54 KB
/
blacklist.ts
File metadata and controls
48 lines (43 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
const blacklistRegexes: RegExp[] = [
/@lwc\/lwc\/no-unexpected-wire-adapter-usages/,
/@lwc\/lwc\/no-unknown-wire-adapters/,
/@typescript-eslint\/consistent-type-imports/,
/angular\/service-name/,
/ember\/no-restricted-property-modifications/,
/ember\/template-indent/,
/functional\/functional-parameters/,
/functional\/immutable-data/,
/functional\/no-conditional-statements/,
/functional\/no-expression-statements/,
/functional\/no-let/,
/functional\/no-mixed-types/,
/functional\/no-return-void/,
/functional\/no-throw-statements/,
/functional\/no-try-statements/,
/functional\/prefer-immutable-types/,
/functional\/type-declaration-immutability/,
/unused-imports\/.*-ts/,
/yml\/sort-sequence-values/,
/(?<=^|\s)arrow-parens(?=\s|$)/,
/(?<=^|\s)indent(?=\s|$)/,
/(?<=^|\s)computed-property-spacing(?=\s|$)/,
/(?<=^|\s)brace-style(?=\s|$)/,
/(?<!@stylistic\/)lines-between-class-members/,
/@typescript-eslint\/brace-style/,
/@typescript-eslint\/indent/,
/(?<=^|\s)wrap-iife(?=\s|$)/
]
const documentationBlacklistRegexes: RegExp[] = [
/@shopify\/no-debugger/
]
function testRegex (regexes: RegExp[], value: string): boolean {
return regexes.some((regex) => regex.test(value))
}
export function isBlacklisted (ruleId: string): boolean {
return testRegex(blacklistRegexes, ruleId)
}
// Removes a pattern from the documentation
// but still supports it with eslint config file
export function isBlacklistedOnlyFromDocumentation (ruleId: string): boolean {
return testRegex(documentationBlacklistRegexes, ruleId)
}