@checkdigit/eslint-plugin 4.0.0-beta.1 → 4.1.0-PR.32-b8ce
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.
- package/LICENSE.txt +1 -1
- package/README.md +6 -9
- package/SECURITY.md +14 -0
- package/dist/file-path-comment.d.ts +1 -0
- package/dist/file-path-comment.d.ts.map +1 -0
- package/dist/file-path-comment.js +1 -1
- package/dist/file-path-comment.js.map +1 -1
- package/dist/file-path-comment.spec.d.ts +1 -0
- package/dist/file-path-comment.spec.d.ts.map +1 -0
- package/dist/file-path-comment.spec.js +1 -1
- package/dist/file-path-comment.spec.js.map +1 -1
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/no-card-numbers.d.ts +1 -0
- package/dist/no-card-numbers.d.ts.map +1 -0
- package/dist/no-card-numbers.js +10 -3
- package/dist/no-card-numbers.js.map +1 -1
- package/dist/no-card-numbers.spec.d.ts +1 -0
- package/dist/no-card-numbers.spec.d.ts.map +1 -0
- package/dist/no-card-numbers.spec.js +31 -1
- package/dist/no-card-numbers.spec.js.map +1 -1
- package/dist/{pure-functions.d.ts → no-uuid.d.ts} +1 -0
- package/dist/no-uuid.d.ts.map +1 -0
- package/dist/no-uuid.js +102 -0
- package/dist/no-uuid.js.map +1 -0
- package/dist/no-uuid.spec.d.ts +2 -0
- package/dist/no-uuid.spec.d.ts.map +1 -0
- package/dist/no-uuid.spec.js +78 -0
- package/dist/no-uuid.spec.js.map +1 -0
- package/package.json +1 -67
- package/src/file-path-comment.ts +1 -1
- package/src/index.ts +5 -5
- package/src/no-card-numbers.ts +14 -4
- package/src/no-uuid.ts +109 -0
- package/.eslintrc +0 -76
- package/coverage/clover.xml +0 -94
- package/coverage/coverage-final.json +0 -4
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/file-path-comment.ts.html +0 -349
- package/coverage/lcov-report/index.html +0 -146
- package/coverage/lcov-report/no-card-numbers.ts.html +0 -508
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/pure-functions.ts.html +0 -301
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -176
- package/dist/pure-functions.js +0 -55
- package/dist/pure-functions.js.map +0 -1
- package/dist/pure-functions.spec.d.ts +0 -1
- package/dist/pure-functions.spec.js +0 -90
- package/dist/pure-functions.spec.js.map +0 -1
- package/src/file-path-comment.spec.ts +0 -71
- package/src/no-card-numbers.spec.ts +0 -114
- package/src/pure-functions.spec.ts +0 -93
- package/src/pure-functions.ts +0 -72
- package/tsconfig.json +0 -12
package/package.json
CHANGED
|
@@ -1,67 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@checkdigit/eslint-plugin",
|
|
3
|
-
"version": "4.0.0-beta.1",
|
|
4
|
-
"description": "Check Digit eslint plugins",
|
|
5
|
-
"prettier": "@checkdigit/prettier-config",
|
|
6
|
-
"main": "dist/index.js",
|
|
7
|
-
"keywords": [
|
|
8
|
-
"eslint",
|
|
9
|
-
"eslintplugin"
|
|
10
|
-
],
|
|
11
|
-
"scripts": {
|
|
12
|
-
"preversion": "npm test",
|
|
13
|
-
"postversion": "git push && git push --tags",
|
|
14
|
-
"test": "tsc --noEmit && jest && npm run prettier && npm run lint",
|
|
15
|
-
"lint": "eslint -f unix --ext .ts src/**",
|
|
16
|
-
"prettier": "prettier --list-different 'src/**/*.ts'",
|
|
17
|
-
"prettier:fix": "prettier --write 'src/**/*.ts'"
|
|
18
|
-
},
|
|
19
|
-
"engines": {
|
|
20
|
-
"node": ">=16"
|
|
21
|
-
},
|
|
22
|
-
"repository": {
|
|
23
|
-
"type": "git",
|
|
24
|
-
"url": "git+https://github.com/checkdigit/eslint-plugin.git"
|
|
25
|
-
},
|
|
26
|
-
"author": "",
|
|
27
|
-
"license": "MIT",
|
|
28
|
-
"bugs": {
|
|
29
|
-
"url": "https://github.com/checkdigit/eslint-plugin/issues"
|
|
30
|
-
},
|
|
31
|
-
"homepage": "https://github.com/checkdigit/eslint-plugin#readme",
|
|
32
|
-
"peerDependencies": {
|
|
33
|
-
"eslint": ">=8"
|
|
34
|
-
},
|
|
35
|
-
"devDependencies": {
|
|
36
|
-
"@checkdigit/prettier-config": "^1.0.2",
|
|
37
|
-
"@checkdigit/typescript-config": "^2.2.0",
|
|
38
|
-
"@types/eslint": "^8.4.2",
|
|
39
|
-
"@types/jest": "^27.5.1",
|
|
40
|
-
"@types/node": "^17.0.35",
|
|
41
|
-
"@typescript-eslint/eslint-plugin": "^5.26.0",
|
|
42
|
-
"@typescript-eslint/parser": "^5.26.0",
|
|
43
|
-
"eslint": "^8.16.0",
|
|
44
|
-
"eslint-config-prettier": "^8.5.0",
|
|
45
|
-
"eslint-plugin-deprecate": "^0.7.0",
|
|
46
|
-
"eslint-plugin-eslint-plugin": "^4.2.0",
|
|
47
|
-
"eslint-plugin-import": "^2.26.0",
|
|
48
|
-
"eslint-plugin-no-only-tests": "^2.6.0",
|
|
49
|
-
"eslint-plugin-no-secrets": "^0.8.9",
|
|
50
|
-
"eslint-plugin-node": "^11.1.0",
|
|
51
|
-
"eslint-plugin-sonarjs": "^0.13.0",
|
|
52
|
-
"jest": "^28.1.0",
|
|
53
|
-
"ts-jest": "^28.0.3"
|
|
54
|
-
},
|
|
55
|
-
"jest": {
|
|
56
|
-
"collectCoverage": true,
|
|
57
|
-
"preset": "ts-jest",
|
|
58
|
-
"testMatch": [
|
|
59
|
-
"<rootDir>/src/**/?(*.)spec.ts"
|
|
60
|
-
],
|
|
61
|
-
"testPathIgnorePatterns": [
|
|
62
|
-
"<rootDir>/build",
|
|
63
|
-
"<rootDir>/coverage",
|
|
64
|
-
"<rootDir>/node_modules"
|
|
65
|
-
]
|
|
66
|
-
}
|
|
67
|
-
}
|
|
1
|
+
{"name":"@checkdigit/eslint-plugin","version":"4.1.0-PR.32-b8ce","description":"Check Digit eslint plugins","prettier":"@checkdigit/prettier-config","main":"dist/index.js","keywords":["eslint","eslintplugin"],"engines":{"node":">=16"},"repository":{"type":"git","url":"git+https://github.com/checkdigit/eslint-plugin.git"},"author":"Check Digit, LLC","license":"MIT","bugs":{"url":"https://github.com/checkdigit/eslint-plugin/issues"},"homepage":"https://github.com/checkdigit/eslint-plugin#readme","peerDependencies":{"eslint":">=8"},"devDependencies":{"@checkdigit/jest-config":"^2.2.1","@checkdigit/prettier-config":"^3.4.0","@checkdigit/typescript-config":"^3.3.0","@types/eslint":"^8.37.0","@typescript-eslint/eslint-plugin":"^5.59.7","@typescript-eslint/parser":"^5.59.7","eslint-config-prettier":"^8.8.0","eslint-plugin-deprecate":"^0.7.0","eslint-plugin-eslint-plugin":"^5.1.0","eslint-plugin-import":"^2.27.5","eslint-plugin-no-only-tests":"^3.1.0","eslint-plugin-no-secrets":"^0.8.9","eslint-plugin-node":"^11.1.0","eslint-plugin-sonarjs":"^0.19.0"},"scripts":{"postversion":"git push && git push --tags","lint:fix":"eslint -f unix --ext .ts src --fix","lint":"eslint -f unix --ext .ts src","prettier":"prettier --ignore-path .gitignore --list-different .","prettier:fix":"prettier --ignore-path .gitignore --write .","test":"npm run ci:compile && npm run ci:test && npm run ci:lint && npm run ci:style","ci:compile":"tsc --noEmit","ci:test":"jest --coverage=false","ci:coverage":"jest --coverage=true","ci:lint":"npm run lint","ci:style":"npm run prettier"},"jest":{"preset":"@checkdigit/jest-config"},"files":["dist","SECURITY.md","/src/"]}
|
package/src/file-path-comment.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
// index.ts
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (c) 2021 Check Digit, LLC
|
|
4
|
+
* Copyright (c) 2021-2022 Check Digit, LLC
|
|
5
5
|
*
|
|
6
6
|
* This code is licensed under the MIT license (see LICENSE.txt for details).
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import filePathComment from './file-path-comment';
|
|
10
10
|
import noCardNumbers from './no-card-numbers';
|
|
11
|
-
import
|
|
11
|
+
import noUuid from './no-uuid';
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
14
|
rules: {
|
|
15
15
|
'file-path-comment': filePathComment,
|
|
16
16
|
'no-card-numbers': noCardNumbers,
|
|
17
|
-
'
|
|
17
|
+
'no-uuid': noUuid,
|
|
18
18
|
},
|
|
19
19
|
configs: {
|
|
20
20
|
all: {
|
|
21
21
|
rules: {
|
|
22
22
|
'@checkdigit/no-card-numbers': 'error',
|
|
23
23
|
'@checkdigit/file-path-comment': 'error',
|
|
24
|
-
'@checkdigit/
|
|
24
|
+
'@checkdigit/no-uuid': 'error',
|
|
25
25
|
},
|
|
26
26
|
},
|
|
27
27
|
recommended: {
|
|
28
28
|
rules: {
|
|
29
29
|
'@checkdigit/no-card-numbers': 'error',
|
|
30
30
|
'@checkdigit/file-path-comment': 'off',
|
|
31
|
-
'@checkdigit/
|
|
31
|
+
'@checkdigit/no-uuid': 'error',
|
|
32
32
|
},
|
|
33
33
|
},
|
|
34
34
|
},
|
package/src/no-card-numbers.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// no-card-numbers.ts
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
|
-
* Copyright (c) 2021 Check Digit, LLC
|
|
4
|
+
* Copyright (c) 2021-2022 Check Digit, LLC
|
|
5
5
|
*
|
|
6
6
|
* This code is licensed under the MIT license (see LICENSE.txt for details).
|
|
7
7
|
*/
|
|
@@ -49,7 +49,17 @@ function checkForCardNumbers(value: string, context: Rule.RuleContext, node?: No
|
|
|
49
49
|
if (matches === null) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
const cardNumbers = matches.filter(
|
|
52
|
+
const cardNumbers = matches.filter(
|
|
53
|
+
(match) =>
|
|
54
|
+
luhnCheck(match) &&
|
|
55
|
+
allowCardNumbers.indexOf(match) === -1 &&
|
|
56
|
+
// any 16-digit number that begins with 0-1 or 7-9 is not a valid card number
|
|
57
|
+
match[0] !== '0' &&
|
|
58
|
+
match[0] !== '1' &&
|
|
59
|
+
match[0] !== '7' &&
|
|
60
|
+
match[0] !== '8' &&
|
|
61
|
+
match[0] !== '9'
|
|
62
|
+
);
|
|
53
63
|
if (cardNumbers.length === 1) {
|
|
54
64
|
if (node !== undefined) {
|
|
55
65
|
context.report({
|
|
@@ -76,7 +86,7 @@ function checkForCardNumbers(value: string, context: Rule.RuleContext, node?: No
|
|
|
76
86
|
context.report({
|
|
77
87
|
messageId: CARD_NUMBERS_FOUND,
|
|
78
88
|
data: {
|
|
79
|
-
|
|
89
|
+
numbers: matches.join(', '),
|
|
80
90
|
},
|
|
81
91
|
node,
|
|
82
92
|
});
|
|
@@ -84,7 +94,7 @@ function checkForCardNumbers(value: string, context: Rule.RuleContext, node?: No
|
|
|
84
94
|
context.report({
|
|
85
95
|
messageId: CARD_NUMBERS_FOUND,
|
|
86
96
|
data: {
|
|
87
|
-
|
|
97
|
+
numbers: matches.join(', '),
|
|
88
98
|
},
|
|
89
99
|
loc: {
|
|
90
100
|
start: loc.start,
|
package/src/no-uuid.ts
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// no-uuid.ts
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) 2022 Check Digit, LLC
|
|
5
|
+
*
|
|
6
|
+
* This code is licensed under the MIT license (see LICENSE.txt for details).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type { Node, SourceLocation } from 'estree';
|
|
10
|
+
import type { Rule } from 'eslint';
|
|
11
|
+
|
|
12
|
+
const UUID_FOUND = 'UUID_FOUND';
|
|
13
|
+
const UUIDS_FOUND = 'UUIDS_FOUND';
|
|
14
|
+
const uuidRegex = /[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}/gmu;
|
|
15
|
+
|
|
16
|
+
function checkForUuid(value: string, context: Rule.RuleContext, node?: Node, loc?: SourceLocation) {
|
|
17
|
+
const matches = value.match(uuidRegex);
|
|
18
|
+
if (matches === null) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (matches.length === 1) {
|
|
22
|
+
if (node !== undefined) {
|
|
23
|
+
context.report({
|
|
24
|
+
messageId: UUID_FOUND,
|
|
25
|
+
data: {
|
|
26
|
+
uuid: matches[0] ?? '',
|
|
27
|
+
},
|
|
28
|
+
node,
|
|
29
|
+
});
|
|
30
|
+
} else if (loc !== undefined) {
|
|
31
|
+
context.report({
|
|
32
|
+
messageId: UUID_FOUND,
|
|
33
|
+
data: {
|
|
34
|
+
uuid: matches[0] ?? '',
|
|
35
|
+
},
|
|
36
|
+
loc: {
|
|
37
|
+
start: loc.start,
|
|
38
|
+
end: loc.end,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
} else if (matches.length > 1) {
|
|
43
|
+
if (node !== undefined) {
|
|
44
|
+
context.report({
|
|
45
|
+
messageId: UUIDS_FOUND,
|
|
46
|
+
data: {
|
|
47
|
+
uuids: matches.join(', '),
|
|
48
|
+
},
|
|
49
|
+
node,
|
|
50
|
+
});
|
|
51
|
+
} else if (loc !== undefined) {
|
|
52
|
+
context.report({
|
|
53
|
+
messageId: UUIDS_FOUND,
|
|
54
|
+
data: {
|
|
55
|
+
uuids: matches.join(', '),
|
|
56
|
+
},
|
|
57
|
+
loc: {
|
|
58
|
+
start: loc.start,
|
|
59
|
+
end: loc.end,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default {
|
|
67
|
+
meta: {
|
|
68
|
+
type: 'problem',
|
|
69
|
+
docs: {
|
|
70
|
+
description: 'Detects if a string literal contains a UUID',
|
|
71
|
+
url: 'https://github.com/checkdigit/eslint-plugin',
|
|
72
|
+
},
|
|
73
|
+
messages: {
|
|
74
|
+
[UUID_FOUND]: `UUID found: "{{ uuid }}"`,
|
|
75
|
+
[UUIDS_FOUND]: `Multiple UUIDs found: "{{ uuids }}"`,
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
create(context) {
|
|
79
|
+
const sourceCode = context.getSourceCode();
|
|
80
|
+
const comments = sourceCode.getAllComments();
|
|
81
|
+
|
|
82
|
+
comments.forEach((comment) => {
|
|
83
|
+
if (comment.loc !== undefined && comment.loc !== null) {
|
|
84
|
+
checkForUuid(comment.value, context, undefined, comment.loc);
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return {
|
|
88
|
+
Literal(node) {
|
|
89
|
+
if (node.value === undefined) {
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
if (typeof node.value !== 'string') {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
const value = `${node.value}`;
|
|
96
|
+
checkForUuid(value, context, node);
|
|
97
|
+
},
|
|
98
|
+
TemplateElement(node) {
|
|
99
|
+
if (!node.value) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (typeof node.value.cooked !== 'string') {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
checkForUuid(node.value.cooked, context, node);
|
|
106
|
+
},
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
} as Rule.RuleModule;
|
package/.eslintrc
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parser": "@typescript-eslint/parser",
|
|
3
|
-
"parserOptions": {
|
|
4
|
-
"project": "./tsconfig.json"
|
|
5
|
-
},
|
|
6
|
-
"plugins": [
|
|
7
|
-
"@typescript-eslint",
|
|
8
|
-
"sonarjs",
|
|
9
|
-
"import",
|
|
10
|
-
"no-only-tests",
|
|
11
|
-
"no-secrets",
|
|
12
|
-
"deprecate",
|
|
13
|
-
"eslint-plugin"
|
|
14
|
-
],
|
|
15
|
-
"extends": [
|
|
16
|
-
"eslint:all",
|
|
17
|
-
"plugin:@typescript-eslint/recommended",
|
|
18
|
-
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
|
19
|
-
"plugin:eslint-plugin-eslint-plugin/recommended",
|
|
20
|
-
"plugin:sonarjs/recommended",
|
|
21
|
-
"prettier"
|
|
22
|
-
],
|
|
23
|
-
"rules": {
|
|
24
|
-
"sort-keys": "off",
|
|
25
|
-
"capitalized-comments": "off",
|
|
26
|
-
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
|
27
|
-
"no-negated-condition": "off",
|
|
28
|
-
"multiline-comment-style": "off",
|
|
29
|
-
"no-magic-numbers": ["error", { "ignore": [-1, 0, 1, 2, 10, 16, 60] }],
|
|
30
|
-
"no-ternary": "off",
|
|
31
|
-
"max-params": ["error", 8],
|
|
32
|
-
"max-statements": "off",
|
|
33
|
-
"consistent-return": "off",
|
|
34
|
-
"no-undef": "off",
|
|
35
|
-
"init-declarations": "off",
|
|
36
|
-
"no-inline-comments": "off",
|
|
37
|
-
"line-comment-position": "off",
|
|
38
|
-
"prefer-destructuring": "off",
|
|
39
|
-
"no-useless-return": "off",
|
|
40
|
-
"complexity": "off",
|
|
41
|
-
"max-lines": ["error", { "max": 500, "skipBlankLines": true, "skipComments": true }],
|
|
42
|
-
"id-length": ["error", { "properties": "never", "exceptions": ["_"] }],
|
|
43
|
-
"no-plusplus": "off",
|
|
44
|
-
"default-case": "off",
|
|
45
|
-
"no-continue": "off",
|
|
46
|
-
"callback-return": ["error", ["callback", "cb"]],
|
|
47
|
-
"new-cap": ["error", { "capIsNew": false }],
|
|
48
|
-
"dot-notation": "off",
|
|
49
|
-
"no-undefined": "off",
|
|
50
|
-
"one-var": ["error", "never"],
|
|
51
|
-
"max-lines-per-function": ["error", 200],
|
|
52
|
-
"sonarjs/cognitive-complexity": ["error", 24],
|
|
53
|
-
"no-only-tests/no-only-tests": "error",
|
|
54
|
-
"curly": "error"
|
|
55
|
-
},
|
|
56
|
-
"overrides": [
|
|
57
|
-
{
|
|
58
|
-
"files": ["*.spec.ts", "*.test.ts"],
|
|
59
|
-
"rules": {
|
|
60
|
-
"no-magic-numbers": "off",
|
|
61
|
-
"no-undefined": "off",
|
|
62
|
-
"max-lines-per-function": "off",
|
|
63
|
-
"sonarjs/no-duplicate-string": "off",
|
|
64
|
-
"sonarjs/no-identical-functions": "off",
|
|
65
|
-
"sonarjs/cognitive-complexity": "off",
|
|
66
|
-
"max-lines": "off",
|
|
67
|
-
"no-await-in-loop": "off",
|
|
68
|
-
"@typescript-eslint/no-unsafe-call": "off",
|
|
69
|
-
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
70
|
-
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
71
|
-
"@typescript-eslint/no-unsafe-return": "off",
|
|
72
|
-
"@typescript-eslint/restrict-template-expressions": "off"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
]
|
|
76
|
-
}
|
package/coverage/clover.xml
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<coverage generated="1653508680277" clover="3.2.0">
|
|
3
|
-
<project timestamp="1653508680277" name="All files">
|
|
4
|
-
<metrics statements="79" coveredstatements="74" conditionals="38" coveredconditionals="33" methods="16" coveredmethods="16" elements="133" coveredelements="123" complexity="0" loc="79" ncloc="79" packages="1" files="3" classes="3"/>
|
|
5
|
-
<file name="file-path-comment.ts" path="/Users/carl/Development/eslint-plugin/src/file-path-comment.ts">
|
|
6
|
-
<metrics statements="16" coveredstatements="16" conditionals="6" coveredconditionals="6" methods="4" coveredmethods="4"/>
|
|
7
|
-
<line num="11" count="1" type="stmt"/>
|
|
8
|
-
<line num="21" count="14" type="stmt"/>
|
|
9
|
-
<line num="22" count="14" type="stmt"/>
|
|
10
|
-
<line num="24" count="14" type="cond" truecount="1" falsecount="0"/>
|
|
11
|
-
<line num="25" count="2" type="stmt"/>
|
|
12
|
-
<line num="28" count="12" type="cond" truecount="2" falsecount="0"/>
|
|
13
|
-
<line num="29" count="3" type="cond" truecount="2" falsecount="0"/>
|
|
14
|
-
<line num="30" count="1" type="stmt"/>
|
|
15
|
-
<line num="43" count="1" type="stmt"/>
|
|
16
|
-
<line num="47" count="2" type="stmt"/>
|
|
17
|
-
<line num="60" count="2" type="stmt"/>
|
|
18
|
-
<line num="65" count="9" type="stmt"/>
|
|
19
|
-
<line num="66" count="9" type="cond" truecount="1" falsecount="0"/>
|
|
20
|
-
<line num="67" count="2" type="stmt"/>
|
|
21
|
-
<line num="80" count="2" type="stmt"/>
|
|
22
|
-
<line num="86" count="12" type="stmt"/>
|
|
23
|
-
</file>
|
|
24
|
-
<file name="no-card-numbers.ts" path="/Users/carl/Development/eslint-plugin/src/no-card-numbers.ts">
|
|
25
|
-
<metrics statements="44" coveredstatements="40" conditionals="23" coveredconditionals="19" methods="9" coveredmethods="9"/>
|
|
26
|
-
<line num="12" count="1" type="stmt"/>
|
|
27
|
-
<line num="13" count="1" type="stmt"/>
|
|
28
|
-
<line num="14" count="1" type="stmt"/>
|
|
29
|
-
<line num="15" count="1" type="stmt"/>
|
|
30
|
-
<line num="26" count="18" type="stmt"/>
|
|
31
|
-
<line num="30" count="297" type="stmt"/>
|
|
32
|
-
<line num="32" count="297" type="stmt"/>
|
|
33
|
-
<line num="33" count="297" type="cond" truecount="1" falsecount="0"/>
|
|
34
|
-
<line num="34" count="145" type="stmt"/>
|
|
35
|
-
<line num="36" count="145" type="cond" truecount="1" falsecount="0"/>
|
|
36
|
-
<line num="37" count="22" type="stmt"/>
|
|
37
|
-
<line num="40" count="297" type="stmt"/>
|
|
38
|
-
<line num="48" count="28" type="stmt"/>
|
|
39
|
-
<line num="49" count="28" type="cond" truecount="1" falsecount="0"/>
|
|
40
|
-
<line num="50" count="12" type="stmt"/>
|
|
41
|
-
<line num="52" count="18" type="cond" truecount="2" falsecount="0"/>
|
|
42
|
-
<line num="53" count="16" type="cond" truecount="2" falsecount="0"/>
|
|
43
|
-
<line num="54" count="2" type="cond" truecount="2" falsecount="0"/>
|
|
44
|
-
<line num="55" count="1" type="stmt"/>
|
|
45
|
-
<line num="62" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
46
|
-
<line num="63" count="1" type="stmt"/>
|
|
47
|
-
<line num="74" count="14" type="cond" truecount="1" falsecount="0"/>
|
|
48
|
-
<line num="75" count="2" type="cond" truecount="2" falsecount="0"/>
|
|
49
|
-
<line num="76" count="1" type="stmt"/>
|
|
50
|
-
<line num="83" count="1" type="cond" truecount="1" falsecount="0"/>
|
|
51
|
-
<line num="84" count="1" type="stmt"/>
|
|
52
|
-
<line num="98" count="1" type="stmt"/>
|
|
53
|
-
<line num="111" count="9" type="stmt"/>
|
|
54
|
-
<line num="112" count="9" type="stmt"/>
|
|
55
|
-
<line num="114" count="9" type="stmt"/>
|
|
56
|
-
<line num="115" count="10" type="cond" truecount="3" falsecount="0"/>
|
|
57
|
-
<line num="116" count="10" type="stmt"/>
|
|
58
|
-
<line num="119" count="9" type="stmt"/>
|
|
59
|
-
<line num="121" count="16" type="cond" truecount="0" falsecount="1"/>
|
|
60
|
-
<line num="122" count="0" type="stmt"/>
|
|
61
|
-
<line num="124" count="16" type="cond" truecount="2" falsecount="1"/>
|
|
62
|
-
<line num="125" count="0" type="stmt"/>
|
|
63
|
-
<line num="127" count="16" type="stmt"/>
|
|
64
|
-
<line num="128" count="16" type="stmt"/>
|
|
65
|
-
<line num="131" count="2" type="cond" truecount="0" falsecount="1"/>
|
|
66
|
-
<line num="132" count="0" type="stmt"/>
|
|
67
|
-
<line num="134" count="2" type="cond" truecount="0" falsecount="1"/>
|
|
68
|
-
<line num="135" count="0" type="stmt"/>
|
|
69
|
-
<line num="137" count="2" type="stmt"/>
|
|
70
|
-
</file>
|
|
71
|
-
<file name="pure-functions.ts" path="/Users/carl/Development/eslint-plugin/src/pure-functions.ts">
|
|
72
|
-
<metrics statements="19" coveredstatements="18" conditionals="9" coveredconditionals="8" methods="3" coveredmethods="3"/>
|
|
73
|
-
<line num="12" count="1" type="stmt"/>
|
|
74
|
-
<line num="14" count="1" type="stmt"/>
|
|
75
|
-
<line num="26" count="3" type="stmt"/>
|
|
76
|
-
<line num="27" count="3" type="stmt"/>
|
|
77
|
-
<line num="30" count="5" type="stmt"/>
|
|
78
|
-
<line num="31" count="5" type="stmt"/>
|
|
79
|
-
<line num="32" count="5" type="cond" truecount="0" falsecount="1"/>
|
|
80
|
-
<line num="33" count="0" type="stmt"/>
|
|
81
|
-
<line num="36" count="5" type="stmt"/>
|
|
82
|
-
<line num="38" count="5" type="stmt"/>
|
|
83
|
-
<line num="39" count="6" type="stmt"/>
|
|
84
|
-
<line num="40" count="6" type="stmt"/>
|
|
85
|
-
<line num="41" count="12" type="stmt"/>
|
|
86
|
-
<line num="42" count="12" type="cond" truecount="1" falsecount="0"/>
|
|
87
|
-
<line num="45" count="12" type="stmt"/>
|
|
88
|
-
<line num="46" count="12" type="stmt"/>
|
|
89
|
-
<line num="47" count="12" type="stmt"/>
|
|
90
|
-
<line num="56" count="2" type="stmt"/>
|
|
91
|
-
<line num="66" count="3" type="stmt"/>
|
|
92
|
-
</file>
|
|
93
|
-
</project>
|
|
94
|
-
</coverage>
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
{"/Users/carl/Development/eslint-plugin/src/file-path-comment.ts": {"path":"/Users/carl/Development/eslint-plugin/src/file-path-comment.ts","statementMap":{"0":{"start":{"line":11,"column":0},"end":{"line":88,"column":21}},"1":{"start":{"line":21,"column":22},"end":{"line":21,"column":69}},"2":{"start":{"line":22,"column":25},"end":{"line":22,"column":63}},"3":{"start":{"line":24,"column":4},"end":{"line":26,"column":null}},"4":{"start":{"line":25,"column":6},"end":{"line":25,"column":16}},"5":{"start":{"line":28,"column":4},"end":{"line":84,"column":null}},"6":{"start":{"line":29,"column":6},"end":{"line":63,"column":null}},"7":{"start":{"line":30,"column":8},"end":{"line":45,"column":11}},"8":{"start":{"line":43,"column":12},"end":{"line":43,"column":81}},"9":{"start":{"line":47,"column":8},"end":{"line":62,"column":11}},"10":{"start":{"line":60,"column":12},"end":{"line":60,"column":81}},"11":{"start":{"line":65,"column":28},"end":{"line":65,"column":53}},"12":{"start":{"line":66,"column":6},"end":{"line":83,"column":null}},"13":{"start":{"line":67,"column":8},"end":{"line":82,"column":11}},"14":{"start":{"line":80,"column":12},"end":{"line":80,"column":87}},"15":{"start":{"line":86,"column":4},"end":{"line":86,"column":14}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":20,"column":2},"end":{"line":20,"column":8}},"loc":{"start":{"line":20,"column":16},"end":{"line":87,"column":3}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":42,"column":10},"end":{"line":42,"column":13}},"loc":{"start":{"line":42,"column":35},"end":{"line":44,"column":11}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":59,"column":10},"end":{"line":59,"column":13}},"loc":{"start":{"line":59,"column":35},"end":{"line":61,"column":11}}},"3":{"name":"(anonymous_3)","decl":{"start":{"line":79,"column":10},"end":{"line":79,"column":13}},"loc":{"start":{"line":79,"column":35},"end":{"line":81,"column":11}}}},"branchMap":{"0":{"loc":{"start":{"line":24,"column":4},"end":{"line":26,"column":null}},"type":"if","locations":[{"start":{"line":24,"column":4},"end":{"line":26,"column":null}}]},"1":{"loc":{"start":{"line":28,"column":4},"end":{"line":84,"column":null}},"type":"if","locations":[{"start":{"line":28,"column":4},"end":{"line":84,"column":null}},{"start":{"line":64,"column":11},"end":{"line":84,"column":null}}]},"2":{"loc":{"start":{"line":29,"column":6},"end":{"line":63,"column":null}},"type":"if","locations":[{"start":{"line":29,"column":6},"end":{"line":63,"column":null}},{"start":{"line":46,"column":13},"end":{"line":63,"column":null}}]},"3":{"loc":{"start":{"line":66,"column":6},"end":{"line":83,"column":null}},"type":"if","locations":[{"start":{"line":66,"column":6},"end":{"line":83,"column":null}}]}},"s":{"0":1,"1":14,"2":14,"3":14,"4":2,"5":12,"6":3,"7":1,"8":1,"9":2,"10":2,"11":9,"12":9,"13":2,"14":2,"15":12},"f":{"0":14,"1":1,"2":2,"3":2},"b":{"0":[2],"1":[3,9],"2":[1,2],"3":[2]}}
|
|
2
|
-
,"/Users/carl/Development/eslint-plugin/src/no-card-numbers.ts": {"path":"/Users/carl/Development/eslint-plugin/src/no-card-numbers.ts","statementMap":{"0":{"start":{"line":12,"column":26},"end":{"line":12,"column":45}},"1":{"start":{"line":13,"column":27},"end":{"line":13,"column":47}},"2":{"start":{"line":14,"column":24},"end":{"line":14,"column":38}},"3":{"start":{"line":15,"column":25},"end":{"line":23,"column":2}},"4":{"start":{"line":26,"column":2},"end":{"line":44,"column":4}},"5":{"start":{"line":30,"column":22},"end":{"line":30,"column":41}},"6":{"start":{"line":32,"column":20},"end":{"line":32,"column":32}},"7":{"start":{"line":33,"column":8},"end":{"line":39,"column":null}},"8":{"start":{"line":34,"column":10},"end":{"line":34,"column":21}},"9":{"start":{"line":36,"column":10},"end":{"line":38,"column":null}},"10":{"start":{"line":37,"column":12},"end":{"line":37,"column":37}},"11":{"start":{"line":40,"column":8},"end":{"line":40,"column":37}},"12":{"start":{"line":48,"column":18},"end":{"line":48,"column":46}},"13":{"start":{"line":49,"column":2},"end":{"line":51,"column":null}},"14":{"start":{"line":50,"column":4},"end":{"line":50,"column":11}},"15":{"start":{"line":52,"column":22},"end":{"line":52,"column":107}},"16":{"start":{"line":52,"column":48},"end":{"line":52,"column":106}},"17":{"start":{"line":53,"column":2},"end":{"line":95,"column":null}},"18":{"start":{"line":54,"column":4},"end":{"line":73,"column":null}},"19":{"start":{"line":55,"column":6},"end":{"line":61,"column":9}},"20":{"start":{"line":62,"column":11},"end":{"line":73,"column":null}},"21":{"start":{"line":63,"column":6},"end":{"line":72,"column":9}},"22":{"start":{"line":74,"column":9},"end":{"line":95,"column":null}},"23":{"start":{"line":75,"column":4},"end":{"line":94,"column":null}},"24":{"start":{"line":76,"column":6},"end":{"line":82,"column":9}},"25":{"start":{"line":83,"column":11},"end":{"line":94,"column":null}},"26":{"start":{"line":84,"column":6},"end":{"line":93,"column":9}},"27":{"start":{"line":98,"column":0},"end":{"line":141,"column":21}},"28":{"start":{"line":111,"column":23},"end":{"line":111,"column":46}},"29":{"start":{"line":112,"column":21},"end":{"line":112,"column":48}},"30":{"start":{"line":114,"column":4},"end":{"line":118,"column":7}},"31":{"start":{"line":115,"column":6},"end":{"line":117,"column":null}},"32":{"start":{"line":116,"column":8},"end":{"line":116,"column":76}},"33":{"start":{"line":119,"column":4},"end":{"line":139,"column":6}},"34":{"start":{"line":121,"column":8},"end":{"line":123,"column":null}},"35":{"start":{"line":122,"column":10},"end":{"line":122,"column":17}},"36":{"start":{"line":124,"column":8},"end":{"line":126,"column":null}},"37":{"start":{"line":125,"column":10},"end":{"line":125,"column":17}},"38":{"start":{"line":127,"column":22},"end":{"line":127,"column":37}},"39":{"start":{"line":128,"column":8},"end":{"line":128,"column":50}},"40":{"start":{"line":131,"column":8},"end":{"line":133,"column":null}},"41":{"start":{"line":132,"column":10},"end":{"line":132,"column":17}},"42":{"start":{"line":134,"column":8},"end":{"line":136,"column":null}},"43":{"start":{"line":135,"column":10},"end":{"line":135,"column":17}},"44":{"start":{"line":137,"column":8},"end":{"line":137,"column":62}}},"fnMap":{"0":{"name":"luhnCheck","decl":{"start":{"line":25,"column":9},"end":{"line":25,"column":18}},"loc":{"start":{"line":25,"column":37},"end":{"line":45,"column":1}}},"1":{"name":"(anonymous_1)","decl":{"start":{"line":30,"column":11},"end":{"line":30,"column":12}},"loc":{"start":{"line":30,"column":22},"end":{"line":30,"column":41}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":31,"column":14},"end":{"line":31,"column":15}},"loc":{"start":{"line":31,"column":53},"end":{"line":41,"column":7}}},"3":{"name":"checkForCardNumbers","decl":{"start":{"line":47,"column":9},"end":{"line":47,"column":28}},"loc":{"start":{"line":47,"column":104},"end":{"line":96,"column":1}}},"4":{"name":"(anonymous_4)","decl":{"start":{"line":52,"column":37},"end":{"line":52,"column":38}},"loc":{"start":{"line":52,"column":48},"end":{"line":52,"column":106}}},"5":{"name":"(anonymous_5)","decl":{"start":{"line":110,"column":2},"end":{"line":110,"column":8}},"loc":{"start":{"line":110,"column":16},"end":{"line":140,"column":3}}},"6":{"name":"(anonymous_6)","decl":{"start":{"line":114,"column":21},"end":{"line":114,"column":22}},"loc":{"start":{"line":114,"column":33},"end":{"line":118,"column":5}}},"7":{"name":"(anonymous_7)","decl":{"start":{"line":120,"column":6},"end":{"line":120,"column":13}},"loc":{"start":{"line":120,"column":18},"end":{"line":129,"column":7}}},"8":{"name":"(anonymous_8)","decl":{"start":{"line":130,"column":6},"end":{"line":130,"column":21}},"loc":{"start":{"line":130,"column":26},"end":{"line":138,"column":7}}}},"branchMap":{"0":{"loc":{"start":{"line":33,"column":8},"end":{"line":39,"column":null}},"type":"if","locations":[{"start":{"line":33,"column":8},"end":{"line":39,"column":null}}]},"1":{"loc":{"start":{"line":36,"column":10},"end":{"line":38,"column":null}},"type":"if","locations":[{"start":{"line":36,"column":10},"end":{"line":38,"column":null}}]},"2":{"loc":{"start":{"line":49,"column":2},"end":{"line":51,"column":null}},"type":"if","locations":[{"start":{"line":49,"column":2},"end":{"line":51,"column":null}}]},"3":{"loc":{"start":{"line":52,"column":48},"end":{"line":52,"column":106}},"type":"binary-expr","locations":[{"start":{"line":52,"column":48},"end":{"line":52,"column":64}},{"start":{"line":52,"column":68},"end":{"line":52,"column":106}}]},"4":{"loc":{"start":{"line":53,"column":2},"end":{"line":95,"column":null}},"type":"if","locations":[{"start":{"line":53,"column":2},"end":{"line":95,"column":null}},{"start":{"line":74,"column":9},"end":{"line":95,"column":null}}]},"5":{"loc":{"start":{"line":54,"column":4},"end":{"line":73,"column":null}},"type":"if","locations":[{"start":{"line":54,"column":4},"end":{"line":73,"column":null}},{"start":{"line":62,"column":11},"end":{"line":73,"column":null}}]},"6":{"loc":{"start":{"line":62,"column":11},"end":{"line":73,"column":null}},"type":"if","locations":[{"start":{"line":62,"column":11},"end":{"line":73,"column":null}}]},"7":{"loc":{"start":{"line":74,"column":9},"end":{"line":95,"column":null}},"type":"if","locations":[{"start":{"line":74,"column":9},"end":{"line":95,"column":null}}]},"8":{"loc":{"start":{"line":75,"column":4},"end":{"line":94,"column":null}},"type":"if","locations":[{"start":{"line":75,"column":4},"end":{"line":94,"column":null}},{"start":{"line":83,"column":11},"end":{"line":94,"column":null}}]},"9":{"loc":{"start":{"line":83,"column":11},"end":{"line":94,"column":null}},"type":"if","locations":[{"start":{"line":83,"column":11},"end":{"line":94,"column":null}}]},"10":{"loc":{"start":{"line":115,"column":6},"end":{"line":117,"column":null}},"type":"if","locations":[{"start":{"line":115,"column":6},"end":{"line":117,"column":null}}]},"11":{"loc":{"start":{"line":115,"column":10},"end":{"line":115,"column":59}},"type":"binary-expr","locations":[{"start":{"line":115,"column":10},"end":{"line":115,"column":35}},{"start":{"line":115,"column":39},"end":{"line":115,"column":59}}]},"12":{"loc":{"start":{"line":121,"column":8},"end":{"line":123,"column":null}},"type":"if","locations":[{"start":{"line":121,"column":8},"end":{"line":123,"column":null}}]},"13":{"loc":{"start":{"line":124,"column":8},"end":{"line":126,"column":null}},"type":"if","locations":[{"start":{"line":124,"column":8},"end":{"line":126,"column":null}}]},"14":{"loc":{"start":{"line":124,"column":12},"end":{"line":124,"column":76}},"type":"binary-expr","locations":[{"start":{"line":124,"column":12},"end":{"line":124,"column":42}},{"start":{"line":124,"column":46},"end":{"line":124,"column":76}}]},"15":{"loc":{"start":{"line":131,"column":8},"end":{"line":133,"column":null}},"type":"if","locations":[{"start":{"line":131,"column":8},"end":{"line":133,"column":null}}]},"16":{"loc":{"start":{"line":134,"column":8},"end":{"line":136,"column":null}},"type":"if","locations":[{"start":{"line":134,"column":8},"end":{"line":136,"column":null}}]}},"s":{"0":1,"1":1,"2":1,"3":1,"4":18,"5":297,"6":297,"7":297,"8":145,"9":145,"10":22,"11":297,"12":28,"13":28,"14":12,"15":16,"16":18,"17":16,"18":2,"19":1,"20":1,"21":1,"22":14,"23":2,"24":1,"25":1,"26":1,"27":1,"28":9,"29":9,"30":9,"31":10,"32":10,"33":9,"34":16,"35":0,"36":16,"37":0,"38":16,"39":16,"40":2,"41":0,"42":2,"43":0,"44":2},"f":{"0":18,"1":297,"2":297,"3":28,"4":18,"5":9,"6":10,"7":16,"8":2},"b":{"0":[145],"1":[22],"2":[12],"3":[18,13],"4":[2,14],"5":[1,1],"6":[1],"7":[2],"8":[1,1],"9":[1],"10":[10],"11":[10,10],"12":[0],"13":[0],"14":[16,12],"15":[0],"16":[0]}}
|
|
3
|
-
,"/Users/carl/Development/eslint-plugin/src/pure-functions.ts": {"path":"/Users/carl/Development/eslint-plugin/src/pure-functions.ts","statementMap":{"0":{"start":{"line":12,"column":24},"end":{"line":12,"column":41}},"1":{"start":{"line":14,"column":0},"end":{"line":72,"column":21}},"2":{"start":{"line":26,"column":23},"end":{"line":26,"column":46}},"3":{"start":{"line":27,"column":20},"end":{"line":27,"column":43}},"4":{"start":{"line":30,"column":28},"end":{"line":30,"column":49}},"5":{"start":{"line":31,"column":28},"end":{"line":31,"column":38}},"6":{"start":{"line":32,"column":6},"end":{"line":34,"column":null}},"7":{"start":{"line":33,"column":8},"end":{"line":33,"column":15}},"8":{"start":{"line":36,"column":20},"end":{"line":36,"column":35}},"9":{"start":{"line":38,"column":6},"end":{"line":63,"column":null}},"10":{"start":{"line":39,"column":8},"end":{"line":39,"column":41}},"11":{"start":{"line":40,"column":8},"end":{"line":62,"column":null}},"12":{"start":{"line":41,"column":27},"end":{"line":41,"column":45}},"13":{"start":{"line":42,"column":10},"end":{"line":61,"column":null}},"14":{"start":{"line":45,"column":37},"end":{"line":45,"column":108}},"15":{"start":{"line":46,"column":38},"end":{"line":46,"column":58}},"16":{"start":{"line":47,"column":14},"end":{"line":53,"column":16}},"17":{"start":{"line":56,"column":12},"end":{"line":60,"column":15}},"18":{"start":{"line":66,"column":4},"end":{"line":70,"column":6}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":25,"column":2},"end":{"line":25,"column":8}},"loc":{"start":{"line":25,"column":34},"end":{"line":71,"column":3}}},"1":{"name":"check","decl":{"start":{"line":29,"column":13},"end":{"line":29,"column":18}},"loc":{"start":{"line":29,"column":36},"end":{"line":64,"column":5}}},"2":{"name":"(anonymous_2)","decl":{"start":{"line":44,"column":32},"end":{"line":44,"column":33}},"loc":{"start":{"line":44,"column":47},"end":{"line":54,"column":13}}}},"branchMap":{"0":{"loc":{"start":{"line":32,"column":6},"end":{"line":34,"column":null}},"type":"if","locations":[{"start":{"line":32,"column":6},"end":{"line":34,"column":null}}]},"1":{"loc":{"start":{"line":42,"column":10},"end":{"line":61,"column":null}},"type":"if","locations":[{"start":{"line":42,"column":10},"end":{"line":61,"column":null}}]},"2":{"loc":{"start":{"line":43,"column":12},"end":{"line":54,"column":14}},"type":"binary-expr","locations":[{"start":{"line":43,"column":12},"end":{"line":43,"column":29}},{"start":{"line":44,"column":12},"end":{"line":54,"column":14}}]},"3":{"loc":{"start":{"line":48,"column":16},"end":{"line":51,"column":null}},"type":"binary-expr","locations":[{"start":{"line":48,"column":17},"end":{"line":48,"column":54}},{"start":{"line":48,"column":58},"end":{"line":48,"column":95}},{"start":{"line":49,"column":16},"end":{"line":51,"column":null}}]},"4":{"loc":{"start":{"line":50,"column":19},"end":{"line":51,"column":57}},"type":"binary-expr","locations":[{"start":{"line":50,"column":19},"end":{"line":50,"column":78}},{"start":{"line":51,"column":18},"end":{"line":51,"column":57}}]}},"s":{"0":1,"1":1,"2":3,"3":3,"4":5,"5":5,"6":5,"7":0,"8":5,"9":5,"10":6,"11":6,"12":12,"13":12,"14":12,"15":12,"16":12,"17":2,"18":3},"f":{"0":3,"1":5,"2":12},"b":{"0":[0],"1":[2],"2":[12,12],"3":[12,9,3],"4":[3,1]}}
|
|
4
|
-
}
|