@checkdigit/eslint-plugin 2.0.5 → 4.0.0-beta.1
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/.eslintrc +76 -0
- package/LICENSE.txt +1 -1
- package/README.md +2 -1
- package/coverage/clover.xml +94 -0
- package/coverage/coverage-final.json +4 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/file-path-comment.ts.html +349 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/no-card-numbers.ts.html +508 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/pure-functions.ts.html +301 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +196 -0
- package/coverage/lcov.info +176 -0
- package/dist/file-path-comment.js +86 -0
- package/dist/file-path-comment.js.map +1 -0
- package/dist/file-path-comment.spec.d.ts +1 -0
- package/dist/file-path-comment.spec.js +72 -0
- package/dist/file-path-comment.spec.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +38 -2
- package/dist/index.js.map +1 -1
- package/dist/no-card-numbers.js +131 -0
- package/dist/no-card-numbers.js.map +1 -0
- package/dist/no-card-numbers.spec.d.ts +1 -0
- package/dist/no-card-numbers.spec.js +104 -0
- package/dist/no-card-numbers.spec.js.map +1 -0
- package/dist/pure-functions.d.ts +3 -0
- package/dist/pure-functions.js +55 -0
- package/dist/pure-functions.js.map +1 -0
- package/dist/pure-functions.spec.d.ts +1 -0
- package/dist/pure-functions.spec.js +90 -0
- package/dist/pure-functions.spec.js.map +1 -0
- package/package.json +15 -17
- package/src/file-path-comment.spec.ts +71 -0
- package/src/file-path-comment.ts +88 -0
- package/src/index.ts +35 -0
- package/src/no-card-numbers.spec.ts +114 -0
- package/src/no-card-numbers.ts +141 -0
- package/src/pure-functions.spec.ts +93 -0
- package/src/pure-functions.ts +72 -0
- package/tsconfig.json +12 -0
package/.eslintrc
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
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/LICENSE.txt
CHANGED
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# checkdigit/eslint-plugin
|
|
2
2
|
|
|
3
|
-
[](https://github.com/checkdigit/eslint-plugin/blob/master/LICENSE.txt)
|
|
4
4
|
[](https://status.david-dm.org/gh/checkdigit/eslint-plugin.svg)
|
|
5
5
|
|
|
6
6
|
Copyright (c) 2021 [Check Digit, LLC](https://checkdigit.com)
|
|
@@ -9,6 +9,7 @@ Copyright (c) 2021 [Check Digit, LLC](https://checkdigit.com)
|
|
|
9
9
|
|
|
10
10
|
* `@checkdigit/no-card-numbers`
|
|
11
11
|
* `@checkdigit/file-path-comment`
|
|
12
|
+
* `@checkdigit/pure-functions`
|
|
12
13
|
|
|
13
14
|
## Configurations
|
|
14
15
|
|
|
@@ -0,0 +1,94 @@
|
|
|
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>
|
|
@@ -0,0 +1,4 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
body, html {
|
|
2
|
+
margin:0; padding: 0;
|
|
3
|
+
height: 100%;
|
|
4
|
+
}
|
|
5
|
+
body {
|
|
6
|
+
font-family: Helvetica Neue, Helvetica, Arial;
|
|
7
|
+
font-size: 14px;
|
|
8
|
+
color:#333;
|
|
9
|
+
}
|
|
10
|
+
.small { font-size: 12px; }
|
|
11
|
+
*, *:after, *:before {
|
|
12
|
+
-webkit-box-sizing:border-box;
|
|
13
|
+
-moz-box-sizing:border-box;
|
|
14
|
+
box-sizing:border-box;
|
|
15
|
+
}
|
|
16
|
+
h1 { font-size: 20px; margin: 0;}
|
|
17
|
+
h2 { font-size: 14px; }
|
|
18
|
+
pre {
|
|
19
|
+
font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
-moz-tab-size: 2;
|
|
23
|
+
-o-tab-size: 2;
|
|
24
|
+
tab-size: 2;
|
|
25
|
+
}
|
|
26
|
+
a { color:#0074D9; text-decoration:none; }
|
|
27
|
+
a:hover { text-decoration:underline; }
|
|
28
|
+
.strong { font-weight: bold; }
|
|
29
|
+
.space-top1 { padding: 10px 0 0 0; }
|
|
30
|
+
.pad2y { padding: 20px 0; }
|
|
31
|
+
.pad1y { padding: 10px 0; }
|
|
32
|
+
.pad2x { padding: 0 20px; }
|
|
33
|
+
.pad2 { padding: 20px; }
|
|
34
|
+
.pad1 { padding: 10px; }
|
|
35
|
+
.space-left2 { padding-left:55px; }
|
|
36
|
+
.space-right2 { padding-right:20px; }
|
|
37
|
+
.center { text-align:center; }
|
|
38
|
+
.clearfix { display:block; }
|
|
39
|
+
.clearfix:after {
|
|
40
|
+
content:'';
|
|
41
|
+
display:block;
|
|
42
|
+
height:0;
|
|
43
|
+
clear:both;
|
|
44
|
+
visibility:hidden;
|
|
45
|
+
}
|
|
46
|
+
.fl { float: left; }
|
|
47
|
+
@media only screen and (max-width:640px) {
|
|
48
|
+
.col3 { width:100%; max-width:100%; }
|
|
49
|
+
.hide-mobile { display:none!important; }
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.quiet {
|
|
53
|
+
color: #7f7f7f;
|
|
54
|
+
color: rgba(0,0,0,0.5);
|
|
55
|
+
}
|
|
56
|
+
.quiet a { opacity: 0.7; }
|
|
57
|
+
|
|
58
|
+
.fraction {
|
|
59
|
+
font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
|
|
60
|
+
font-size: 10px;
|
|
61
|
+
color: #555;
|
|
62
|
+
background: #E8E8E8;
|
|
63
|
+
padding: 4px 5px;
|
|
64
|
+
border-radius: 3px;
|
|
65
|
+
vertical-align: middle;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
div.path a:link, div.path a:visited { color: #333; }
|
|
69
|
+
table.coverage {
|
|
70
|
+
border-collapse: collapse;
|
|
71
|
+
margin: 10px 0 0 0;
|
|
72
|
+
padding: 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
table.coverage td {
|
|
76
|
+
margin: 0;
|
|
77
|
+
padding: 0;
|
|
78
|
+
vertical-align: top;
|
|
79
|
+
}
|
|
80
|
+
table.coverage td.line-count {
|
|
81
|
+
text-align: right;
|
|
82
|
+
padding: 0 5px 0 20px;
|
|
83
|
+
}
|
|
84
|
+
table.coverage td.line-coverage {
|
|
85
|
+
text-align: right;
|
|
86
|
+
padding-right: 10px;
|
|
87
|
+
min-width:20px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
table.coverage td span.cline-any {
|
|
91
|
+
display: inline-block;
|
|
92
|
+
padding: 0 5px;
|
|
93
|
+
width: 100%;
|
|
94
|
+
}
|
|
95
|
+
.missing-if-branch {
|
|
96
|
+
display: inline-block;
|
|
97
|
+
margin-right: 5px;
|
|
98
|
+
border-radius: 3px;
|
|
99
|
+
position: relative;
|
|
100
|
+
padding: 0 4px;
|
|
101
|
+
background: #333;
|
|
102
|
+
color: yellow;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.skip-if-branch {
|
|
106
|
+
display: none;
|
|
107
|
+
margin-right: 10px;
|
|
108
|
+
position: relative;
|
|
109
|
+
padding: 0 4px;
|
|
110
|
+
background: #ccc;
|
|
111
|
+
color: white;
|
|
112
|
+
}
|
|
113
|
+
.missing-if-branch .typ, .skip-if-branch .typ {
|
|
114
|
+
color: inherit !important;
|
|
115
|
+
}
|
|
116
|
+
.coverage-summary {
|
|
117
|
+
border-collapse: collapse;
|
|
118
|
+
width: 100%;
|
|
119
|
+
}
|
|
120
|
+
.coverage-summary tr { border-bottom: 1px solid #bbb; }
|
|
121
|
+
.keyline-all { border: 1px solid #ddd; }
|
|
122
|
+
.coverage-summary td, .coverage-summary th { padding: 10px; }
|
|
123
|
+
.coverage-summary tbody { border: 1px solid #bbb; }
|
|
124
|
+
.coverage-summary td { border-right: 1px solid #bbb; }
|
|
125
|
+
.coverage-summary td:last-child { border-right: none; }
|
|
126
|
+
.coverage-summary th {
|
|
127
|
+
text-align: left;
|
|
128
|
+
font-weight: normal;
|
|
129
|
+
white-space: nowrap;
|
|
130
|
+
}
|
|
131
|
+
.coverage-summary th.file { border-right: none !important; }
|
|
132
|
+
.coverage-summary th.pct { }
|
|
133
|
+
.coverage-summary th.pic,
|
|
134
|
+
.coverage-summary th.abs,
|
|
135
|
+
.coverage-summary td.pct,
|
|
136
|
+
.coverage-summary td.abs { text-align: right; }
|
|
137
|
+
.coverage-summary td.file { white-space: nowrap; }
|
|
138
|
+
.coverage-summary td.pic { min-width: 120px !important; }
|
|
139
|
+
.coverage-summary tfoot td { }
|
|
140
|
+
|
|
141
|
+
.coverage-summary .sorter {
|
|
142
|
+
height: 10px;
|
|
143
|
+
width: 7px;
|
|
144
|
+
display: inline-block;
|
|
145
|
+
margin-left: 0.5em;
|
|
146
|
+
background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
|
|
147
|
+
}
|
|
148
|
+
.coverage-summary .sorted .sorter {
|
|
149
|
+
background-position: 0 -20px;
|
|
150
|
+
}
|
|
151
|
+
.coverage-summary .sorted-desc .sorter {
|
|
152
|
+
background-position: 0 -10px;
|
|
153
|
+
}
|
|
154
|
+
.status-line { height: 10px; }
|
|
155
|
+
/* yellow */
|
|
156
|
+
.cbranch-no { background: yellow !important; color: #111; }
|
|
157
|
+
/* dark red */
|
|
158
|
+
.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
|
|
159
|
+
.low .chart { border:1px solid #C21F39 }
|
|
160
|
+
.highlighted,
|
|
161
|
+
.highlighted .cstat-no, .highlighted .fstat-no, .highlighted .cbranch-no{
|
|
162
|
+
background: #C21F39 !important;
|
|
163
|
+
}
|
|
164
|
+
/* medium red */
|
|
165
|
+
.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
|
|
166
|
+
/* light red */
|
|
167
|
+
.low, .cline-no { background:#FCE1E5 }
|
|
168
|
+
/* light green */
|
|
169
|
+
.high, .cline-yes { background:rgb(230,245,208) }
|
|
170
|
+
/* medium green */
|
|
171
|
+
.cstat-yes { background:rgb(161,215,106) }
|
|
172
|
+
/* dark green */
|
|
173
|
+
.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
|
|
174
|
+
.high .chart { border:1px solid rgb(77,146,33) }
|
|
175
|
+
/* dark yellow (gold) */
|
|
176
|
+
.status-line.medium, .medium .cover-fill { background: #f9cd0b; }
|
|
177
|
+
.medium .chart { border:1px solid #f9cd0b; }
|
|
178
|
+
/* light yellow */
|
|
179
|
+
.medium { background: #fff4c2; }
|
|
180
|
+
|
|
181
|
+
.cstat-skip { background: #ddd; color: #111; }
|
|
182
|
+
.fstat-skip { background: #ddd; color: #111 !important; }
|
|
183
|
+
.cbranch-skip { background: #ddd !important; color: #111; }
|
|
184
|
+
|
|
185
|
+
span.cline-neutral { background: #eaeaea; }
|
|
186
|
+
|
|
187
|
+
.coverage-summary td.empty {
|
|
188
|
+
opacity: .5;
|
|
189
|
+
padding-top: 4px;
|
|
190
|
+
padding-bottom: 4px;
|
|
191
|
+
line-height: 1;
|
|
192
|
+
color: #888;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.cover-fill, .cover-empty {
|
|
196
|
+
display:inline-block;
|
|
197
|
+
height: 12px;
|
|
198
|
+
}
|
|
199
|
+
.chart {
|
|
200
|
+
line-height: 0;
|
|
201
|
+
}
|
|
202
|
+
.cover-empty {
|
|
203
|
+
background: white;
|
|
204
|
+
}
|
|
205
|
+
.cover-full {
|
|
206
|
+
border-right: none !important;
|
|
207
|
+
}
|
|
208
|
+
pre.prettyprint {
|
|
209
|
+
border: none !important;
|
|
210
|
+
padding: 0 !important;
|
|
211
|
+
margin: 0 !important;
|
|
212
|
+
}
|
|
213
|
+
.com { color: #999 !important; }
|
|
214
|
+
.ignore-none { color: #999; font-weight: normal; }
|
|
215
|
+
|
|
216
|
+
.wrapper {
|
|
217
|
+
min-height: 100%;
|
|
218
|
+
height: auto !important;
|
|
219
|
+
height: 100%;
|
|
220
|
+
margin: 0 auto -48px;
|
|
221
|
+
}
|
|
222
|
+
.footer, .push {
|
|
223
|
+
height: 48px;
|
|
224
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
var jumpToCode = (function init() {
|
|
3
|
+
// Classes of code we would like to highlight in the file view
|
|
4
|
+
var missingCoverageClasses = ['.cbranch-no', '.cstat-no', '.fstat-no'];
|
|
5
|
+
|
|
6
|
+
// Elements to highlight in the file listing view
|
|
7
|
+
var fileListingElements = ['td.pct.low'];
|
|
8
|
+
|
|
9
|
+
// We don't want to select elements that are direct descendants of another match
|
|
10
|
+
var notSelector = ':not(' + missingCoverageClasses.join('):not(') + ') > '; // becomes `:not(a):not(b) > `
|
|
11
|
+
|
|
12
|
+
// Selecter that finds elements on the page to which we can jump
|
|
13
|
+
var selector =
|
|
14
|
+
fileListingElements.join(', ') +
|
|
15
|
+
', ' +
|
|
16
|
+
notSelector +
|
|
17
|
+
missingCoverageClasses.join(', ' + notSelector); // becomes `:not(a):not(b) > a, :not(a):not(b) > b`
|
|
18
|
+
|
|
19
|
+
// The NodeList of matching elements
|
|
20
|
+
var missingCoverageElements = document.querySelectorAll(selector);
|
|
21
|
+
|
|
22
|
+
var currentIndex;
|
|
23
|
+
|
|
24
|
+
function toggleClass(index) {
|
|
25
|
+
missingCoverageElements
|
|
26
|
+
.item(currentIndex)
|
|
27
|
+
.classList.remove('highlighted');
|
|
28
|
+
missingCoverageElements.item(index).classList.add('highlighted');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function makeCurrent(index) {
|
|
32
|
+
toggleClass(index);
|
|
33
|
+
currentIndex = index;
|
|
34
|
+
missingCoverageElements.item(index).scrollIntoView({
|
|
35
|
+
behavior: 'smooth',
|
|
36
|
+
block: 'center',
|
|
37
|
+
inline: 'center'
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function goToPrevious() {
|
|
42
|
+
var nextIndex = 0;
|
|
43
|
+
if (typeof currentIndex !== 'number' || currentIndex === 0) {
|
|
44
|
+
nextIndex = missingCoverageElements.length - 1;
|
|
45
|
+
} else if (missingCoverageElements.length > 1) {
|
|
46
|
+
nextIndex = currentIndex - 1;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
makeCurrent(nextIndex);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function goToNext() {
|
|
53
|
+
var nextIndex = 0;
|
|
54
|
+
|
|
55
|
+
if (
|
|
56
|
+
typeof currentIndex === 'number' &&
|
|
57
|
+
currentIndex < missingCoverageElements.length - 1
|
|
58
|
+
) {
|
|
59
|
+
nextIndex = currentIndex + 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
makeCurrent(nextIndex);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return function jump(event) {
|
|
66
|
+
if (
|
|
67
|
+
document.getElementById('fileSearch') === document.activeElement &&
|
|
68
|
+
document.activeElement != null
|
|
69
|
+
) {
|
|
70
|
+
// if we're currently focused on the search input, we don't want to navigate
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
switch (event.which) {
|
|
75
|
+
case 78: // n
|
|
76
|
+
case 74: // j
|
|
77
|
+
goToNext();
|
|
78
|
+
break;
|
|
79
|
+
case 66: // b
|
|
80
|
+
case 75: // k
|
|
81
|
+
case 80: // p
|
|
82
|
+
goToPrevious();
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
})();
|
|
87
|
+
window.addEventListener('keydown', jumpToCode);
|
|
Binary file
|