'readonly',
'serializable',
'sinon',
+ 'tsconfig',
'unregister',
'workerpool'
],
run: |
npm run test
npm run coverage
+ npm run lint:report
env:
CI: true
.eslintcache
.history/
.scannerwork
-lib
*.bak
+lib
+reports
.nyc_output/
coverage/
+reports/
docs/
outputs/
lib/
/**
* Intentionally inefficient implementation.
*
- * @param {number} n
- * @returns {number}
+ * @param {number} n - The number of fibonacci numbers to generate.
+ * @returns {number} - The nth fibonacci number.
*/
function fibonacci (n) {
if (n <= 1) return 1
return fibonacci(n - 1) + fibonacci(n - 2)
}
+/**
+ * Intentionally inefficient implementation.
+ *
+ * @param {number} n - The number to calculate the factorial of.
+ * @returns {number} - The factorial of n.
+ */
+function factorial (n) {
+ if (n === 0) {
+ return 1
+ } else {
+ return factorial(n - 1) * n
+ }
+}
+
const LIST_FORMATTER = new Intl.ListFormat('en-US', {
style: 'long',
type: 'conjunction'
jsonIntegerSerialization,
generateRandomInteger,
fibonacci,
+ factorial,
LIST_FORMATTER
}
"format": "prettier --loglevel silent --write .; prettierx --write .",
"lint": "eslint . --cache",
"lint:fix": "eslint . --cache --fix",
+ "lint:report": "eslint . --cache --format json --output-file reports/eslint.json",
"typedoc": "typedoc",
"sonar:properties": "./updateSonarProps.sh",
"prepublishOnly": "npm run build:prod"
sonar.projectKey=pioardi_poolifier
sonar.organization=pioardi
sonar.javascript.lcov.reportPaths=coverage/lcov.info
+sonar.eslint.reportPaths=reports/eslint.json
sonar.projectName=poolifier
sonar.projectVersion=2.2.2
sonar.host.url=https://sonarcloud.io
/**
* Intentionally inefficient implementation.
*
- * @param {number} n
- * @returns {number}
+ * @param {number} n - The number of fibonacci numbers to generate.
+ * @returns {number} - The nth fibonacci number.
*/
static fibonacci (n) {
if (n <= 1) return 1
/**
* Intentionally inefficient implementation.
*
- * @param {number} n
- * @returns {number}
+ * @param {number} n - The number to calculate the factorial of.
+ * @returns {number} - The factorial of n.
*/
static factorial (n) {
if (n === 0) {