├── .babelrc ├── .editorconfig ├── .esdoc.json ├── .gitignore ├── .npmignore ├── .travis.yml ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.md ├── README.md ├── docs ├── ast │ └── source │ │ ├── index.js.json │ │ └── index.test.js.json ├── badge.svg ├── coverage.json ├── css │ ├── prettify-tomorrow.css │ └── style.css ├── dump.json ├── file │ └── src │ │ ├── index.js.html │ │ └── index.test.js.html ├── function │ └── index.html ├── identifiers.html ├── image │ ├── badge.svg │ ├── esdoc-logo-mini-black.png │ ├── esdoc-logo-mini.png │ ├── github.png │ ├── manual-badge.svg │ └── search.png ├── index.html ├── package.json ├── script │ ├── inherited-summary.js │ ├── inner-link.js │ ├── manual.js │ ├── patch-for-local.js │ ├── prettify │ │ ├── Apache-License-2.0.txt │ │ └── prettify.js │ ├── pretty-print.js │ ├── search.js │ ├── search_index.js │ └── test-summary.js └── source.html ├── package.json ├── src ├── index.js └── index.test.js ├── types ├── index.d.ts ├── test.ts ├── tsconfig.json └── types.test.js └── yarn.lock /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [["env", { "targets": { "node": 4 } }]] 3 | } 4 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | end_of_line = lf 6 | indent_size = 2 7 | indent_style = space 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.esdoc.json: -------------------------------------------------------------------------------- 1 | { 2 | "source": "./src", 3 | "destination": "./docs" 4 | } 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by https://www.gitignore.io/api/node,visualstudiocode 2 | 3 | ### Node ### 4 | # Logs 5 | logs 6 | *.log 7 | npm-debug.log* 8 | yarn-debug.log* 9 | yarn-error.log* 10 | 11 | # Runtime data 12 | pids 13 | *.pid 14 | *.seed 15 | *.pid.lock 16 | 17 | # Directory for instrumented libs generated by jscoverage/JSCover 18 | lib-cov 19 | 20 | # Coverage directory used by tools like istanbul 21 | coverage 22 | 23 | # nyc test coverage 24 | .nyc_output 25 | 26 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 27 | .grunt 28 | 29 | # Bower dependency directory (https://bower.io/) 30 | bower_components 31 | 32 | # node-waf configuration 33 | .lock-wscript 34 | 35 | # Compiled binary addons (http://nodejs.org/api/addons.html) 36 | build/Release 37 | 38 | # Dependency directories 39 | node_modules/ 40 | jspm_packages/ 41 | 42 | # Typescript v1 declaration files 43 | typings/ 44 | 45 | # Optional npm cache directory 46 | .npm 47 | 48 | # Optional eslint cache 49 | .eslintcache 50 | 51 | # Optional REPL history 52 | .node_repl_history 53 | 54 | # Output of 'npm pack' 55 | *.tgz 56 | 57 | # Yarn Integrity file 58 | .yarn-integrity 59 | 60 | # dotenv environment variables file 61 | .env 62 | 63 | # Generated code 64 | dist/ 65 | 66 | ### VisualStudioCode ### 67 | .vscode/* 68 | !.vscode/settings.json 69 | !.vscode/tasks.json 70 | !.vscode/launch.json 71 | !.vscode/extensions.json 72 | 73 | # End of https://www.gitignore.io/api/node,visualstudiocode 74 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .babelrc 2 | .editorconfig 3 | .esdoc.json 4 | .travis.yml 5 | yarn.lock 6 | node_modules/ 7 | src/ 8 | types/* 9 | !types/index.d.ts 10 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | sudo: false 3 | cache: 4 | yarn: true 5 | directories: 6 | - node_modules 7 | notifications: 8 | email: false 9 | node_js: 10 | - '8' 11 | after_success: 12 | - yarn semantic-release 13 | branches: 14 | except: 15 | - /^v\d+\.\d+\.\d+$/ 16 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. 6 | 7 | ## Our Standards 8 | 9 | Examples of behavior that contributes to creating a positive environment include: 10 | 11 | * Using welcoming and inclusive language 12 | * Being respectful of differing viewpoints and experiences 13 | * Gracefully accepting constructive criticism 14 | * Focusing on what is best for the community 15 | * Showing empathy towards other community members 16 | 17 | Examples of unacceptable behavior by participants include: 18 | 19 | * The use of sexualized language or imagery and unwelcome sexual attention or advances 20 | * Trolling, insulting/derogatory comments, and personal or political attacks 21 | * Public or private harassment 22 | * Publishing others' private information, such as a physical or electronic address, without explicit permission 23 | * Other conduct which could reasonably be considered inappropriate in a professional setting 24 | 25 | ## Our Responsibilities 26 | 27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. 28 | 29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. 30 | 31 | ## Scope 32 | 33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. 34 | 35 | ## Enforcement 36 | 37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact@mxstbr.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. 38 | 39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. 40 | 41 | ## Attribution 42 | 43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] 44 | 45 | [homepage]: http://contributor-covenant.org 46 | [version]: http://contributor-covenant.org/version/1/4/ 47 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ## Development 2 | 3 | Install [Yarn](https://yarnpkg.com/en/), and install the dependencies - `yarn install`. 4 | 5 | Run the [Jest](https://facebook.github.io/jest/) test suite with `yarn test`. 6 | 7 | This project uses [semantic-release](https://github.com/semantic-release/semantic-release) for automated NPM package publishing. 8 | 9 | The main caveat: instead of running `git commit`, run `yarn commit` and follow the prompts to input a conventional changelog message via [commitizen](https://github.com/commitizen/cz-cli). 10 | 11 | :heart: 12 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright 2018 Max Stoiber 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # danger-plugin-no-console 2 | 3 | [![Build Status](https://travis-ci.org/withspectrum/danger-plugin-no-console.svg?branch=master)](https://travis-ci.org/withspectrum/danger-plugin-no-console) 4 | [![npm version](https://badge.fury.io/js/danger-plugin-no-console.svg)](https://badge.fury.io/js/danger-plugin-no-console) 5 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) 6 | 7 | > Danger plugin to prevent merging code that still has `console.log`s inside it. 8 | 9 | ## Usage 10 | 11 | Install: 12 | 13 | ```sh 14 | yarn add danger-plugin-no-console --dev 15 | ``` 16 | 17 | At a glance: 18 | 19 | ```js 20 | // dangerfile.js 21 | import { schedule } from 'danger' 22 | import noConsole from 'danger-plugin-no-console' 23 | 24 | // Note: You need to use schedule() 25 | schedule(noConsole()) 26 | ``` 27 | 28 | ### Output example 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 43 | 44 | 45 |
Fails
⛔️ 40 | 41 | 1 console statement(s) left in src/add.js. 42 |
46 | 47 | ### Options 48 | 49 | #### `whitelist` 50 | 51 | You can specify a whitelist of console properties to let pass. This is useful to e.g. let errors be logged, like so: 52 | 53 | ```js 54 | // dangerfile.js 55 | import noConsole from 'danger-plugin-no-console' 56 | 57 | // Any file that contains console.log or console.info will fail, 58 | // but files can contain console.error and console.warn 59 | schedule(noConsole({ whitelist: ['error', 'warn'] })) 60 | ``` 61 | 62 | ## Changelog 63 | 64 | See the GitHub [release history](https://github.com/withspectrum/danger-plugin-no-console/releases). 65 | 66 | ## Contributing 67 | 68 | See [CONTRIBUTING.md](CONTRIBUTING.md). 69 | -------------------------------------------------------------------------------- /docs/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | document 13 | document 14 | 100% 15 | 100% 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/coverage.json: -------------------------------------------------------------------------------- 1 | { 2 | "coverage": "100%", 3 | "expectCount": 1, 4 | "actualCount": 1, 5 | "files": { 6 | "src/index.js": { 7 | "expectCount": 1, 8 | "actualCount": 1, 9 | "undocumentLines": [] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /docs/css/prettify-tomorrow.css: -------------------------------------------------------------------------------- 1 | /* Tomorrow Theme */ 2 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 3 | /* Pretty printing styles. Used with prettify.js. */ 4 | /* SPAN elements with the classes below are added by prettyprint. */ 5 | /* plain text */ 6 | .pln { 7 | color: #4d4d4c; } 8 | 9 | @media screen { 10 | /* string content */ 11 | .str { 12 | color: #718c00; } 13 | 14 | /* a keyword */ 15 | .kwd { 16 | color: #8959a8; } 17 | 18 | /* a comment */ 19 | .com { 20 | color: #8e908c; } 21 | 22 | /* a type name */ 23 | .typ { 24 | color: #4271ae; } 25 | 26 | /* a literal value */ 27 | .lit { 28 | color: #f5871f; } 29 | 30 | /* punctuation */ 31 | .pun { 32 | color: #4d4d4c; } 33 | 34 | /* lisp open bracket */ 35 | .opn { 36 | color: #4d4d4c; } 37 | 38 | /* lisp close bracket */ 39 | .clo { 40 | color: #4d4d4c; } 41 | 42 | /* a markup tag name */ 43 | .tag { 44 | color: #c82829; } 45 | 46 | /* a markup attribute name */ 47 | .atn { 48 | color: #f5871f; } 49 | 50 | /* a markup attribute value */ 51 | .atv { 52 | color: #3e999f; } 53 | 54 | /* a declaration */ 55 | .dec { 56 | color: #f5871f; } 57 | 58 | /* a variable name */ 59 | .var { 60 | color: #c82829; } 61 | 62 | /* a function name */ 63 | .fun { 64 | color: #4271ae; } } 65 | /* Use higher contrast and text-weight for printable form. */ 66 | @media print, projection { 67 | .str { 68 | color: #060; } 69 | 70 | .kwd { 71 | color: #006; 72 | font-weight: bold; } 73 | 74 | .com { 75 | color: #600; 76 | font-style: italic; } 77 | 78 | .typ { 79 | color: #404; 80 | font-weight: bold; } 81 | 82 | .lit { 83 | color: #044; } 84 | 85 | .pun, .opn, .clo { 86 | color: #440; } 87 | 88 | .tag { 89 | color: #006; 90 | font-weight: bold; } 91 | 92 | .atn { 93 | color: #404; } 94 | 95 | .atv { 96 | color: #060; } } 97 | /* Style */ 98 | /* 99 | pre.prettyprint { 100 | background: white; 101 | font-family: Consolas, Monaco, 'Andale Mono', monospace; 102 | font-size: 12px; 103 | line-height: 1.5; 104 | border: 1px solid #ccc; 105 | padding: 10px; } 106 | */ 107 | 108 | /* Specify class=linenums on a pre to get line numbering */ 109 | ol.linenums { 110 | margin-top: 0; 111 | margin-bottom: 0; } 112 | 113 | /* IE indents via margin-left */ 114 | li.L0, 115 | li.L1, 116 | li.L2, 117 | li.L3, 118 | li.L4, 119 | li.L5, 120 | li.L6, 121 | li.L7, 122 | li.L8, 123 | li.L9 { 124 | /* */ } 125 | 126 | /* Alternate shading for lines */ 127 | li.L1, 128 | li.L3, 129 | li.L5, 130 | li.L7, 131 | li.L9 { 132 | /* */ } 133 | -------------------------------------------------------------------------------- /docs/css/style.css: -------------------------------------------------------------------------------- 1 | @import url(https://fonts.googleapis.com/css?family=Roboto:400,300,700); 2 | @import url(https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic,600,700); 3 | 4 | * { 5 | margin: 0; 6 | padding: 0; 7 | text-decoration: none; 8 | } 9 | 10 | html 11 | { 12 | font-family: 'Source Sans Pro', 'Roboto', sans-serif; 13 | overflow: auto; 14 | /*font-size: 14px;*/ 15 | /*color: #4d4e53;*/ 16 | /*color: rgba(0, 0, 0, .68);*/ 17 | color: #555; 18 | background-color: #fff; 19 | } 20 | 21 | a { 22 | /*color: #0095dd;*/ 23 | /*color:rgb(37, 138, 175);*/ 24 | color: #039BE5; 25 | } 26 | 27 | code a:hover { 28 | text-decoration: underline; 29 | } 30 | 31 | ul, ol { 32 | padding-left: 20px; 33 | } 34 | 35 | ul li { 36 | list-style: disc; 37 | margin: 4px 0; 38 | } 39 | 40 | ol li { 41 | margin: 4px 0; 42 | } 43 | 44 | h1 { 45 | margin-bottom: 10px; 46 | font-size: 34px; 47 | font-weight: 300; 48 | border-bottom: solid 1px #ddd; 49 | } 50 | 51 | h2 { 52 | margin-top: 24px; 53 | margin-bottom: 10px; 54 | font-size: 20px; 55 | border-bottom: solid 1px #ddd; 56 | font-weight: 300; 57 | } 58 | 59 | h3 { 60 | position: relative; 61 | font-size: 16px; 62 | margin-bottom: 12px; 63 | background-color: #E2E2E2; 64 | padding: 4px; 65 | font-weight: 300; 66 | } 67 | 68 | del { 69 | text-decoration: line-through; 70 | } 71 | 72 | p { 73 | margin-bottom: 15px; 74 | line-height: 1.5; 75 | } 76 | 77 | pre > code { 78 | display: block; 79 | } 80 | 81 | pre.prettyprint, pre > code { 82 | padding: 4px; 83 | margin: 1em 0; 84 | background-color: #f5f5f5; 85 | border-radius: 3px; 86 | } 87 | 88 | pre.prettyprint > code { 89 | margin: 0; 90 | } 91 | 92 | p > code, 93 | li > code { 94 | padding: 0.2em 0.5em; 95 | margin: 0; 96 | font-size: 85%; 97 | background-color: rgba(0,0,0,0.04); 98 | border-radius: 3px; 99 | } 100 | 101 | .import-path pre.prettyprint, 102 | .import-path pre.prettyprint code { 103 | margin: 0; 104 | padding: 0; 105 | border: none; 106 | background: white; 107 | } 108 | 109 | .layout-container { 110 | /*display: flex;*/ 111 | /*flex-direction: row;*/ 112 | /*justify-content: flex-start;*/ 113 | /*align-items: stretch;*/ 114 | } 115 | 116 | .layout-container > header { 117 | height: 40px; 118 | line-height: 40px; 119 | font-size: 16px; 120 | padding: 0 10px; 121 | margin: 0; 122 | position: fixed; 123 | width: 100%; 124 | z-index: 1; 125 | background-color: #fafafa; 126 | top: 0; 127 | border-bottom: solid 1px #ddd; 128 | } 129 | .layout-container > header > a{ 130 | margin: 0 5px; 131 | color: #444; 132 | } 133 | 134 | .layout-container > header > a.repo-url-github { 135 | font-size: 0; 136 | display: inline-block; 137 | width: 20px; 138 | height: 38px; 139 | background: url("../image/github.png") no-repeat center; 140 | background-size: 20px; 141 | vertical-align: top; 142 | } 143 | 144 | .navigation { 145 | position: fixed; 146 | top: 0; 147 | left: 0; 148 | box-sizing: border-box; 149 | width: 250px; 150 | height: 100%; 151 | padding-top: 40px; 152 | padding-left: 15px; 153 | padding-bottom: 2em; 154 | margin-top:1em; 155 | overflow-x: scroll; 156 | box-shadow: rgba(255, 255, 255, 1) -1px 0 0 inset; 157 | border-right: 1px solid #ddd; 158 | } 159 | 160 | .navigation ul { 161 | padding: 0; 162 | } 163 | 164 | .navigation li { 165 | list-style: none; 166 | margin: 4px 0; 167 | white-space: nowrap; 168 | } 169 | 170 | .navigation li a { 171 | color: #666; 172 | } 173 | 174 | .navigation .nav-dir-path { 175 | margin-top: 0.7em; 176 | margin-bottom: 0.25em; 177 | font-size: 0.8em; 178 | color: #aaa; 179 | } 180 | 181 | .kind-class, 182 | .kind-interface, 183 | .kind-function, 184 | .kind-typedef, 185 | .kind-variable, 186 | .kind-external { 187 | margin-left: 0.75em; 188 | width: 1.2em; 189 | height: 1.2em; 190 | display: inline-block; 191 | text-align: center; 192 | border-radius: 0.2em; 193 | margin-right: 0.2em; 194 | font-weight: bold; 195 | } 196 | 197 | .kind-class { 198 | color: #009800; 199 | background-color: #bfe5bf; 200 | } 201 | 202 | .kind-interface { 203 | color: #fbca04; 204 | background-color: #fef2c0; 205 | } 206 | 207 | .kind-function { 208 | color: #6b0090; 209 | background-color: #d6bdde; 210 | } 211 | 212 | .kind-variable { 213 | color: #eb6420; 214 | background-color: #fad8c7; 215 | } 216 | 217 | .kind-typedef { 218 | color: #db001e; 219 | background-color: #edbec3; 220 | } 221 | 222 | .kind-external { 223 | color: #0738c3; 224 | background-color: #bbcbea; 225 | } 226 | 227 | h1 .version, 228 | h1 .url a { 229 | font-size: 14px; 230 | color: #aaa; 231 | } 232 | 233 | .content { 234 | margin-top: 40px; 235 | margin-left: 250px; 236 | padding: 10px 50px 10px 20px; 237 | } 238 | 239 | .header-notice { 240 | font-size: 14px; 241 | color: #aaa; 242 | margin: 0; 243 | } 244 | 245 | .expression-extends .prettyprint { 246 | margin-left: 10px; 247 | background: white; 248 | } 249 | 250 | .extends-chain { 251 | border-bottom: 1px solid#ddd; 252 | padding-bottom: 10px; 253 | margin-bottom: 10px; 254 | } 255 | 256 | .extends-chain span:nth-of-type(1) { 257 | padding-left: 10px; 258 | } 259 | 260 | .extends-chain > div { 261 | margin: 5px 0; 262 | } 263 | 264 | .description table { 265 | font-size: 14px; 266 | border-spacing: 0; 267 | border: 0; 268 | border-collapse: collapse; 269 | } 270 | 271 | .description thead { 272 | background: #999; 273 | color: white; 274 | } 275 | 276 | .description table td, 277 | .description table th { 278 | border: solid 1px #ddd; 279 | padding: 4px; 280 | font-weight: normal; 281 | } 282 | 283 | .flat-list ul { 284 | padding-left: 0; 285 | } 286 | 287 | .flat-list li { 288 | display: inline; 289 | list-style: none; 290 | } 291 | 292 | table.summary { 293 | width: 100%; 294 | margin: 10px 0; 295 | border-spacing: 0; 296 | border: 0; 297 | border-collapse: collapse; 298 | } 299 | 300 | table.summary thead { 301 | background: #999; 302 | color: white; 303 | } 304 | 305 | table.summary td { 306 | border: solid 1px #ddd; 307 | padding: 4px 10px; 308 | } 309 | 310 | table.summary tbody td:nth-child(1) { 311 | text-align: right; 312 | white-space: nowrap; 313 | min-width: 64px; 314 | vertical-align: top; 315 | } 316 | 317 | table.summary tbody td:nth-child(2) { 318 | width: 100%; 319 | border-right: none; 320 | } 321 | 322 | table.summary tbody td:nth-child(3) { 323 | white-space: nowrap; 324 | border-left: none; 325 | vertical-align: top; 326 | } 327 | 328 | table.summary td > div:nth-of-type(2) { 329 | padding-top: 4px; 330 | padding-left: 15px; 331 | } 332 | 333 | table.summary td p { 334 | margin-bottom: 0; 335 | } 336 | 337 | .inherited-summary thead td { 338 | padding-left: 2px; 339 | } 340 | 341 | .inherited-summary thead a { 342 | color: white; 343 | } 344 | 345 | .inherited-summary .summary tbody { 346 | display: none; 347 | } 348 | 349 | .inherited-summary .summary .toggle { 350 | padding: 0 4px; 351 | font-size: 12px; 352 | cursor: pointer; 353 | } 354 | .inherited-summary .summary .toggle.closed:before { 355 | content: "▶"; 356 | } 357 | .inherited-summary .summary .toggle.opened:before { 358 | content: "▼"; 359 | } 360 | 361 | .member, .method { 362 | margin-bottom: 24px; 363 | } 364 | 365 | table.params { 366 | width: 100%; 367 | margin: 10px 0; 368 | border-spacing: 0; 369 | border: 0; 370 | border-collapse: collapse; 371 | } 372 | 373 | table.params thead { 374 | background: #eee; 375 | color: #aaa; 376 | } 377 | 378 | table.params td { 379 | padding: 4px; 380 | border: solid 1px #ddd; 381 | } 382 | 383 | table.params td p { 384 | margin: 0; 385 | } 386 | 387 | .content .detail > * { 388 | margin: 15px 0; 389 | } 390 | 391 | .content .detail > h3 { 392 | color: black; 393 | } 394 | 395 | .content .detail > div { 396 | margin-left: 10px; 397 | } 398 | 399 | .content .detail > .import-path { 400 | margin-top: -8px; 401 | } 402 | 403 | .content .detail + .detail { 404 | margin-top: 30px; 405 | } 406 | 407 | .content .detail .throw td:first-child { 408 | padding-right: 10px; 409 | } 410 | 411 | .content .detail h4 + :not(pre) { 412 | padding-left: 0; 413 | margin-left: 10px; 414 | } 415 | 416 | .content .detail h4 + ul li { 417 | list-style: none; 418 | } 419 | 420 | .return-param * { 421 | display: inline; 422 | } 423 | 424 | .argument-params { 425 | margin-bottom: 20px; 426 | } 427 | 428 | .return-type { 429 | padding-right: 10px; 430 | font-weight: normal; 431 | } 432 | 433 | .return-desc { 434 | margin-left: 10px; 435 | margin-top: 4px; 436 | } 437 | 438 | .return-desc p { 439 | margin: 0; 440 | } 441 | 442 | .deprecated, .experimental, .instance-docs { 443 | border-left: solid 5px orange; 444 | padding-left: 4px; 445 | margin: 4px 0; 446 | } 447 | 448 | tr.listen p, 449 | tr.throw p, 450 | tr.emit p{ 451 | margin-bottom: 10px; 452 | } 453 | 454 | .version, .since { 455 | color: #aaa; 456 | } 457 | 458 | h3 .right-info { 459 | position: absolute; 460 | right: 4px; 461 | font-size: 14px; 462 | } 463 | 464 | .version + .since:before { 465 | content: '| '; 466 | } 467 | 468 | .see { 469 | margin-top: 10px; 470 | } 471 | 472 | .see h4 { 473 | margin: 4px 0; 474 | } 475 | 476 | .content .detail h4 + .example-doc { 477 | margin: 6px 0; 478 | } 479 | 480 | .example-caption { 481 | position: relative; 482 | bottom: -1px; 483 | display: inline-block; 484 | padding: 4px; 485 | font-style: italic; 486 | background-color: #f5f5f5; 487 | font-weight: bold; 488 | border-radius: 3px; 489 | border-bottom-left-radius: 0; 490 | border-bottom-right-radius: 0; 491 | } 492 | 493 | .example-caption + pre.source-code { 494 | margin-top: 0; 495 | border-top-left-radius: 0; 496 | } 497 | 498 | footer, .file-footer { 499 | text-align: right; 500 | font-style: italic; 501 | font-weight: 100; 502 | font-size: 13px; 503 | margin-right: 50px; 504 | margin-left: 270px; 505 | border-top: 1px solid #ddd; 506 | padding-top: 30px; 507 | margin-top: 20px; 508 | padding-bottom: 10px; 509 | } 510 | 511 | footer img { 512 | width: 24px; 513 | vertical-align: middle; 514 | padding-left: 4px; 515 | position: relative; 516 | top: -3px; 517 | opacity: 0.6; 518 | } 519 | 520 | pre.source-code { 521 | background: #f5f5f5; 522 | padding: 4px; 523 | } 524 | 525 | pre.raw-source-code > code { 526 | padding: 0; 527 | margin: 0; 528 | } 529 | 530 | pre.source-code.line-number { 531 | padding: 0; 532 | } 533 | 534 | pre.source-code ol { 535 | background: #eee; 536 | padding-left: 40px; 537 | } 538 | 539 | pre.source-code li { 540 | background: white; 541 | padding-left: 4px; 542 | list-style: decimal; 543 | margin: 0; 544 | } 545 | 546 | pre.source-code.line-number li.active { 547 | background: rgb(255, 255, 150); 548 | } 549 | 550 | pre.source-code.line-number li.error-line { 551 | background: #ffb8bf; 552 | } 553 | 554 | table.files-summary { 555 | width: 100%; 556 | margin: 10px 0; 557 | border-spacing: 0; 558 | border: 0; 559 | border-collapse: collapse; 560 | text-align: right; 561 | } 562 | 563 | table.files-summary tbody tr:hover { 564 | background: #eee; 565 | } 566 | 567 | table.files-summary td:first-child, 568 | table.files-summary td:nth-of-type(2) { 569 | text-align: left; 570 | } 571 | 572 | table.files-summary[data-use-coverage="false"] td.coverage { 573 | display: none; 574 | } 575 | 576 | table.files-summary thead { 577 | background: #999; 578 | color: white; 579 | } 580 | 581 | table.files-summary td { 582 | border: solid 1px #ddd; 583 | padding: 4px 10px; 584 | vertical-align: top; 585 | } 586 | 587 | table.files-summary td.identifiers > span { 588 | display: block; 589 | margin-top: 4px; 590 | } 591 | table.files-summary td.identifiers > span:first-child { 592 | margin-top: 0; 593 | } 594 | 595 | table.files-summary .coverage-count { 596 | font-size: 12px; 597 | color: #aaa; 598 | display: inline-block; 599 | min-width: 40px; 600 | } 601 | 602 | .total-coverage-count { 603 | position: relative; 604 | bottom: 2px; 605 | font-size: 12px; 606 | color: #666; 607 | font-weight: 500; 608 | padding-left: 5px; 609 | } 610 | 611 | table.test-summary thead { 612 | background: #999; 613 | color: white; 614 | } 615 | 616 | table.test-summary thead .test-description { 617 | width: 50%; 618 | } 619 | 620 | table.test-summary { 621 | width: 100%; 622 | margin: 10px 0; 623 | border-spacing: 0; 624 | border: 0; 625 | border-collapse: collapse; 626 | } 627 | 628 | table.test-summary thead .test-count { 629 | width: 3em; 630 | } 631 | 632 | table.test-summary tbody tr:hover { 633 | background-color: #eee; 634 | } 635 | 636 | table.test-summary td { 637 | border: solid 1px #ddd; 638 | padding: 4px 10px; 639 | vertical-align: top; 640 | } 641 | 642 | table.test-summary td p { 643 | margin: 0; 644 | } 645 | 646 | table.test-summary tr.test-describe .toggle { 647 | display: inline-block; 648 | float: left; 649 | margin-right: 4px; 650 | cursor: pointer; 651 | font-size: 0.8em; 652 | padding-top: 0.25em; 653 | } 654 | 655 | table.test-summary tr.test-describe .toggle.opened:before { 656 | content: '▼'; 657 | } 658 | 659 | table.test-summary tr.test-describe .toggle.closed:before { 660 | content: '▶'; 661 | } 662 | 663 | table.test-summary .test-target > span { 664 | display: block; 665 | margin-top: 4px; 666 | } 667 | table.test-summary .test-target > span:first-child { 668 | margin-top: 0; 669 | } 670 | 671 | .inner-link-active { 672 | background: rgb(255, 255, 150); 673 | } 674 | 675 | /* search box */ 676 | .search-box { 677 | position: absolute; 678 | top: 10px; 679 | right: 50px; 680 | padding-right: 8px; 681 | padding-bottom: 10px; 682 | line-height: normal; 683 | font-size: 12px; 684 | } 685 | 686 | .search-box img { 687 | width: 20px; 688 | vertical-align: top; 689 | } 690 | 691 | .search-input { 692 | display: inline; 693 | visibility: hidden; 694 | width: 0; 695 | padding: 2px; 696 | height: 1.5em; 697 | outline: none; 698 | background: transparent; 699 | border: 1px #0af; 700 | border-style: none none solid none; 701 | vertical-align: bottom; 702 | } 703 | 704 | .search-input-edge { 705 | display: none; 706 | width: 1px; 707 | height: 5px; 708 | background-color: #0af; 709 | vertical-align: bottom; 710 | } 711 | 712 | .search-result { 713 | position: absolute; 714 | display: none; 715 | height: 600px; 716 | width: 100%; 717 | padding: 0; 718 | margin-top: 5px; 719 | margin-left: 24px; 720 | background: white; 721 | box-shadow: 1px 1px 4px rgb(0,0,0); 722 | white-space: nowrap; 723 | overflow-y: scroll; 724 | } 725 | 726 | .search-result-import-path { 727 | color: #aaa; 728 | font-size: 12px; 729 | } 730 | 731 | .search-result li { 732 | list-style: none; 733 | padding: 2px 4px; 734 | } 735 | 736 | .search-result li a { 737 | display: block; 738 | } 739 | 740 | .search-result li.selected { 741 | background: #ddd; 742 | } 743 | 744 | .search-result li.search-separator { 745 | background: rgb(37, 138, 175); 746 | color: white; 747 | } 748 | 749 | .search-box.active .search-input { 750 | visibility: visible; 751 | transition: width 0.2s ease-out; 752 | width: 300px; 753 | } 754 | 755 | .search-box.active .search-input-edge { 756 | display: inline-block; 757 | } 758 | 759 | .github-markdown .manual-toc { 760 | padding-left: 0; 761 | } 762 | 763 | /** manual */ 764 | 765 | .manual-index .manual-cards { 766 | display: flex; 767 | flex-wrap: wrap; 768 | } 769 | 770 | .manual-index .manual-card-wrap { 771 | width: 280px; 772 | padding: 10px 20px 10px 0; 773 | box-sizing: border-box; 774 | } 775 | 776 | .manual-index .manual-card-wrap > h1 { 777 | margin: 0; 778 | font-size: 1em; 779 | font-weight: 600; 780 | padding: 0.2em 0 0.2em 0.5em; 781 | border-radius: 0.1em 0.1em 0 0; 782 | border: none; 783 | } 784 | 785 | .manual-index .manual-card-wrap > h1 span { 786 | color: #555; 787 | } 788 | 789 | .manual-index .manual-card { 790 | height: 200px; 791 | overflow: hidden; 792 | border: solid 1px rgba(230, 230, 230, 0.84); 793 | border-radius: 0 0 0.1em 0.1em; 794 | padding: 8px; 795 | position: relative; 796 | border-top: none; 797 | } 798 | 799 | .manual-index .manual-card > div { 800 | transform: scale(0.4); 801 | transform-origin: 0 0; 802 | width: 250%; 803 | } 804 | 805 | .manual-index .manual-card > a { 806 | position: absolute; 807 | top: 0; 808 | left: 0; 809 | width: 100%; 810 | height: 100%; 811 | background: rgba(210, 210, 210, 0.1); 812 | } 813 | 814 | .manual-index .manual-card > a:hover { 815 | background: none; 816 | } 817 | 818 | .manual-index .manual-badge { 819 | margin: 0; 820 | } 821 | 822 | .manual-index .manual-user-index { 823 | margin-bottom: 1em; 824 | border-bottom: solid 1px #ddd; 825 | } 826 | 827 | .manual-root .navigation { 828 | padding-left: 4px; 829 | margin-top: 4px; 830 | } 831 | 832 | .navigation .manual-toc { 833 | margin-top: -0.25em; 834 | } 835 | 836 | .navigation .manual-toc-root > div { 837 | padding-top: 1px; 838 | padding-left: 0.25em; 839 | padding-right: 0.75em; 840 | } 841 | 842 | .github-markdown .manual-toc-title a { 843 | color: inherit; 844 | } 845 | 846 | .manual-breadcrumb-list { 847 | font-size: 0.8em; 848 | margin-bottom: 1em; 849 | } 850 | 851 | .manual-toc-title a:hover { 852 | color: #039BE5; 853 | } 854 | 855 | .manual-toc li { 856 | margin: 0.75em 0; 857 | list-style-type: none; 858 | } 859 | 860 | .navigation .manual-toc [class^="indent-h"] a { 861 | color: #666; 862 | } 863 | 864 | .navigation .manual-toc .indent-h1 a { 865 | color: #555; 866 | font-weight: 600; 867 | display: block; 868 | } 869 | 870 | .manual-toc .indent-h1 { 871 | display: block; 872 | margin: 1em 0 0 0.25em; 873 | padding: 0.2em 0 0.2em 0.5em; 874 | border-radius: 0.1em; 875 | } 876 | .manual-toc .indent-h2 { 877 | display: none; 878 | margin-left: 1.5em; 879 | } 880 | .manual-toc .indent-h3 { 881 | display: none; 882 | margin-left: 2.5em; 883 | } 884 | .manual-toc .indent-h4 { 885 | display: none; 886 | margin-left: 3.5em; 887 | } 888 | .manual-toc .indent-h5 { 889 | display: none; 890 | margin-left: 4.5em; 891 | } 892 | 893 | .manual-color { 894 | position: relative; 895 | } 896 | 897 | .manual-color:after { 898 | content: attr(data-section-count); 899 | font-size: 0.5em; 900 | opacity: 0.5; 901 | position: absolute; 902 | right: 0.5em; 903 | top: 0.5em; 904 | } 905 | 906 | .manual-color-overview, 907 | .manual-color-design { 908 | color: #db001e; 909 | background-color: #edbec3; 910 | } 911 | 912 | .manual-color-installation, 913 | .manual-color-tutorial, 914 | .manual-color-usage, 915 | .manual-color-configuration, 916 | .manual-color-advanced { 917 | color: #009800; 918 | background-color: #bfe5bf; 919 | } 920 | 921 | .manual-color-example { 922 | color: #eb6420; 923 | background-color: #fad8c7; 924 | } 925 | 926 | .manual-color-reference { 927 | color: #6b0090; 928 | background-color: #d6bdde; 929 | } 930 | 931 | .manual-color-faq, 932 | .manual-color-changelog { 933 | color: #0738c3; 934 | background-color: #bbcbea; 935 | } 936 | 937 | .manual-nav li { 938 | margin: 0.75em 0; 939 | } 940 | 941 | /* github markdown */ 942 | .github-markdown { 943 | font-size: 16px; 944 | } 945 | 946 | .github-markdown h1, 947 | .github-markdown h2, 948 | .github-markdown h3, 949 | .github-markdown h4, 950 | .github-markdown h5 { 951 | margin-top: 1em; 952 | margin-bottom: 16px; 953 | font-weight: bold; 954 | padding: 0; 955 | } 956 | 957 | .github-markdown h1:nth-of-type(1) { 958 | margin-top: 0; 959 | } 960 | 961 | .github-markdown h1 { 962 | font-size: 2em; 963 | padding-bottom: 0.3em; 964 | } 965 | 966 | .github-markdown h2 { 967 | font-size: 1.75em; 968 | padding-bottom: 0.3em; 969 | } 970 | 971 | .github-markdown h3 { 972 | font-size: 1.5em; 973 | background-color: transparent; 974 | } 975 | 976 | .github-markdown h4 { 977 | font-size: 1.25em; 978 | } 979 | 980 | .github-markdown h5 { 981 | font-size: 1em; 982 | } 983 | 984 | .github-markdown ul, .github-markdown ol { 985 | padding-left: 2em; 986 | } 987 | 988 | .github-markdown pre > code { 989 | font-size: 0.85em; 990 | } 991 | 992 | .github-markdown table { 993 | margin-bottom: 1em; 994 | border-collapse: collapse; 995 | border-spacing: 0; 996 | } 997 | 998 | .github-markdown table tr { 999 | background-color: #fff; 1000 | border-top: 1px solid #ccc; 1001 | } 1002 | 1003 | .github-markdown table th, 1004 | .github-markdown table td { 1005 | padding: 6px 13px; 1006 | border: 1px solid #ddd; 1007 | } 1008 | 1009 | .github-markdown table tr:nth-child(2n) { 1010 | background-color: #f8f8f8; 1011 | } 1012 | 1013 | .github-markdown hr { 1014 | border-right: 0; 1015 | border-bottom: 1px solid #e5e5e5; 1016 | border-left: 0; 1017 | border-top: 0; 1018 | } 1019 | 1020 | /** badge(.svg) does not have border */ 1021 | .github-markdown img:not([src*=".svg"]) { 1022 | max-width: 100%; 1023 | box-shadow: 1px 1px 1px rgba(0,0,0,0.5); 1024 | } 1025 | -------------------------------------------------------------------------------- /docs/dump.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "__docId__": 0, 4 | "kind": "file", 5 | "name": "src/index.js", 6 | "content": "const PATTERN = /console\\.(log|error|warn|info)/g;\n\n/**\n * Danger plugin to prevent merging code that still has `console.log`s inside it.\n */\nexport default async function noConsole(options = {}) {\n const whitelist = options.whitelist || [];\n if (!Array.isArray(whitelist)) throw new Error('[danger-plugin-no-console] whitelist option has to be an array.');\n\n const files = danger.git.modified_files.concat(danger.git.created_files)\n const contents = await Promise.all(\n files.map(file => danger.github.utils.fileContents(file).then(content => ({\n file,\n content,\n })))\n )\n\n contents.forEach(({ file, content }) => {\n let matches = content.match(PATTERN);\n if (!matches) return;\n matches = matches.filter(match => !whitelist.includes(PATTERN.exec(match)[1]));\n if (matches.length === 0) return;\n\n fail(`${matches.length} console statement(s) left in ${file}.`);\n })\n}\n", 7 | "static": true, 8 | "longname": "src/index.js", 9 | "access": null, 10 | "description": null, 11 | "lineNumber": 1 12 | }, 13 | { 14 | "__docId__": 1, 15 | "kind": "variable", 16 | "name": "PATTERN", 17 | "memberof": "src/index.js", 18 | "static": true, 19 | "longname": "src/index.js~PATTERN", 20 | "access": null, 21 | "export": false, 22 | "importPath": "danger-plugin-no-console/src/index.js", 23 | "importStyle": null, 24 | "description": null, 25 | "lineNumber": 1, 26 | "undocument": true, 27 | "unknown": [ 28 | { 29 | "tagName": "@_undocument", 30 | "tagValue": "" 31 | } 32 | ], 33 | "type": { 34 | "types": [ 35 | "undefined" 36 | ] 37 | } 38 | }, 39 | { 40 | "__docId__": 2, 41 | "kind": "function", 42 | "name": "noConsole", 43 | "memberof": "src/index.js", 44 | "generator": false, 45 | "async": true, 46 | "static": true, 47 | "longname": "src/index.js~noConsole", 48 | "access": null, 49 | "export": true, 50 | "importPath": "danger-plugin-no-console/src/index.js", 51 | "importStyle": "noConsole", 52 | "description": "Danger plugin to prevent merging code that still has `console.log`s inside it.", 53 | "lineNumber": 6, 54 | "params": [ 55 | { 56 | "name": "options", 57 | "optional": true, 58 | "types": [ 59 | "{}" 60 | ], 61 | "defaultRaw": {}, 62 | "defaultValue": "{}" 63 | } 64 | ] 65 | }, 66 | { 67 | "__docId__": 3, 68 | "kind": "file", 69 | "name": "src/index.test.js", 70 | "content": "import noConsole from './';\n\nconst files = {\n 'src/log.js': 'function add(a, b) {\\n console.log(a, b);\\n return a + b;\\n}',\n 'src/clean.js': 'function add(a, b) {\\n return a + b;\\n}',\n 'src/error.js': 'function add(a, b) {\\n console.error(a, b);\\n return a + b;\\n}',\n}\n\nconst fileNames = Object.keys(files);\n\n// Mock the Danger API\nglobal.danger = {\n git: {\n modified_files: [fileNames[0], fileNames[1]],\n created_files: [fileNames[2]]\n },\n github: {\n utils: {\n fileContents: (path) => new Promise(res => {\n res(files[path])\n })\n }\n }\n}\n\nbeforeEach(() => {\n global.fail = jest.fn()\n})\n\nafterEach(() => {\n global.fail = undefined\n})\n\ndescribe('noConsole()', () => {\n it('should fail any files with a console.log in it', async () => {\n await noConsole();\n expect(global.fail).toHaveBeenCalledTimes(2);\n });\n\n it('should respect the whitelist of console properties', async () => {\n await noConsole({ whitelist: ['error'] });\n expect(global.fail).toHaveBeenCalledTimes(1);\n })\n})\n", 71 | "static": true, 72 | "longname": "src/index.test.js", 73 | "access": null, 74 | "description": null, 75 | "lineNumber": 1 76 | }, 77 | { 78 | "__docId__": 4, 79 | "kind": "variable", 80 | "name": "files", 81 | "memberof": "src/index.test.js", 82 | "static": true, 83 | "longname": "src/index.test.js~files", 84 | "access": null, 85 | "export": false, 86 | "importPath": "danger-plugin-no-console/src/index.test.js", 87 | "importStyle": null, 88 | "description": null, 89 | "lineNumber": 3, 90 | "undocument": true, 91 | "unknown": [ 92 | { 93 | "tagName": "@_undocument", 94 | "tagValue": "" 95 | } 96 | ], 97 | "type": { 98 | "types": [ 99 | "{\"src/log.js\": string, \"src/clean.js\": string, \"src/error.js\": string}" 100 | ] 101 | } 102 | }, 103 | { 104 | "__docId__": 5, 105 | "kind": "variable", 106 | "name": "fileNames", 107 | "memberof": "src/index.test.js", 108 | "static": true, 109 | "longname": "src/index.test.js~fileNames", 110 | "access": null, 111 | "export": false, 112 | "importPath": "danger-plugin-no-console/src/index.test.js", 113 | "importStyle": null, 114 | "description": null, 115 | "lineNumber": 9, 116 | "undocument": true, 117 | "unknown": [ 118 | { 119 | "tagName": "@_undocument", 120 | "tagValue": "" 121 | } 122 | ], 123 | "type": { 124 | "types": [ 125 | "*" 126 | ] 127 | } 128 | }, 129 | { 130 | "__docId__": 7, 131 | "kind": "external", 132 | "name": "Infinity", 133 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity", 134 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 135 | "static": true, 136 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Infinity", 137 | "access": null, 138 | "description": "", 139 | "builtinExternal": true 140 | }, 141 | { 142 | "__docId__": 8, 143 | "kind": "external", 144 | "name": "NaN", 145 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN", 146 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 147 | "static": true, 148 | "longname": "BuiltinExternal/ECMAScriptExternal.js~NaN", 149 | "access": null, 150 | "description": "", 151 | "builtinExternal": true 152 | }, 153 | { 154 | "__docId__": 9, 155 | "kind": "external", 156 | "name": "undefined", 157 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", 158 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 159 | "static": true, 160 | "longname": "BuiltinExternal/ECMAScriptExternal.js~undefined", 161 | "access": null, 162 | "description": "", 163 | "builtinExternal": true 164 | }, 165 | { 166 | "__docId__": 10, 167 | "kind": "external", 168 | "name": "null", 169 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null", 170 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 171 | "static": true, 172 | "longname": "BuiltinExternal/ECMAScriptExternal.js~null", 173 | "access": null, 174 | "description": "", 175 | "builtinExternal": true 176 | }, 177 | { 178 | "__docId__": 11, 179 | "kind": "external", 180 | "name": "Object", 181 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", 182 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 183 | "static": true, 184 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Object", 185 | "access": null, 186 | "description": "", 187 | "builtinExternal": true 188 | }, 189 | { 190 | "__docId__": 12, 191 | "kind": "external", 192 | "name": "object", 193 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", 194 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 195 | "static": true, 196 | "longname": "BuiltinExternal/ECMAScriptExternal.js~object", 197 | "access": null, 198 | "description": "", 199 | "builtinExternal": true 200 | }, 201 | { 202 | "__docId__": 13, 203 | "kind": "external", 204 | "name": "Function", 205 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", 206 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 207 | "static": true, 208 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Function", 209 | "access": null, 210 | "description": "", 211 | "builtinExternal": true 212 | }, 213 | { 214 | "__docId__": 14, 215 | "kind": "external", 216 | "name": "function", 217 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", 218 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 219 | "static": true, 220 | "longname": "BuiltinExternal/ECMAScriptExternal.js~function", 221 | "access": null, 222 | "description": "", 223 | "builtinExternal": true 224 | }, 225 | { 226 | "__docId__": 15, 227 | "kind": "external", 228 | "name": "Boolean", 229 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", 230 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 231 | "static": true, 232 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Boolean", 233 | "access": null, 234 | "description": "", 235 | "builtinExternal": true 236 | }, 237 | { 238 | "__docId__": 16, 239 | "kind": "external", 240 | "name": "boolean", 241 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", 242 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 243 | "static": true, 244 | "longname": "BuiltinExternal/ECMAScriptExternal.js~boolean", 245 | "access": null, 246 | "description": "", 247 | "builtinExternal": true 248 | }, 249 | { 250 | "__docId__": 17, 251 | "kind": "external", 252 | "name": "Symbol", 253 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol", 254 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 255 | "static": true, 256 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Symbol", 257 | "access": null, 258 | "description": "", 259 | "builtinExternal": true 260 | }, 261 | { 262 | "__docId__": 18, 263 | "kind": "external", 264 | "name": "Error", 265 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", 266 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 267 | "static": true, 268 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Error", 269 | "access": null, 270 | "description": "", 271 | "builtinExternal": true 272 | }, 273 | { 274 | "__docId__": 19, 275 | "kind": "external", 276 | "name": "EvalError", 277 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError", 278 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 279 | "static": true, 280 | "longname": "BuiltinExternal/ECMAScriptExternal.js~EvalError", 281 | "access": null, 282 | "description": "", 283 | "builtinExternal": true 284 | }, 285 | { 286 | "__docId__": 20, 287 | "kind": "external", 288 | "name": "InternalError", 289 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError", 290 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 291 | "static": true, 292 | "longname": "BuiltinExternal/ECMAScriptExternal.js~InternalError", 293 | "access": null, 294 | "description": "", 295 | "builtinExternal": true 296 | }, 297 | { 298 | "__docId__": 21, 299 | "kind": "external", 300 | "name": "RangeError", 301 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError", 302 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 303 | "static": true, 304 | "longname": "BuiltinExternal/ECMAScriptExternal.js~RangeError", 305 | "access": null, 306 | "description": "", 307 | "builtinExternal": true 308 | }, 309 | { 310 | "__docId__": 22, 311 | "kind": "external", 312 | "name": "ReferenceError", 313 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError", 314 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 315 | "static": true, 316 | "longname": "BuiltinExternal/ECMAScriptExternal.js~ReferenceError", 317 | "access": null, 318 | "description": "", 319 | "builtinExternal": true 320 | }, 321 | { 322 | "__docId__": 23, 323 | "kind": "external", 324 | "name": "SyntaxError", 325 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError", 326 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 327 | "static": true, 328 | "longname": "BuiltinExternal/ECMAScriptExternal.js~SyntaxError", 329 | "access": null, 330 | "description": "", 331 | "builtinExternal": true 332 | }, 333 | { 334 | "__docId__": 24, 335 | "kind": "external", 336 | "name": "TypeError", 337 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError", 338 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 339 | "static": true, 340 | "longname": "BuiltinExternal/ECMAScriptExternal.js~TypeError", 341 | "access": null, 342 | "description": "", 343 | "builtinExternal": true 344 | }, 345 | { 346 | "__docId__": 25, 347 | "kind": "external", 348 | "name": "URIError", 349 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError", 350 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 351 | "static": true, 352 | "longname": "BuiltinExternal/ECMAScriptExternal.js~URIError", 353 | "access": null, 354 | "description": "", 355 | "builtinExternal": true 356 | }, 357 | { 358 | "__docId__": 26, 359 | "kind": "external", 360 | "name": "Number", 361 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", 362 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 363 | "static": true, 364 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Number", 365 | "access": null, 366 | "description": "", 367 | "builtinExternal": true 368 | }, 369 | { 370 | "__docId__": 27, 371 | "kind": "external", 372 | "name": "number", 373 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", 374 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 375 | "static": true, 376 | "longname": "BuiltinExternal/ECMAScriptExternal.js~number", 377 | "access": null, 378 | "description": "", 379 | "builtinExternal": true 380 | }, 381 | { 382 | "__docId__": 28, 383 | "kind": "external", 384 | "name": "Date", 385 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", 386 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 387 | "static": true, 388 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Date", 389 | "access": null, 390 | "description": "", 391 | "builtinExternal": true 392 | }, 393 | { 394 | "__docId__": 29, 395 | "kind": "external", 396 | "name": "String", 397 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", 398 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 399 | "static": true, 400 | "longname": "BuiltinExternal/ECMAScriptExternal.js~String", 401 | "access": null, 402 | "description": "", 403 | "builtinExternal": true 404 | }, 405 | { 406 | "__docId__": 30, 407 | "kind": "external", 408 | "name": "string", 409 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", 410 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 411 | "static": true, 412 | "longname": "BuiltinExternal/ECMAScriptExternal.js~string", 413 | "access": null, 414 | "description": "", 415 | "builtinExternal": true 416 | }, 417 | { 418 | "__docId__": 31, 419 | "kind": "external", 420 | "name": "RegExp", 421 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp", 422 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 423 | "static": true, 424 | "longname": "BuiltinExternal/ECMAScriptExternal.js~RegExp", 425 | "access": null, 426 | "description": "", 427 | "builtinExternal": true 428 | }, 429 | { 430 | "__docId__": 32, 431 | "kind": "external", 432 | "name": "Array", 433 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", 434 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 435 | "static": true, 436 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Array", 437 | "access": null, 438 | "description": "", 439 | "builtinExternal": true 440 | }, 441 | { 442 | "__docId__": 33, 443 | "kind": "external", 444 | "name": "Int8Array", 445 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array", 446 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 447 | "static": true, 448 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Int8Array", 449 | "access": null, 450 | "description": "", 451 | "builtinExternal": true 452 | }, 453 | { 454 | "__docId__": 34, 455 | "kind": "external", 456 | "name": "Uint8Array", 457 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array", 458 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 459 | "static": true, 460 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint8Array", 461 | "access": null, 462 | "description": "", 463 | "builtinExternal": true 464 | }, 465 | { 466 | "__docId__": 35, 467 | "kind": "external", 468 | "name": "Uint8ClampedArray", 469 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray", 470 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 471 | "static": true, 472 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint8ClampedArray", 473 | "access": null, 474 | "description": "", 475 | "builtinExternal": true 476 | }, 477 | { 478 | "__docId__": 36, 479 | "kind": "external", 480 | "name": "Int16Array", 481 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array", 482 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 483 | "static": true, 484 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Int16Array", 485 | "access": null, 486 | "description": "", 487 | "builtinExternal": true 488 | }, 489 | { 490 | "__docId__": 37, 491 | "kind": "external", 492 | "name": "Uint16Array", 493 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array", 494 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 495 | "static": true, 496 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint16Array", 497 | "access": null, 498 | "description": "", 499 | "builtinExternal": true 500 | }, 501 | { 502 | "__docId__": 38, 503 | "kind": "external", 504 | "name": "Int32Array", 505 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array", 506 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 507 | "static": true, 508 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Int32Array", 509 | "access": null, 510 | "description": "", 511 | "builtinExternal": true 512 | }, 513 | { 514 | "__docId__": 39, 515 | "kind": "external", 516 | "name": "Uint32Array", 517 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array", 518 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 519 | "static": true, 520 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Uint32Array", 521 | "access": null, 522 | "description": "", 523 | "builtinExternal": true 524 | }, 525 | { 526 | "__docId__": 40, 527 | "kind": "external", 528 | "name": "Float32Array", 529 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array", 530 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 531 | "static": true, 532 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Float32Array", 533 | "access": null, 534 | "description": "", 535 | "builtinExternal": true 536 | }, 537 | { 538 | "__docId__": 41, 539 | "kind": "external", 540 | "name": "Float64Array", 541 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array", 542 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 543 | "static": true, 544 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Float64Array", 545 | "access": null, 546 | "description": "", 547 | "builtinExternal": true 548 | }, 549 | { 550 | "__docId__": 42, 551 | "kind": "external", 552 | "name": "Map", 553 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map", 554 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 555 | "static": true, 556 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Map", 557 | "access": null, 558 | "description": "", 559 | "builtinExternal": true 560 | }, 561 | { 562 | "__docId__": 43, 563 | "kind": "external", 564 | "name": "Set", 565 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set", 566 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 567 | "static": true, 568 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Set", 569 | "access": null, 570 | "description": "", 571 | "builtinExternal": true 572 | }, 573 | { 574 | "__docId__": 44, 575 | "kind": "external", 576 | "name": "WeakMap", 577 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap", 578 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 579 | "static": true, 580 | "longname": "BuiltinExternal/ECMAScriptExternal.js~WeakMap", 581 | "access": null, 582 | "description": "", 583 | "builtinExternal": true 584 | }, 585 | { 586 | "__docId__": 45, 587 | "kind": "external", 588 | "name": "WeakSet", 589 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet", 590 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 591 | "static": true, 592 | "longname": "BuiltinExternal/ECMAScriptExternal.js~WeakSet", 593 | "access": null, 594 | "description": "", 595 | "builtinExternal": true 596 | }, 597 | { 598 | "__docId__": 46, 599 | "kind": "external", 600 | "name": "ArrayBuffer", 601 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer", 602 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 603 | "static": true, 604 | "longname": "BuiltinExternal/ECMAScriptExternal.js~ArrayBuffer", 605 | "access": null, 606 | "description": "", 607 | "builtinExternal": true 608 | }, 609 | { 610 | "__docId__": 47, 611 | "kind": "external", 612 | "name": "DataView", 613 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView", 614 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 615 | "static": true, 616 | "longname": "BuiltinExternal/ECMAScriptExternal.js~DataView", 617 | "access": null, 618 | "description": "", 619 | "builtinExternal": true 620 | }, 621 | { 622 | "__docId__": 48, 623 | "kind": "external", 624 | "name": "JSON", 625 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON", 626 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 627 | "static": true, 628 | "longname": "BuiltinExternal/ECMAScriptExternal.js~JSON", 629 | "access": null, 630 | "description": "", 631 | "builtinExternal": true 632 | }, 633 | { 634 | "__docId__": 49, 635 | "kind": "external", 636 | "name": "Promise", 637 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", 638 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 639 | "static": true, 640 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Promise", 641 | "access": null, 642 | "description": "", 643 | "builtinExternal": true 644 | }, 645 | { 646 | "__docId__": 50, 647 | "kind": "external", 648 | "name": "Generator", 649 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator", 650 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 651 | "static": true, 652 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Generator", 653 | "access": null, 654 | "description": "", 655 | "builtinExternal": true 656 | }, 657 | { 658 | "__docId__": 51, 659 | "kind": "external", 660 | "name": "GeneratorFunction", 661 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction", 662 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 663 | "static": true, 664 | "longname": "BuiltinExternal/ECMAScriptExternal.js~GeneratorFunction", 665 | "access": null, 666 | "description": "", 667 | "builtinExternal": true 668 | }, 669 | { 670 | "__docId__": 52, 671 | "kind": "external", 672 | "name": "Reflect", 673 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect", 674 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 675 | "static": true, 676 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Reflect", 677 | "access": null, 678 | "description": "", 679 | "builtinExternal": true 680 | }, 681 | { 682 | "__docId__": 53, 683 | "kind": "external", 684 | "name": "Proxy", 685 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy", 686 | "memberof": "BuiltinExternal/ECMAScriptExternal.js", 687 | "static": true, 688 | "longname": "BuiltinExternal/ECMAScriptExternal.js~Proxy", 689 | "access": null, 690 | "description": "", 691 | "lineNumber": 193, 692 | "builtinExternal": true 693 | }, 694 | { 695 | "__docId__": 55, 696 | "kind": "external", 697 | "name": "CanvasRenderingContext2D", 698 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D", 699 | "memberof": "BuiltinExternal/WebAPIExternal.js", 700 | "static": true, 701 | "longname": "BuiltinExternal/WebAPIExternal.js~CanvasRenderingContext2D", 702 | "access": null, 703 | "description": "", 704 | "builtinExternal": true 705 | }, 706 | { 707 | "__docId__": 56, 708 | "kind": "external", 709 | "name": "DocumentFragment", 710 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment", 711 | "memberof": "BuiltinExternal/WebAPIExternal.js", 712 | "static": true, 713 | "longname": "BuiltinExternal/WebAPIExternal.js~DocumentFragment", 714 | "access": null, 715 | "description": "", 716 | "builtinExternal": true 717 | }, 718 | { 719 | "__docId__": 57, 720 | "kind": "external", 721 | "name": "Element", 722 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Element", 723 | "memberof": "BuiltinExternal/WebAPIExternal.js", 724 | "static": true, 725 | "longname": "BuiltinExternal/WebAPIExternal.js~Element", 726 | "access": null, 727 | "description": "", 728 | "builtinExternal": true 729 | }, 730 | { 731 | "__docId__": 58, 732 | "kind": "external", 733 | "name": "Event", 734 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Event", 735 | "memberof": "BuiltinExternal/WebAPIExternal.js", 736 | "static": true, 737 | "longname": "BuiltinExternal/WebAPIExternal.js~Event", 738 | "access": null, 739 | "description": "", 740 | "builtinExternal": true 741 | }, 742 | { 743 | "__docId__": 59, 744 | "kind": "external", 745 | "name": "Node", 746 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/Node", 747 | "memberof": "BuiltinExternal/WebAPIExternal.js", 748 | "static": true, 749 | "longname": "BuiltinExternal/WebAPIExternal.js~Node", 750 | "access": null, 751 | "description": "", 752 | "builtinExternal": true 753 | }, 754 | { 755 | "__docId__": 60, 756 | "kind": "external", 757 | "name": "NodeList", 758 | "externalLink": "https://developer.mozilla.org/en-US/docs/Web/API/NodeList", 759 | "memberof": "BuiltinExternal/WebAPIExternal.js", 760 | "static": true, 761 | "longname": "BuiltinExternal/WebAPIExternal.js~NodeList", 762 | "access": null, 763 | "description": "", 764 | "builtinExternal": true 765 | }, 766 | { 767 | "__docId__": 61, 768 | "kind": "external", 769 | "name": "XMLHttpRequest", 770 | "externalLink": "https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest", 771 | "memberof": "BuiltinExternal/WebAPIExternal.js", 772 | "static": true, 773 | "longname": "BuiltinExternal/WebAPIExternal.js~XMLHttpRequest", 774 | "access": null, 775 | "description": "", 776 | "builtinExternal": true 777 | }, 778 | { 779 | "__docId__": 62, 780 | "kind": "external", 781 | "name": "AudioContext", 782 | "externalLink": "https://developer.mozilla.org/en/docs/Web/API/AudioContext", 783 | "memberof": "BuiltinExternal/WebAPIExternal.js", 784 | "static": true, 785 | "longname": "BuiltinExternal/WebAPIExternal.js~AudioContext", 786 | "access": null, 787 | "description": "", 788 | "lineNumber": 34, 789 | "builtinExternal": true 790 | } 791 | ] -------------------------------------------------------------------------------- /docs/file/src/index.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | src/index.js | API Document 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | Home 18 | 19 | Reference 20 | Source 21 | 22 | Repository 23 | 30 |
31 | 32 | 39 | 40 |

src/index.js

41 |
const PATTERN = /console\.(log|error|warn|info)/g;
42 | 
43 | /**
44 |  * Danger plugin to prevent merging code that still has `console.log`s inside it.
45 |  */
46 | export default async function noConsole(options = {}) {
47 |   const whitelist = options.whitelist || [];
48 |   if (!Array.isArray(whitelist)) throw new Error('[danger-plugin-no-console] whitelist option has to be an array.');
49 | 
50 |   const files = danger.git.modified_files.concat(danger.git.created_files)
51 |   const contents = await Promise.all(
52 |     files.map(file => danger.github.utils.fileContents(file).then(content => ({
53 |       file,
54 |       content,
55 |     })))
56 |   )
57 | 
58 |   contents.forEach(({ file, content }) => {
59 |     let matches = content.match(PATTERN);
60 |     if (!matches) return;
61 |     matches = matches.filter(match => !whitelist.includes(PATTERN.exec(match)[1]));
62 |     if (matches.length === 0) return;
63 | 
64 |     fail(`${matches.length} console statement(s) left in ${file}.`);
65 |   })
66 | }
67 | 
68 | 69 |
70 | 71 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /docs/file/src/index.test.js.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | src/index.test.js | API Document 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | Home 18 | 19 | Reference 20 | Source 21 | 22 | Repository 23 | 30 |
31 | 32 | 39 | 40 |

src/index.test.js

41 |
import noConsole from './';
 42 | 
 43 | const files = {
 44 |   'src/log.js': 'function add(a, b) {\n  console.log(a, b);\n  return a + b;\n}',
 45 |   'src/clean.js': 'function add(a, b) {\n  return a + b;\n}',
 46 |   'src/error.js': 'function add(a, b) {\n  console.error(a, b);\n  return a + b;\n}',
 47 | }
 48 | 
 49 | const fileNames = Object.keys(files);
 50 | 
 51 | // Mock the Danger API
 52 | global.danger = {
 53 |   git: {
 54 |     modified_files: [fileNames[0], fileNames[1]],
 55 |     created_files: [fileNames[2]]
 56 |   },
 57 |   github: {
 58 |     utils: {
 59 |       fileContents: (path) => new Promise(res => {
 60 |         res(files[path])
 61 |       })
 62 |     }
 63 |   }
 64 | }
 65 | 
 66 | beforeEach(() => {
 67 |   global.fail = jest.fn()
 68 | })
 69 | 
 70 | afterEach(() => {
 71 |   global.fail = undefined
 72 | })
 73 | 
 74 | describe('noConsole()', () => {
 75 |   it('should fail any files with a console.log in it', async () => {
 76 |     await noConsole();
 77 |     expect(global.fail).toHaveBeenCalledTimes(2);
 78 |   });
 79 | 
 80 |   it('should respect the whitelist of console properties', async () => {
 81 |     await noConsole({ whitelist: ['error'] });
 82 |     expect(global.fail).toHaveBeenCalledTimes(1);
 83 |   })
 84 | })
 85 | 
86 | 87 |
88 | 89 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /docs/function/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Function | API Document 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | Home 18 | 19 | Reference 20 | Source 21 | 22 | Repository 23 | 30 |
31 | 32 | 39 | 40 |

Function

41 |
42 | 43 | 44 | 45 | 46 | 53 | 68 | 72 | 73 | 74 |
Static Public Summary
47 | public 48 | 49 | 50 | 51 | 52 | 54 |
55 |

56 | async 57 | 58 | noConsole(options: {}) 59 |

60 |
61 |
62 | 63 | 64 |

Danger plugin to prevent merging code that still has console.logs inside it.

65 |
66 |
67 |
69 | 70 | 71 |
75 |
76 |

Static Public

77 | 78 |
79 |

80 | public 81 | 82 | 83 | 84 | async 85 | 86 | noConsole(options: {}) 87 | 88 | 89 | 90 | source 91 | 92 |

93 | 94 | 95 | 96 | 97 |

Danger plugin to prevent merging code that still has console.logs inside it.

98 |
99 | 100 | 101 | 102 |
103 |

Params:

104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 115 | 116 | 117 | 118 |
NameTypeAttributeDescription
options{}
  • optional
  • 114 |
  • default: {}
119 |
120 |
121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 |
139 |
140 |
141 | 142 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /docs/identifiers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Index | API Document 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | Home 18 | 19 | Reference 20 | Source 21 | 22 | Repository 23 | 30 |
31 | 32 | 39 | 40 |

References

41 | 42 | 43 |

Function Summary

44 | 45 | 46 | 47 | 48 | 55 | 70 | 74 | 75 | 76 |
Static Public Function Summary
49 | public 50 | 51 | 52 | 53 | 54 | 56 |
57 |

58 | async 59 | 60 | noConsole(options: {}) 61 |

62 |
63 |
64 | 65 | 66 |

Danger plugin to prevent merging code that still has console.logs inside it.

67 |
68 |
69 |
71 | 72 | 73 |
77 |
78 | 79 | 80 | 81 |
82 | 83 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /docs/image/badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | document 13 | document 14 | @ratio@ 15 | @ratio@ 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/image/esdoc-logo-mini-black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withspectrum/danger-plugin-no-console/9d61179ad39b90dcc742615bd3f9a5711933b7b8/docs/image/esdoc-logo-mini-black.png -------------------------------------------------------------------------------- /docs/image/esdoc-logo-mini.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withspectrum/danger-plugin-no-console/9d61179ad39b90dcc742615bd3f9a5711933b7b8/docs/image/esdoc-logo-mini.png -------------------------------------------------------------------------------- /docs/image/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withspectrum/danger-plugin-no-console/9d61179ad39b90dcc742615bd3f9a5711933b7b8/docs/image/github.png -------------------------------------------------------------------------------- /docs/image/manual-badge.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | manual 13 | manual 14 | @value@ 15 | @value@ 16 | 17 | 18 | -------------------------------------------------------------------------------- /docs/image/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/withspectrum/danger-plugin-no-console/9d61179ad39b90dcc742615bd3f9a5711933b7b8/docs/image/search.png -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | API Document 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | Home 18 | 19 | Reference 20 | Source 21 | 22 | Repository 23 | 30 |
31 | 32 | 39 | 40 |

danger-plugin-no-console

41 |

Build Status 42 | npm version 43 | semantic-release

44 |
45 |

Danger plugin to prevent merging code that still has console.logs inside it.

46 |
47 |

Usage

48 |

Install:

49 |
yarn add danger-plugin-no-console --dev
50 | 
51 |

At a glance:

52 |
// dangerfile.js
53 | import noConsole from 'danger-plugin-no-console'
54 | 
55 | noConsole()
56 | 
57 |

Changelog

58 |

See the GitHub release history.

59 |

Contributing

60 |

See CONTRIBUTING.md.

61 |
62 |
63 | 64 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /docs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "danger-plugin-no-console", 3 | "description": "Danger plugin to prevent merging code that still has `console.log`s inside it.", 4 | "author": { 5 | "name": "Max Stoiber", 6 | "email": "contact@mxstbr.com" 7 | }, 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/withspectrum/danger-plugin-no-console.git" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/withspectrum/danger-plugin-no-console/issues" 14 | }, 15 | "homepage": "https://github.com/withspectrum/danger-plugin-no-console#readme", 16 | "keywords": [ 17 | "danger", 18 | "danger-plugin", 19 | "" 20 | ], 21 | "version": "0.0.0-development", 22 | "main": "dist/index.js", 23 | "types": "types/index.d.ts", 24 | "scripts": { 25 | "precommit": "lint-staged", 26 | "commit": "git-cz", 27 | "commitmsg": "validate-commit-msg", 28 | "build": "babel src --out-dir dist --ignore *.test.js", 29 | "test": "jest", 30 | "predocs": "rm -rf docs/", 31 | "docs": "esdoc -c .esdoc.json", 32 | "prepublish": "npm run build", 33 | "semantic-release": "semantic-release pre && npm publish && semantic-release post" 34 | }, 35 | "license": "MIT", 36 | "engines": { 37 | "node": ">=4.0.0" 38 | }, 39 | "devDependencies": { 40 | "babel-cli": "^6.24.1", 41 | "babel-jest": "^20.0.1", 42 | "babel-preset-env": "^1.4.0", 43 | "typings-tester": "^0.2.2", 44 | "commitizen": "^2.9.6", 45 | "cz-conventional-changelog": "^2.0.0", 46 | "husky": "^0.13.3", 47 | "jest": "^20.0.1", 48 | "lint-staged": "^3.4.1", 49 | "prettier": "^1.3.1", 50 | "semantic-release": "^6.3.6", 51 | "typescript": "^2.3.2", 52 | "validate-commit-msg": "^2.12.1" 53 | }, 54 | "optionalDependencies": { 55 | "esdoc": "^0.5.2" 56 | }, 57 | "config": { 58 | "commitizen": { 59 | "path": "cz-conventional-changelog" 60 | } 61 | }, 62 | "lint-staged": { 63 | "*.js": [ 64 | "prettier --single-quote --trailing-comma=all --no-semi --write", 65 | "git add" 66 | ] 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /docs/script/inherited-summary.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | function toggle(ev) { 3 | var button = ev.target; 4 | var parent = ev.target.parentElement; 5 | while(parent) { 6 | if (parent.tagName === 'TABLE' && parent.classList.contains('summary')) break; 7 | parent = parent.parentElement; 8 | } 9 | 10 | if (!parent) return; 11 | 12 | var tbody = parent.querySelector('tbody'); 13 | if (button.classList.contains('opened')) { 14 | button.classList.remove('opened'); 15 | button.classList.add('closed'); 16 | tbody.style.display = 'none'; 17 | } else { 18 | button.classList.remove('closed'); 19 | button.classList.add('opened'); 20 | tbody.style.display = 'block'; 21 | } 22 | } 23 | 24 | var buttons = document.querySelectorAll('.inherited-summary thead .toggle'); 25 | for (var i = 0; i < buttons.length; i++) { 26 | buttons[i].addEventListener('click', toggle); 27 | } 28 | })(); 29 | -------------------------------------------------------------------------------- /docs/script/inner-link.js: -------------------------------------------------------------------------------- 1 | // inner link(#foo) can not correctly scroll, because page has fixed header, 2 | // so, I manually scroll. 3 | (function(){ 4 | var matched = location.hash.match(/errorLines=([\d,]+)/); 5 | if (matched) return; 6 | 7 | function adjust() { 8 | window.scrollBy(0, -55); 9 | var el = document.querySelector('.inner-link-active'); 10 | if (el) el.classList.remove('inner-link-active'); 11 | 12 | // ``[ ] . ' " @`` are not valid in DOM id. so must escape these. 13 | var id = location.hash.replace(/([\[\].'"@$])/g, '\\$1'); 14 | var el = document.querySelector(id); 15 | if (el) el.classList.add('inner-link-active'); 16 | } 17 | 18 | window.addEventListener('hashchange', adjust); 19 | 20 | if (location.hash) { 21 | setTimeout(adjust, 0); 22 | } 23 | })(); 24 | 25 | (function(){ 26 | var els = document.querySelectorAll('[href^="#"]'); 27 | for (var i = 0; i < els.length; i++) { 28 | var el = els[i]; 29 | el.href = location.href + el.getAttribute('href'); // because el.href is absolute path 30 | } 31 | })(); 32 | -------------------------------------------------------------------------------- /docs/script/manual.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | var matched = location.pathname.match(/\/(manual\/.*?\/.*\.html)$/); 3 | if (!matched) return; 4 | 5 | var currentName = matched[1]; 6 | var cssClass = '.navigation .manual-toc li[data-link="' + currentName + '"]'; 7 | var styleText = cssClass + '{ display: block; }\n'; 8 | var style = document.createElement('style'); 9 | style.textContent = styleText; 10 | document.querySelector('head').appendChild(style); 11 | })(); 12 | -------------------------------------------------------------------------------- /docs/script/patch-for-local.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | if (location.protocol === 'file:') { 3 | var elms = document.querySelectorAll('a[href="./"]'); 4 | for (var i = 0; i < elms.length; i++) { 5 | elms[i].href = './index.html'; 6 | } 7 | } 8 | })(); 9 | -------------------------------------------------------------------------------- /docs/script/prettify/Apache-License-2.0.txt: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright [yyyy] [name of copyright owner] 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /docs/script/prettify/prettify.js: -------------------------------------------------------------------------------- 1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0; 2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a= 3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m), 9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/, 10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/, 11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g, 12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a), 13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e} 14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"], 18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"], 19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"], 20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+ 21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]), 22 | ["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css", 23 | /^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}), 24 | ["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes", 25 | hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b= 26 | !k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p' + pair[2] + ''); 35 | } 36 | } 37 | 38 | var innerHTML = ''; 39 | for (kind in html) { 40 | var list = html[kind]; 41 | if (!list.length) continue; 42 | innerHTML += '
  • ' + kind + '
  • \n' + list.join('\n'); 43 | } 44 | result.innerHTML = innerHTML; 45 | if (innerHTML) result.style.display = 'block'; 46 | selectedIndex = -1; 47 | }); 48 | 49 | // down, up and enter key are pressed, select search result. 50 | input.addEventListener('keydown', function(ev){ 51 | if (ev.keyCode === 40) { 52 | // arrow down 53 | var current = result.children[selectedIndex]; 54 | var selected = result.children[selectedIndex + 1]; 55 | if (selected && selected.classList.contains('search-separator')) { 56 | var selected = result.children[selectedIndex + 2]; 57 | selectedIndex++; 58 | } 59 | 60 | if (selected) { 61 | if (current) current.classList.remove('selected'); 62 | selectedIndex++; 63 | selected.classList.add('selected'); 64 | } 65 | } else if (ev.keyCode === 38) { 66 | // arrow up 67 | var current = result.children[selectedIndex]; 68 | var selected = result.children[selectedIndex - 1]; 69 | if (selected && selected.classList.contains('search-separator')) { 70 | var selected = result.children[selectedIndex - 2]; 71 | selectedIndex--; 72 | } 73 | 74 | if (selected) { 75 | if (current) current.classList.remove('selected'); 76 | selectedIndex--; 77 | selected.classList.add('selected'); 78 | } 79 | } else if (ev.keyCode === 13) { 80 | // enter 81 | var current = result.children[selectedIndex]; 82 | if (current) { 83 | var link = current.querySelector('a'); 84 | if (link) location.href = link.href; 85 | } 86 | } else { 87 | return; 88 | } 89 | 90 | ev.preventDefault(); 91 | }); 92 | 93 | // select search result when search result is mouse over. 94 | result.addEventListener('mousemove', function(ev){ 95 | var current = result.children[selectedIndex]; 96 | if (current) current.classList.remove('selected'); 97 | 98 | var li = ev.target; 99 | while (li) { 100 | if (li.nodeName === 'LI') break; 101 | li = li.parentElement; 102 | } 103 | 104 | if (li) { 105 | selectedIndex = Array.prototype.indexOf.call(result.children, li); 106 | li.classList.add('selected'); 107 | } 108 | }); 109 | 110 | // clear search result when body is clicked. 111 | document.body.addEventListener('click', function(ev){ 112 | selectedIndex = -1; 113 | result.style.display = 'none'; 114 | result.innerHTML = ''; 115 | }); 116 | 117 | })(); 118 | -------------------------------------------------------------------------------- /docs/script/search_index.js: -------------------------------------------------------------------------------- 1 | window.esdocSearchIndex = [ 2 | [ 3 | "danger-plugin-no-console/src/index.js~noconsole", 4 | "function/index.html#static-function-noConsole", 5 | "noConsole danger-plugin-no-console/src/index.js", 6 | "function" 7 | ], 8 | [ 9 | "builtinexternal/ecmascriptexternal.js~array", 10 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array", 11 | "BuiltinExternal/ECMAScriptExternal.js~Array", 12 | "external" 13 | ], 14 | [ 15 | "builtinexternal/ecmascriptexternal.js~arraybuffer", 16 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer", 17 | "BuiltinExternal/ECMAScriptExternal.js~ArrayBuffer", 18 | "external" 19 | ], 20 | [ 21 | "builtinexternal/ecmascriptexternal.js~boolean", 22 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", 23 | "BuiltinExternal/ECMAScriptExternal.js~Boolean", 24 | "external" 25 | ], 26 | [ 27 | "builtinexternal/ecmascriptexternal.js~dataview", 28 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView", 29 | "BuiltinExternal/ECMAScriptExternal.js~DataView", 30 | "external" 31 | ], 32 | [ 33 | "builtinexternal/ecmascriptexternal.js~date", 34 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date", 35 | "BuiltinExternal/ECMAScriptExternal.js~Date", 36 | "external" 37 | ], 38 | [ 39 | "builtinexternal/ecmascriptexternal.js~error", 40 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error", 41 | "BuiltinExternal/ECMAScriptExternal.js~Error", 42 | "external" 43 | ], 44 | [ 45 | "builtinexternal/ecmascriptexternal.js~evalerror", 46 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/EvalError", 47 | "BuiltinExternal/ECMAScriptExternal.js~EvalError", 48 | "external" 49 | ], 50 | [ 51 | "builtinexternal/ecmascriptexternal.js~float32array", 52 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array", 53 | "BuiltinExternal/ECMAScriptExternal.js~Float32Array", 54 | "external" 55 | ], 56 | [ 57 | "builtinexternal/ecmascriptexternal.js~float64array", 58 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array", 59 | "BuiltinExternal/ECMAScriptExternal.js~Float64Array", 60 | "external" 61 | ], 62 | [ 63 | "builtinexternal/ecmascriptexternal.js~function", 64 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", 65 | "BuiltinExternal/ECMAScriptExternal.js~Function", 66 | "external" 67 | ], 68 | [ 69 | "builtinexternal/ecmascriptexternal.js~generator", 70 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Generator", 71 | "BuiltinExternal/ECMAScriptExternal.js~Generator", 72 | "external" 73 | ], 74 | [ 75 | "builtinexternal/ecmascriptexternal.js~generatorfunction", 76 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/GeneratorFunction", 77 | "BuiltinExternal/ECMAScriptExternal.js~GeneratorFunction", 78 | "external" 79 | ], 80 | [ 81 | "builtinexternal/ecmascriptexternal.js~infinity", 82 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Infinity", 83 | "BuiltinExternal/ECMAScriptExternal.js~Infinity", 84 | "external" 85 | ], 86 | [ 87 | "builtinexternal/ecmascriptexternal.js~int16array", 88 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int16Array", 89 | "BuiltinExternal/ECMAScriptExternal.js~Int16Array", 90 | "external" 91 | ], 92 | [ 93 | "builtinexternal/ecmascriptexternal.js~int32array", 94 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int32Array", 95 | "BuiltinExternal/ECMAScriptExternal.js~Int32Array", 96 | "external" 97 | ], 98 | [ 99 | "builtinexternal/ecmascriptexternal.js~int8array", 100 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array", 101 | "BuiltinExternal/ECMAScriptExternal.js~Int8Array", 102 | "external" 103 | ], 104 | [ 105 | "builtinexternal/ecmascriptexternal.js~internalerror", 106 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/InternalError", 107 | "BuiltinExternal/ECMAScriptExternal.js~InternalError", 108 | "external" 109 | ], 110 | [ 111 | "builtinexternal/ecmascriptexternal.js~json", 112 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON", 113 | "BuiltinExternal/ECMAScriptExternal.js~JSON", 114 | "external" 115 | ], 116 | [ 117 | "builtinexternal/ecmascriptexternal.js~map", 118 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map", 119 | "BuiltinExternal/ECMAScriptExternal.js~Map", 120 | "external" 121 | ], 122 | [ 123 | "builtinexternal/ecmascriptexternal.js~nan", 124 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN", 125 | "BuiltinExternal/ECMAScriptExternal.js~NaN", 126 | "external" 127 | ], 128 | [ 129 | "builtinexternal/ecmascriptexternal.js~number", 130 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", 131 | "BuiltinExternal/ECMAScriptExternal.js~Number", 132 | "external" 133 | ], 134 | [ 135 | "builtinexternal/ecmascriptexternal.js~object", 136 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", 137 | "BuiltinExternal/ECMAScriptExternal.js~Object", 138 | "external" 139 | ], 140 | [ 141 | "builtinexternal/ecmascriptexternal.js~promise", 142 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise", 143 | "BuiltinExternal/ECMAScriptExternal.js~Promise", 144 | "external" 145 | ], 146 | [ 147 | "builtinexternal/ecmascriptexternal.js~proxy", 148 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy", 149 | "BuiltinExternal/ECMAScriptExternal.js~Proxy", 150 | "external" 151 | ], 152 | [ 153 | "builtinexternal/ecmascriptexternal.js~rangeerror", 154 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RangeError", 155 | "BuiltinExternal/ECMAScriptExternal.js~RangeError", 156 | "external" 157 | ], 158 | [ 159 | "builtinexternal/ecmascriptexternal.js~referenceerror", 160 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/ReferenceError", 161 | "BuiltinExternal/ECMAScriptExternal.js~ReferenceError", 162 | "external" 163 | ], 164 | [ 165 | "builtinexternal/ecmascriptexternal.js~reflect", 166 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect", 167 | "BuiltinExternal/ECMAScriptExternal.js~Reflect", 168 | "external" 169 | ], 170 | [ 171 | "builtinexternal/ecmascriptexternal.js~regexp", 172 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp", 173 | "BuiltinExternal/ECMAScriptExternal.js~RegExp", 174 | "external" 175 | ], 176 | [ 177 | "builtinexternal/ecmascriptexternal.js~set", 178 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set", 179 | "BuiltinExternal/ECMAScriptExternal.js~Set", 180 | "external" 181 | ], 182 | [ 183 | "builtinexternal/ecmascriptexternal.js~string", 184 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", 185 | "BuiltinExternal/ECMAScriptExternal.js~String", 186 | "external" 187 | ], 188 | [ 189 | "builtinexternal/ecmascriptexternal.js~symbol", 190 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol", 191 | "BuiltinExternal/ECMAScriptExternal.js~Symbol", 192 | "external" 193 | ], 194 | [ 195 | "builtinexternal/ecmascriptexternal.js~syntaxerror", 196 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SyntaxError", 197 | "BuiltinExternal/ECMAScriptExternal.js~SyntaxError", 198 | "external" 199 | ], 200 | [ 201 | "builtinexternal/ecmascriptexternal.js~typeerror", 202 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypeError", 203 | "BuiltinExternal/ECMAScriptExternal.js~TypeError", 204 | "external" 205 | ], 206 | [ 207 | "builtinexternal/ecmascriptexternal.js~urierror", 208 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/URIError", 209 | "BuiltinExternal/ECMAScriptExternal.js~URIError", 210 | "external" 211 | ], 212 | [ 213 | "builtinexternal/ecmascriptexternal.js~uint16array", 214 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint16Array", 215 | "BuiltinExternal/ECMAScriptExternal.js~Uint16Array", 216 | "external" 217 | ], 218 | [ 219 | "builtinexternal/ecmascriptexternal.js~uint32array", 220 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint32Array", 221 | "BuiltinExternal/ECMAScriptExternal.js~Uint32Array", 222 | "external" 223 | ], 224 | [ 225 | "builtinexternal/ecmascriptexternal.js~uint8array", 226 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array", 227 | "BuiltinExternal/ECMAScriptExternal.js~Uint8Array", 228 | "external" 229 | ], 230 | [ 231 | "builtinexternal/ecmascriptexternal.js~uint8clampedarray", 232 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8ClampedArray", 233 | "BuiltinExternal/ECMAScriptExternal.js~Uint8ClampedArray", 234 | "external" 235 | ], 236 | [ 237 | "builtinexternal/ecmascriptexternal.js~weakmap", 238 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap", 239 | "BuiltinExternal/ECMAScriptExternal.js~WeakMap", 240 | "external" 241 | ], 242 | [ 243 | "builtinexternal/ecmascriptexternal.js~weakset", 244 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakSet", 245 | "BuiltinExternal/ECMAScriptExternal.js~WeakSet", 246 | "external" 247 | ], 248 | [ 249 | "builtinexternal/ecmascriptexternal.js~boolean", 250 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean", 251 | "BuiltinExternal/ECMAScriptExternal.js~boolean", 252 | "external" 253 | ], 254 | [ 255 | "builtinexternal/ecmascriptexternal.js~function", 256 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function", 257 | "BuiltinExternal/ECMAScriptExternal.js~function", 258 | "external" 259 | ], 260 | [ 261 | "builtinexternal/ecmascriptexternal.js~null", 262 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null", 263 | "BuiltinExternal/ECMAScriptExternal.js~null", 264 | "external" 265 | ], 266 | [ 267 | "builtinexternal/ecmascriptexternal.js~number", 268 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number", 269 | "BuiltinExternal/ECMAScriptExternal.js~number", 270 | "external" 271 | ], 272 | [ 273 | "builtinexternal/ecmascriptexternal.js~object", 274 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object", 275 | "BuiltinExternal/ECMAScriptExternal.js~object", 276 | "external" 277 | ], 278 | [ 279 | "builtinexternal/ecmascriptexternal.js~string", 280 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String", 281 | "BuiltinExternal/ECMAScriptExternal.js~string", 282 | "external" 283 | ], 284 | [ 285 | "builtinexternal/ecmascriptexternal.js~undefined", 286 | "https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined", 287 | "BuiltinExternal/ECMAScriptExternal.js~undefined", 288 | "external" 289 | ], 290 | [ 291 | "builtinexternal/webapiexternal.js~audiocontext", 292 | "https://developer.mozilla.org/en/docs/Web/API/AudioContext", 293 | "BuiltinExternal/WebAPIExternal.js~AudioContext", 294 | "external" 295 | ], 296 | [ 297 | "builtinexternal/webapiexternal.js~canvasrenderingcontext2d", 298 | "https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D", 299 | "BuiltinExternal/WebAPIExternal.js~CanvasRenderingContext2D", 300 | "external" 301 | ], 302 | [ 303 | "builtinexternal/webapiexternal.js~documentfragment", 304 | "https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment", 305 | "BuiltinExternal/WebAPIExternal.js~DocumentFragment", 306 | "external" 307 | ], 308 | [ 309 | "builtinexternal/webapiexternal.js~element", 310 | "https://developer.mozilla.org/en-US/docs/Web/API/Element", 311 | "BuiltinExternal/WebAPIExternal.js~Element", 312 | "external" 313 | ], 314 | [ 315 | "builtinexternal/webapiexternal.js~event", 316 | "https://developer.mozilla.org/en-US/docs/Web/API/Event", 317 | "BuiltinExternal/WebAPIExternal.js~Event", 318 | "external" 319 | ], 320 | [ 321 | "builtinexternal/webapiexternal.js~node", 322 | "https://developer.mozilla.org/en-US/docs/Web/API/Node", 323 | "BuiltinExternal/WebAPIExternal.js~Node", 324 | "external" 325 | ], 326 | [ 327 | "builtinexternal/webapiexternal.js~nodelist", 328 | "https://developer.mozilla.org/en-US/docs/Web/API/NodeList", 329 | "BuiltinExternal/WebAPIExternal.js~NodeList", 330 | "external" 331 | ], 332 | [ 333 | "builtinexternal/webapiexternal.js~xmlhttprequest", 334 | "https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest", 335 | "BuiltinExternal/WebAPIExternal.js~XMLHttpRequest", 336 | "external" 337 | ], 338 | [ 339 | "src/index.js", 340 | "file/src/index.js.html", 341 | "src/index.js", 342 | "file" 343 | ], 344 | [ 345 | "src/index.test.js", 346 | "file/src/index.test.js.html", 347 | "src/index.test.js", 348 | "file" 349 | ] 350 | ] -------------------------------------------------------------------------------- /docs/script/test-summary.js: -------------------------------------------------------------------------------- 1 | (function(){ 2 | function toggle(ev) { 3 | var button = ev.target; 4 | var parent = ev.target.parentElement; 5 | while(parent) { 6 | if (parent.tagName === 'TR' && parent.classList.contains('test-describe')) break; 7 | parent = parent.parentElement; 8 | } 9 | 10 | if (!parent) return; 11 | 12 | var direction; 13 | if (button.classList.contains('opened')) { 14 | button.classList.remove('opened'); 15 | button.classList.add('closed'); 16 | direction = 'closed'; 17 | } else { 18 | button.classList.remove('closed'); 19 | button.classList.add('opened'); 20 | direction = 'opened'; 21 | } 22 | 23 | var targetDepth = parseInt(parent.dataset.testDepth, 10) + 1; 24 | var nextElement = parent.nextElementSibling; 25 | while (nextElement) { 26 | var depth = parseInt(nextElement.dataset.testDepth, 10); 27 | if (depth >= targetDepth) { 28 | if (direction === 'opened') { 29 | if (depth === targetDepth) nextElement.style.display = ''; 30 | } else if (direction === 'closed') { 31 | nextElement.style.display = 'none'; 32 | var innerButton = nextElement.querySelector('.toggle'); 33 | if (innerButton && innerButton.classList.contains('opened')) { 34 | innerButton.classList.remove('opened'); 35 | innerButton.classList.add('closed'); 36 | } 37 | } 38 | } else { 39 | break; 40 | } 41 | nextElement = nextElement.nextElementSibling; 42 | } 43 | } 44 | 45 | var buttons = document.querySelectorAll('.test-summary tr.test-describe .toggle'); 46 | for (var i = 0; i < buttons.length; i++) { 47 | buttons[i].addEventListener('click', toggle); 48 | } 49 | 50 | var topDescribes = document.querySelectorAll('.test-summary tr[data-test-depth="0"]'); 51 | for (var i = 0; i < topDescribes.length; i++) { 52 | topDescribes[i].style.display = ''; 53 | } 54 | })(); 55 | -------------------------------------------------------------------------------- /docs/source.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Source | API Document 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
    17 | Home 18 | 19 | Reference 20 | Source 21 | 22 | Repository 23 | 30 |
    31 | 32 | 39 | 40 |

    Source 1/1

    41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 |
    FileIdentifierDocumentSizeLinesUpdated
    src/index.jsnoConsole100 %1/1906 byte262018-03-04 09:14:45 (UTC)
    src/index.test.js--1035 byte442018-03-04 09:15:30 (UTC)
    73 |
    74 | 75 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "danger-plugin-no-console", 3 | "description": "Danger plugin to prevent merging code that still has `console.log`s inside it.", 4 | "author": { 5 | "name": "Max Stoiber", 6 | "email": "contact@mxstbr.com" 7 | }, 8 | "repository": { 9 | "type": "git", 10 | "url": "https://github.com/withspectrum/danger-plugin-no-console.git" 11 | }, 12 | "bugs": { 13 | "url": "https://github.com/withspectrum/danger-plugin-no-console/issues" 14 | }, 15 | "homepage": "https://github.com/withspectrum/danger-plugin-no-console#readme", 16 | "keywords": [ 17 | "danger", 18 | "danger-plugin", 19 | "" 20 | ], 21 | "version": "1.1.2", 22 | "main": "dist/index.js", 23 | "types": "types/index.d.ts", 24 | "scripts": { 25 | "precommit": "lint-staged", 26 | "commit": "git-cz", 27 | "commitmsg": "validate-commit-msg", 28 | "build": "babel src --out-dir dist --ignore *.test.js", 29 | "test": "jest", 30 | "predocs": "rm -rf docs/", 31 | "docs": "esdoc -c .esdoc.json", 32 | "prepublish": "npm run build", 33 | "semantic-release": "semantic-release pre && npm publish && semantic-release post" 34 | }, 35 | "license": "MIT", 36 | "engines": { 37 | "node": ">=4.0.0" 38 | }, 39 | "devDependencies": { 40 | "babel-cli": "^6.24.1", 41 | "babel-jest": "^20.0.1", 42 | "babel-preset-env": "^1.7.0", 43 | "typings-tester": "^0.2.2", 44 | "commitizen": "^2.10.1", 45 | "cz-conventional-changelog": "^2.0.0", 46 | "husky": "^0.13.3", 47 | "jest": "^20.0.1", 48 | "lint-staged": "^3.4.1", 49 | "prettier": "^1.16.1", 50 | "semantic-release": "^6.3.6", 51 | "typescript": "^2.9.2", 52 | "validate-commit-msg": "^2.12.1" 53 | }, 54 | "optionalDependencies": { 55 | "esdoc": "^1.1.0" 56 | }, 57 | "config": { 58 | "commitizen": { 59 | "path": "cz-conventional-changelog" 60 | } 61 | }, 62 | "lint-staged": { 63 | "*.js": [ 64 | "prettier --single-quote --trailing-comma=all --no-semi --write", 65 | "git add" 66 | ] 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/index.js: -------------------------------------------------------------------------------- 1 | const PATTERN = /console\.(log|error|warn|info)/ 2 | const GLOBAL_PATTERN = new RegExp(PATTERN.source, 'g') 3 | const JS_FILE = /\.(js|ts)x?$/i 4 | 5 | const findConsole = (content, whitelist) => { 6 | let matches = content.match(GLOBAL_PATTERN) 7 | if (!matches) return [] 8 | 9 | matches = matches.filter(match => { 10 | const singleMatch = PATTERN.exec(match) 11 | if (!singleMatch || singleMatch.length === 0) return false 12 | return !whitelist.includes(singleMatch[1]) 13 | }) 14 | 15 | return matches 16 | } 17 | 18 | const defaultCallback = (file, matches) => 19 | fail(`${matches.length} console statement(s) added in ${file}.`) 20 | 21 | /** 22 | * Danger plugin to prevent merging code that still has `console.log`s inside it. 23 | */ 24 | export default async function noConsole(options = {}) { 25 | const whitelist = options.whitelist || [] 26 | const callback = options.callback || defaultCallback 27 | if (!Array.isArray(whitelist)) 28 | throw new Error( 29 | '[danger-plugin-no-console] whitelist option has to be an array.', 30 | ) 31 | 32 | if (typeof callback !== 'function') 33 | throw new Error( 34 | '[danger-plugin-no-console] callback option has to be an function.', 35 | ) 36 | 37 | const diffs = danger.git.created_files 38 | .concat(danger.git.modified_files) 39 | .filter(file => JS_FILE.test(file)) 40 | .map(file => { 41 | return danger.git.diffForFile(file).then(diff => ({ 42 | file, 43 | diff, 44 | })) 45 | }) 46 | 47 | const additions = await Promise.all(diffs) 48 | 49 | additions 50 | .filter(({ diff }) => !!diff) 51 | .forEach(({ file, diff }) => { 52 | const matches = findConsole(diff.added, whitelist) 53 | if (matches.length === 0) return 54 | 55 | callback(file, matches) 56 | }) 57 | } 58 | -------------------------------------------------------------------------------- /src/index.test.js: -------------------------------------------------------------------------------- 1 | import noConsole from './' 2 | 3 | const files = { 4 | 'src/log.js': 5 | 'function add(a, b) {\n console.log(a, b);\n return a + b;\n}', 6 | 'src/clean.js': 'function add(a, b) {\n return a + b;\n}', 7 | 'src/error.js': 8 | 'function add(a, b) {\n console.error(a, b);\n return a + b;\n}', 9 | 'src/multiple.js': 10 | 'function add(a, b) {\n console.info(a, b);\n console.info(b, a);\n return a + b;\n}', 11 | } 12 | 13 | const fileNames = Object.keys(files) 14 | 15 | // Mock the Danger API 16 | global.danger = { 17 | git: { 18 | modified_files: [fileNames[0], fileNames[1]], 19 | created_files: [fileNames[2], fileNames[3]], 20 | diffForFile: file => 21 | Promise.resolve({ 22 | added: files[file], 23 | }), 24 | }, 25 | github: { 26 | utils: { 27 | fileContents: path => 28 | new Promise(res => { 29 | res(files[path]) 30 | }), 31 | }, 32 | }, 33 | } 34 | 35 | beforeEach(() => { 36 | global.fail = jest.fn() 37 | }) 38 | 39 | afterEach(() => { 40 | global.fail = undefined 41 | }) 42 | 43 | describe('noConsole()', () => { 44 | it('should fail any files with a console.log in it', async () => { 45 | await noConsole() 46 | expect(global.fail).toHaveBeenCalledTimes(3) 47 | }) 48 | 49 | it('should respect the whitelist of console properties', async () => { 50 | await noConsole({ whitelist: ['error'] }) 51 | expect(global.fail).toHaveBeenCalledTimes(2) 52 | }) 53 | 54 | it('should handle multiple console statements in a file', async () => { 55 | await noConsole({ whitelist: ['error', 'warn', 'log'] }) 56 | expect(global.fail).toHaveBeenCalledTimes(1) 57 | expect(global.fail.mock.calls[0][0].startsWith(10)) 58 | }) 59 | 60 | it('should call the given callback with the collected result', async () => { 61 | const callback = jest.fn() 62 | await noConsole({ callback }) 63 | expect(callback).toHaveBeenCalledTimes(3) 64 | expect(callback.mock.calls[0][1]).toEqual(['console.error']) 65 | expect(callback.mock.calls[0][0]).toEqual('src/error.js') 66 | }) 67 | }) 68 | -------------------------------------------------------------------------------- /types/index.d.ts: -------------------------------------------------------------------------------- 1 | export default function noConsole(options?: { whitelist?: string[], callback?: (file: string, matches: string[]) => {} }): void 2 | -------------------------------------------------------------------------------- /types/test.ts: -------------------------------------------------------------------------------- 1 | import noConsole from './' 2 | 3 | noConsole() 4 | -------------------------------------------------------------------------------- /types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es5", 5 | "noImplicitAny": true, 6 | "noImplicitThis": true, 7 | "strictNullChecks": true, 8 | "sourceMap": false 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /types/types.test.js: -------------------------------------------------------------------------------- 1 | import { join } from 'path' 2 | import { check } from 'typings-tester' 3 | 4 | test('TypeScript types', () => { 5 | expect(() => { 6 | check([join(__dirname, 'test.ts')], join(__dirname, 'tsconfig.json')) 7 | }).not.toThrow() 8 | }) 9 | --------------------------------------------------------------------------------