-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore/add prettier #93
Open
a-ogilvie
wants to merge
2
commits into
Tom-Alexander:master
Choose a base branch
from
a-ogilvie:chore/add-prettier
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+141
−100
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
dist/* | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"extends": "airbnb-base", | ||
"extends": ["airbnb-base", "plugin:prettier/recommended"], | ||
"rules": { | ||
"import/prefer-default-export": 0, | ||
"no-plusplus": 0 | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"printWidth": 100, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,14 +57,14 @@ | |
var DEFAULT_OPTIONS = { order: 2, precision: 2, period: null }; | ||
|
||
/** | ||
* Determine the coefficient of determination (r^2) of a fit from the observations | ||
* and predictions. | ||
* | ||
* @param {Array<Array<number>>} data - Pairs of observed x-y values | ||
* @param {Array<Array<number>>} results - Pairs of observed predicted x-y values | ||
* | ||
* @return {number} - The r^2 value, or NaN if one cannot be calculated. | ||
*/ | ||
* Determine the coefficient of determination (r^2) of a fit from the observations | ||
* and predictions. | ||
* | ||
* @param {Array<Array<number>>} data - Pairs of observed x-y values | ||
* @param {Array<Array<number>>} results - Pairs of observed predicted x-y values | ||
* | ||
* @return {number} - The r^2 value, or NaN if one cannot be calculated. | ||
*/ | ||
function determinationCoefficient(data, results) { | ||
var predictions = []; | ||
var observations = []; | ||
|
@@ -96,14 +96,14 @@ | |
} | ||
|
||
/** | ||
* Determine the solution of a system of linear equations A * x = b using | ||
* Gaussian elimination. | ||
* | ||
* @param {Array<Array<number>>} input - A 2-d matrix of data in row-major form [ A | b ] | ||
* @param {number} order - How many degrees to solve for | ||
* | ||
* @return {Array<number>} - Vector of normalized solution coefficients matrix (x) | ||
*/ | ||
* Determine the solution of a system of linear equations A * x = b using | ||
* Gaussian elimination. | ||
* | ||
* @param {Array<Array<number>>} input - A 2-d matrix of data in row-major form [ A | b ] | ||
* @param {number} order - How many degrees to solve for | ||
* | ||
* @return {Array<number>} - Vector of normalized solution coefficients matrix (x) | ||
*/ | ||
function gaussianElimination(input, order) { | ||
var matrix = input; | ||
var n = input.length - 1; | ||
|
@@ -143,25 +143,25 @@ | |
} | ||
|
||
/** | ||
* Round a number to a precision, specificed in number of decimal places | ||
* | ||
* @param {number} number - The number to round | ||
* @param {number} precision - The number of decimal places to round to: | ||
* > 0 means decimals, < 0 means powers of 10 | ||
* | ||
* | ||
* @return {numbr} - The number, rounded | ||
*/ | ||
* Round a number to a precision, specificed in number of decimal places | ||
* | ||
* @param {number} number - The number to round | ||
* @param {number} precision - The number of decimal places to round to: | ||
* > 0 means decimals, < 0 means powers of 10 | ||
* | ||
* | ||
* @return {number} - The number, rounded | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Corrected a typo. |
||
*/ | ||
function round(number, precision) { | ||
var factor = Math.pow(10, precision); | ||
return Math.round(number * factor) / factor; | ||
} | ||
|
||
/** | ||
* The set of all fitting methods | ||
* | ||
* @namespace | ||
*/ | ||
* The set of all fitting methods | ||
* | ||
* @namespace | ||
*/ | ||
var methods = { | ||
linear: function linear(data, options) { | ||
var sum = [0, 0, 0, 0, 0]; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
"keywords": [ | ||
"regression", | ||
"data", | ||
"fiting", | ||
"fitting", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Corrected a typo. |
||
"modeling", | ||
"analysis" | ||
], | ||
|
@@ -33,9 +33,12 @@ | |
"chai": "^3.5.0", | ||
"eslint": "^3.19.0", | ||
"eslint-config-airbnb-base": "^11.2.0", | ||
"eslint-config-prettier": "^4.2.0", | ||
"eslint-plugin-import": "^2.7.0", | ||
"eslint-plugin-prettier": "^3.1.0", | ||
"mocha": "^3.2.0", | ||
"nyc": "^11.0.3", | ||
"prettier": "1.17.0", | ||
"uglify-js": "3" | ||
}, | ||
"author": "Tom Alexander <[email protected]>" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This disables linting errors in code editors for built files.