This repository has been archived by the owner on Mar 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 127
🚧 snoowrap v2.0 (work in progress) #338
Merged
Merged
Changes from all commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
46ec580
Fixed endOfLine issue
iMrDJAi 6573a75
🚧 Switching to axios!
iMrDJAi eb1bf8f
🚧 Switching to axios! Pt. 2
iMrDJAi 21943b3
🩹 Minor fixes
iMrDJAi 222ca46
Merge branch 'not-an-aardvark:master' into master
iMrDJAi ebd3ab1
🚧 snoowrap v2.0
iMrDJAi d018672
🚧 snoowrap v2.0 Pt. 2
iMrDJAi 4193e70
🚧 Checkpoint...
iMrDJAi df9c6fd
🔨 Updated snoowrap.js
iMrDJAi b145df9
📝 Added docs for `src/objects/MediaFile.ts`
iMrDJAi 2444e51
🚧 Check point
iMrDJAi a42b0a5
🩹 Quick fix
iMrDJAi 9db5f78
🔨 Updates...
iMrDJAi 48d1567
🔨 Updated Subreddit.js
iMrDJAi 66a68c6
📝 Added a new badge to README.md
iMrDJAi a4fb2dc
fix typo in wikipages object declaration
jamesrswift 87ed7a2
Fix setter returning a value
jamesrswift 22480c1
Merge pull request #2 from JamesxX/fix-typings
iMrDJAi 5602a96
Merge pull request #4 from JamesxX/helpers.js-update
iMrDJAi dc0e571
correct typings for voteablecontent
jamesrswift 0562bb5
Merge pull request #5 from JamesxX/votablecontent-properties
iMrDJAi 880b007
🔨 snoowrap 2.0.0: refactor (1)
iMrDJAi 77fe90a
✅ Listing.ts (2)
iMrDJAi d52f57a
✅ More.ts (2)
iMrDJAi 8901aa5
Hot fix (_fetchMoreComments method)
iMrDJAi 03e66b3
✅ RedditContent.ts (2)
iMrDJAi 6955cf4
Checkpoint
iMrDJAi 8497102
Checkpoint 2
iMrDJAi 7e7a4ae
Checkpoint
iMrDJAi 62b5c6a
Checkpoint..
iMrDJAi fbe7534
get unit tests running, modhashes aren't really used anymore
jrunge 6762a4f
Another checkpoint...
iMrDJAi 5f74ddd
Revert "Hot fix (_fetchMoreComments method)"
iMrDJAi e52da05
Merge pull request #6 from jrunge/master
iMrDJAi 79bce80
Merge pull request #8 from iMrDJAi/dev2
iMrDJAi 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 |
---|---|---|
|
@@ -10,7 +10,7 @@ rules: | |
comma-spacing: error | ||
comma-style: error | ||
computed-property-spacing: error | ||
curly: error | ||
curly: [error, multi-line] | ||
dot-notation: error | ||
dot-location: [error, property] | ||
eol-last: error | ||
|
@@ -19,18 +19,18 @@ rules: | |
indent: [error, 2, {FunctionDeclaration: {body: 1, parameters: 1}, FunctionExpression: {body: 1, parameters: 1}, CallExpression: {arguments: 1}, SwitchCase: 1, MemberExpression: 1}] | ||
key-spacing: error | ||
keyword-spacing: error | ||
linebreak-style: [error, unix] | ||
max-statements-per-line: error | ||
new-parens: error | ||
no-caller: error | ||
no-catch-shadow: error | ||
no-console: error | ||
no-duplicate-imports: error | ||
no-dupe-class-members: off | ||
no-duplicate-imports: off | ||
no-else-return: error | ||
no-eval: error | ||
no-extra-bind: error | ||
no-extra-label: error | ||
no-extra-parens: [error, all, {nestedBinaryExpressions: false}] | ||
no-extra-parens: off | ||
no-floating-decimal: error | ||
no-global-assign: error | ||
no-implied-eval: error | ||
|
@@ -46,6 +46,7 @@ rules: | |
no-octal-escape: error | ||
no-proto: error | ||
no-prototype-builtins: error | ||
no-redeclare: off | ||
no-restricted-properties: [error, {object: describe, property: only}, {object: it, property: only}] | ||
no-script-url: error | ||
no-self-compare: error | ||
|
@@ -54,10 +55,11 @@ rules: | |
no-tabs: error | ||
no-template-curly-in-string: error | ||
no-trailing-spaces: error | ||
no-undef: off # TypeScript will handle this | ||
no-unneeded-ternary: error | ||
no-unsafe-negation: error | ||
no-unused-expressions: error | ||
no-unused-vars: error | ||
no-unused-vars: off | ||
no-useless-call: error | ||
no-useless-computed-key: error | ||
no-useless-concat: error | ||
|
@@ -79,8 +81,8 @@ rules: | |
prefer-spread: error | ||
quote-props: [error, as-needed] | ||
quotes: [error, single, avoid-escape] | ||
semi: [error, always] | ||
semi-spacing: error | ||
# semi: [error, never] | ||
# semi-spacing: error | ||
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. why commented? 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. @DedaDev To temporarily suspense linter error till I remove all semicolons. |
||
space-before-blocks: error | ||
space-before-function-paren: error | ||
space-in-parens: error | ||
|
@@ -99,12 +101,19 @@ rules: | |
promise/catch-or-return: error | ||
promise/no-return-wrap: error | ||
promise/param-names: error | ||
promise/no-native: error | ||
'@typescript-eslint/consistent-type-imports': error | ||
'@typescript-eslint/no-dupe-class-members': error | ||
'@typescript-eslint/no-duplicate-imports': error | ||
'@typescript-eslint/no-extra-parens': [error, all, {nestedBinaryExpressions: false}] | ||
'@typescript-eslint/no-redeclare': error | ||
'@typescript-eslint/no-unused-vars': error | ||
|
||
extends: | ||
- eslint:recommended | ||
- plugin:import/errors | ||
- plugin:import/warnings | ||
- plugin:import/typescript | ||
|
||
plugins: | ||
- import | ||
- promise | ||
|
@@ -123,3 +132,4 @@ parserOptions: | |
env: | ||
node: true | ||
es6: true | ||
browser: true |
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,2 @@ | ||
# Auto detect text files and perform LF normalization | ||
* text=auto |
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 |
---|---|---|
|
@@ -7,3 +7,4 @@ coverage/ | |
test/_browser.spec.js | ||
oauth_info.json | ||
.eslintcache | ||
browser/_index.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>snoowrap</title> | ||
</head> | ||
<body> | ||
<p><b>Use the Browser Console to Test and Debug snoowrap Manually!</b></p> | ||
<ol> | ||
<li>To access the snoowrap class: <b>window.snoowrap</b>.</li> | ||
<li>To access a snoowrap instance authenticated with a refresh token: <b>window.r</b>.</li> | ||
<li>To access a snoowrap instance authenticated with username/password: <b>window.r2</b>.</li> | ||
</ol> | ||
<p> | ||
<b>Use This Button to Import Files From Your Device to the Browser:</b> | ||
<button onclick="document.getElementById('file-input').click();">Import File</button> | ||
<input id="file-input" type="file" name="name" style="display: none;" /> | ||
</p> | ||
<ol> | ||
<li>This is useful if you want to upload something with snoowrap.</li> | ||
<li>All imported files can be found here: <b>window.files</b>.</li> | ||
</ol> | ||
<p><b>Enjoy! <3</b></p> | ||
<script type="module" src="./index.js"></script> | ||
</body> | ||
</html> |
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,40 @@ | ||
/* eslint-disable no-console */ | ||
import snoowrap from '../src/snoowrap' | ||
import BaseRequester from '../src/BaseRequester' | ||
|
||
window.BaseRequester = BaseRequester.default | ||
|
||
fetch('../oauth_info.json').then(async response => { | ||
const oauthInfo = await response.json() | ||
|
||
window.r = new snoowrap({ | ||
user_agent: oauthInfo.user_agent, | ||
client_id: oauthInfo.client_id, | ||
client_secret: oauthInfo.client_secret, | ||
refresh_token: oauthInfo.refresh_token, | ||
config: { | ||
debug: true, | ||
warnings: true | ||
} | ||
}) | ||
|
||
window.r2 = new snoowrap({ | ||
user_agent: oauthInfo.user_agent, | ||
client_id: oauthInfo.client_id, | ||
client_secret: oauthInfo.client_secret, | ||
username: oauthInfo.username, | ||
password: oauthInfo.password, | ||
config: { | ||
debug: true, | ||
warnings: true | ||
} | ||
}) | ||
}).catch(err => console.error(err)) | ||
|
||
window.files = {} | ||
|
||
const fileinput = document.getElementById('file-input') | ||
fileinput.onchange = () => { | ||
const file = fileinput.files[0] | ||
if (file) window.files[file.name] = file | ||
} |
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,2 @@ | ||
/** A fallback for builtin node modules on browser */ | ||
export default undefined |
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.
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.
@DedaDev I believe we should disable all formatting rules and install prettier instead.