From decb351ed3f7cdae7e90d51d845eba9b4effa4b8 Mon Sep 17 00:00:00 2001 From: akshitkrnagpal Date: Thu, 7 Jun 2018 13:17:42 +0530 Subject: [PATCH] Updated eslint-config-jitsi --- .eslintrc.js | 6 +-- app/.eslintrc.js | 7 +++ app/features/app/components/App.js | 2 +- .../conference/components/Conference.js | 14 +++++- app/features/navbar/components/HelpAction.js | 44 +++++++++++-------- app/features/navbar/components/Navbar.js | 6 ++- app/features/utils/functions.js | 5 +++ app/features/welcome/components/Welcome.js | 11 ++++- app/index.js | 2 + package-lock.json | 18 ++++---- package.json | 2 +- 11 files changed, 77 insertions(+), 40 deletions(-) create mode 100644 app/.eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js index 469b75f..8071812 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,9 +1,5 @@ module.exports = { 'extends': [ - 'eslint-config-jitsi', - 'plugin:react/recommended' - ], - 'plugins': [ - 'react' + 'eslint-config-jitsi' ] }; diff --git a/app/.eslintrc.js b/app/.eslintrc.js new file mode 100644 index 0000000..bdb5b12 --- /dev/null +++ b/app/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + 'extends': [ + './../.eslintrc.js', + 'eslint-config-jitsi/jsdoc', + 'eslint-config-jitsi/react' + ] +}; diff --git a/app/features/app/components/App.js b/app/features/app/components/App.js index 4329dca..392cd78 100644 --- a/app/features/app/components/App.js +++ b/app/features/app/components/App.js @@ -38,8 +38,8 @@ export default class App extends Component<*> { { /** * Attach the script to this component. + * + * @returns {void} */ componentDidMount() { const parentNode = this._ref.current; @@ -75,6 +77,8 @@ class Conference extends Component { /** * Remove conference on unmounting. + * + * @returns {void} */ componentWillUnmount() { if (this._api) { @@ -85,15 +89,16 @@ class Conference extends Component { /** * Implements React's {@link Component#render()}. * - * @inheritdoc * @returns {ReactElement} */ render() { - return ; + return ; } /** * Navigates to home screen (Welcome). + * + * @returns {void} */ _navigateToHome() { this.props.dispatch(push('/')); @@ -102,6 +107,11 @@ class Conference extends Component { /** * When the script is loaded create the iframe element in this component * and attach utils from jitsi-meet-electron-utils. + * + * @param {Object} parentNode - Node to which iframe has to be attached. + * @param {string} roomName - Conference room name to be joined. + * @param {string} domain - Jitsi Meet server domain. + * @returns {void} */ _onScriptLoad(parentNode: Object, roomName: string, domain: string) { const JitsiMeetExternalAPI = window.JitsiMeetExternalAPI; diff --git a/app/features/navbar/components/HelpAction.js b/app/features/navbar/components/HelpAction.js index 81cd903..b421e7c 100644 --- a/app/features/navbar/components/HelpAction.js +++ b/app/features/navbar/components/HelpAction.js @@ -32,66 +32,74 @@ class HelpAction extends Component< *, State> { droplistOpen: false }; - this._droplistToggle = this._droplistToggle.bind(this); - this._openPrivacyPage = this._openPrivacyPage.bind(this); - this._openTermsPage = this._openTermsPage.bind(this); - this._sendFeedback = this._sendFeedback.bind(this); + this._onIconClick = this._onIconClick.bind(this); + this._onPrivacyOptionClick = this._onPrivacyOptionClick.bind(this); + this._onTermsOptionClick = this._onTermsOptionClick.bind(this); + this._onSendFeedback = this._onSendFeedback.bind(this); } - _droplistToggle: (*) => void; + _onIconClick: (*) => void; /** * Toggles the droplist. + * + * @returns {void} */ - _droplistToggle() { + _onIconClick() { this.setState({ droplistOpen: !this.state.droplistOpen }); } - _openPrivacyPage: (*) => void; + _onPrivacyOptionClick: (*) => void; /** * Opens Privacy Policy Page in default browser. + * + * @returns {void} */ - _openPrivacyPage() { + _onPrivacyOptionClick() { openExternalLink(config.privacyPolicyURL); } - _openTermsPage: (*) => void; + _onTermsOptionClick: (*) => void; /** * Opens Terms and Conditions Page in default browser. + * + * @returns {void} */ - _openTermsPage() { + _onTermsOptionClick() { openExternalLink(config.termsAndConditionsURL); } - _sendFeedback: (*) => void; + _onSendFeedback: (*) => void; /** * Opens Support/Feedback Email. + * + * @returns {void} */ - _sendFeedback() { + _onSendFeedback() { openExternalLink(config.feedbackURL); } /** * Render function of component. * - * @return {ReactElement} + * @returns {ReactElement} */ render() { return ( this._droplistToggle() } - onOpenChange = { () => this._droplistToggle() } + onClick = { this._onIconClick } + onOpenChange = { this._onIconClick } position = 'right bottom' trigger = { }> - Terms - Privacy - Send Feedback + Terms + Privacy + Send Feedback ); } diff --git a/app/features/navbar/components/Navbar.js b/app/features/navbar/components/Navbar.js index d243559..df6dccc 100644 --- a/app/features/navbar/components/Navbar.js +++ b/app/features/navbar/components/Navbar.js @@ -15,10 +15,12 @@ import HelpAction from './HelpAction'; class Navbar extends Component<*> { /** * Get the array of Secondary actions of Global Navigation. + * + * @returns {ReactElement[]} */ _getSecondaryActions() { return [ - + ]; @@ -27,7 +29,7 @@ class Navbar extends Component<*> { /** * Render function of component. * - * @return {ReactElement} + * @returns {ReactElement} */ render() { return ( diff --git a/app/features/utils/functions.js b/app/features/utils/functions.js index f0db554..a86d05f 100644 --- a/app/features/utils/functions.js +++ b/app/features/utils/functions.js @@ -6,6 +6,9 @@ import { shell } from 'electron'; /** * Opens the provided link in default broswer. + * + * @param {string} link - Link to open outside the desktop app. + * @returns {void} */ export function openExternalLink(link: string) { shell.openExternal(link); @@ -13,6 +16,8 @@ export function openExternalLink(link: string) { /** * Return true if Electron app is running on Mac system. + * + * @returns {boolean} */ export function isElectronMac() { return process.platform === 'darwin'; diff --git a/app/features/welcome/components/Welcome.js b/app/features/welcome/components/Welcome.js index 423b0f0..63f79c5 100644 --- a/app/features/welcome/components/Welcome.js +++ b/app/features/welcome/components/Welcome.js @@ -58,7 +58,7 @@ class Welcome extends Component { /** * Render function of component. * - * @return {ReactElement} + * @returns {ReactElement} */ render() { return ( @@ -92,6 +92,9 @@ class Welcome extends Component { /** * Prevents submission of the form and delegates the join logic. + * + * @param {Event} event - Event by which this function is called. + * @returns {void} */ _onFormSubmit(event: Event) { event.preventDefault(); @@ -102,6 +105,8 @@ class Welcome extends Component { /** * Redirect and join conference. + * + * @returns {void} */ _onJoin() { const url = URL.parse(this.state.url); @@ -122,6 +127,10 @@ class Welcome extends Component { /** * Keeps URL input value and URL in state in sync. + * + * @param {SyntheticInputEvent} event - Event by which + * this function is called. + * @returns {void} */ _onURLChange(event: SyntheticInputEvent) { this.setState({ diff --git a/app/index.js b/app/index.js index 91f91cc..96fe943 100644 --- a/app/index.js +++ b/app/index.js @@ -18,6 +18,8 @@ import { store } from './features/redux'; class Root extends Component<*> { /** * Implements React's {@link Component#render()}. + * + * @returns {ReactElement} */ render() { return ( diff --git a/package-lock.json b/package-lock.json index f592ec8..665c83c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4264,7 +4264,7 @@ } }, "eslint-config-jitsi": { - "version": "github:jitsi/eslint-config-jitsi#64b9f255ae804eb91bd62a3c6fbeb8104944587a", + "version": "github:jitsi/eslint-config-jitsi#3d193df6476a73f827582e137a67a8612130a455", "dev": true }, "eslint-import-resolver-node": { @@ -7058,15 +7058,6 @@ "postis": "2.2.0", "prebuild-install": "2.5.3", "robotjs": "github:jitsi/robotjs#5cc469f655669e728b61271c2c57ce97d62976fd" - }, - "dependencies": { - "robotjs": { - "version": "github:jitsi/robotjs#5cc469f655669e728b61271c2c57ce97d62976fd", - "requires": { - "nan": "2.10.0", - "prebuild-install": "2.5.3" - } - } } }, "js-base64": { @@ -10530,6 +10521,13 @@ "inherits": "2.0.3" } }, + "robotjs": { + "version": "github:jitsi/robotjs#5cc469f655669e728b61271c2c57ce97d62976fd", + "requires": { + "nan": "2.10.0", + "prebuild-install": "2.5.3" + } + }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", diff --git a/package.json b/package.json index fa98280..5bc4a1a 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "electron-packager": "12.0.2", "electron-rebuild": "1.7.3", "eslint": "4.12.1", - "eslint-config-jitsi": "jitsi/eslint-config-jitsi", + "eslint-config-jitsi": "jitsi/eslint-config-jitsi#v0.1.0", "eslint-plugin-flowtype": "2.46.3", "eslint-plugin-import": "2.11.0", "eslint-plugin-jsdoc": "3.2.0",