forked from realreality/reality-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Use typescript, update webpack, linters etc.
* added 🐶husky to run prepush * fix .editorconfig - corrected to use LF setting for all files * lint: semi set to never * lint: comma dange - always-multiline, because of duplicating lines * moved jest config into .jestrc * update package.json scripts * added tsconfig, tslint, tsfmt for styling codebase * migrated all impl to ts * migrated non-vue tests to ts Closes realreality#74 realreality#75
- Loading branch information
Showing
37 changed files
with
1,604 additions
and
730 deletions.
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 |
---|---|---|
@@ -1,24 +1,25 @@ | ||
# EditorConfig helps developers define and maintain consistent | ||
# coding styles between different editors and IDEs | ||
# editorconfig.org | ||
|
||
root = true | ||
|
||
|
||
[*] | ||
|
||
# Change these settings to your own preference | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
[*.json] | ||
indent_size = 2 | ||
|
||
# We recommend you to keep these unchanged | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
max_line_length = 120 | ||
|
||
[*.{js,ts}] | ||
quote_type = single | ||
curly_bracket_next_line = false | ||
spaces_around_brackets = inside | ||
indent_brace_style = BSD KNF | ||
|
||
[*.html] | ||
quote_type = double | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,33 @@ | ||
{ | ||
"globals": { | ||
"__TS_CONFIG__": { | ||
"module": "commonjs" | ||
} | ||
}, | ||
"collectCoverage": false, | ||
"collectCoverageFrom": [ | ||
"**/src/js/*.js", | ||
"**/src/**/*.vue", | ||
"**/src/js/components/**.js", | ||
"**/src/js/sites/**.js", | ||
"**/src/js/services/**.js", | ||
"!**/src/js/18n/*.js", | ||
"!**/src/js/background.js" | ||
], | ||
"moduleFileExtensions": [ | ||
"js", | ||
"json", | ||
"ts", | ||
"vue" | ||
], | ||
"roots": [ | ||
"<rootDir>/src" | ||
], | ||
"testRegex": "(/__tests__/.*|\\.(test|spec))\\.(ts|js)$", | ||
"transform": { | ||
"^.+\\.js$": "<rootDir>/node_modules/babel-jest", | ||
"^.+\\.(ts|tsx)": "<rootDir>/node_modules/ts-jest/preprocessor.js", | ||
"^.+\\.vue$": "<rootDir>/node_modules/jest-vue-preprocessor" | ||
}, | ||
"verbose": 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 @@ | ||
save-prefix false |
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,12 @@ | ||
declare module '*.vue' { | ||
import * as Vue from 'vue' | ||
export default typeof Vue | ||
} | ||
|
||
declare module 'vue-i18n' | ||
|
||
declare module '*.html' | ||
|
||
declare namespace RR { | ||
function logInfo(s: string): void | ||
} |
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
/** | ||
* Code that detects host page and switches icons in toolbar. | ||
*/ | ||
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) { | ||
console.log('request', request) | ||
if (request.switchIconOn) { | ||
chrome.browserAction.setIcon({ | ||
path: { | ||
19: 'images/icon-19.png', | ||
38: 'images/icon-19.png', | ||
}, | ||
tabId: sender.tab && sender.tab.id, | ||
}) | ||
} | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.