Skip to content

Commit decb351

Browse files
akshitkrnagpalsaghul
authored andcommittedJun 11, 2018
Updated eslint-config-jitsi
1 parent 67cab07 commit decb351

File tree

11 files changed

+77
-40
lines changed

11 files changed

+77
-40
lines changed
 

‎.eslintrc.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
module.exports = {
22
'extends': [
3-
'eslint-config-jitsi',
4-
'plugin:react/recommended'
5-
],
6-
'plugins': [
7-
'react'
3+
'eslint-config-jitsi'
84
]
95
};

‎app/.eslintrc.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
'extends': [
3+
'./../.eslintrc.js',
4+
'eslint-config-jitsi/jsdoc',
5+
'eslint-config-jitsi/react'
6+
]
7+
};

‎app/features/app/components/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export default class App extends Component<*> {
3838
<Router history = { history }>
3939
<Switch>
4040
<Route
41-
exact
4241
component = { Welcome }
42+
exact = { true }
4343
path = '/' />
4444
<Route
4545
component = { Conference }

‎app/features/conference/components/Conference.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ class Conference extends Component<Props, *> {
5757

5858
/**
5959
* Attach the script to this component.
60+
*
61+
* @returns {void}
6062
*/
6163
componentDidMount() {
6264
const parentNode = this._ref.current;
@@ -75,6 +77,8 @@ class Conference extends Component<Props, *> {
7577

7678
/**
7779
* Remove conference on unmounting.
80+
*
81+
* @returns {void}
7882
*/
7983
componentWillUnmount() {
8084
if (this._api) {
@@ -85,15 +89,16 @@ class Conference extends Component<Props, *> {
8589
/**
8690
* Implements React's {@link Component#render()}.
8791
*
88-
* @inheritdoc
8992
* @returns {ReactElement}
9093
*/
9194
render() {
92-
return <Wrapper innerRef={this._ref} />;
95+
return <Wrapper innerRef = { this._ref } />;
9396
}
9497

9598
/**
9699
* Navigates to home screen (Welcome).
100+
*
101+
* @returns {void}
97102
*/
98103
_navigateToHome() {
99104
this.props.dispatch(push('/'));
@@ -102,6 +107,11 @@ class Conference extends Component<Props, *> {
102107
/**
103108
* When the script is loaded create the iframe element in this component
104109
* and attach utils from jitsi-meet-electron-utils.
110+
*
111+
* @param {Object} parentNode - Node to which iframe has to be attached.
112+
* @param {string} roomName - Conference room name to be joined.
113+
* @param {string} domain - Jitsi Meet server domain.
114+
* @returns {void}
105115
*/
106116
_onScriptLoad(parentNode: Object, roomName: string, domain: string) {
107117
const JitsiMeetExternalAPI = window.JitsiMeetExternalAPI;

‎app/features/navbar/components/HelpAction.js

+26-18
Original file line numberDiff line numberDiff line change
@@ -32,66 +32,74 @@ class HelpAction extends Component< *, State> {
3232
droplistOpen: false
3333
};
3434

35-
this._droplistToggle = this._droplistToggle.bind(this);
36-
this._openPrivacyPage = this._openPrivacyPage.bind(this);
37-
this._openTermsPage = this._openTermsPage.bind(this);
38-
this._sendFeedback = this._sendFeedback.bind(this);
35+
this._onIconClick = this._onIconClick.bind(this);
36+
this._onPrivacyOptionClick = this._onPrivacyOptionClick.bind(this);
37+
this._onTermsOptionClick = this._onTermsOptionClick.bind(this);
38+
this._onSendFeedback = this._onSendFeedback.bind(this);
3939
}
4040

41-
_droplistToggle: (*) => void;
41+
_onIconClick: (*) => void;
4242

4343
/**
4444
* Toggles the droplist.
45+
*
46+
* @returns {void}
4547
*/
46-
_droplistToggle() {
48+
_onIconClick() {
4749
this.setState({
4850
droplistOpen: !this.state.droplistOpen
4951
});
5052
}
5153

52-
_openPrivacyPage: (*) => void;
54+
_onPrivacyOptionClick: (*) => void;
5355

5456
/**
5557
* Opens Privacy Policy Page in default browser.
58+
*
59+
* @returns {void}
5660
*/
57-
_openPrivacyPage() {
61+
_onPrivacyOptionClick() {
5862
openExternalLink(config.privacyPolicyURL);
5963
}
6064

61-
_openTermsPage: (*) => void;
65+
_onTermsOptionClick: (*) => void;
6266

6367
/**
6468
* Opens Terms and Conditions Page in default browser.
69+
*
70+
* @returns {void}
6571
*/
66-
_openTermsPage() {
72+
_onTermsOptionClick() {
6773
openExternalLink(config.termsAndConditionsURL);
6874
}
6975

70-
_sendFeedback: (*) => void;
76+
_onSendFeedback: (*) => void;
7177

7278
/**
7379
* Opens Support/Feedback Email.
80+
*
81+
* @returns {void}
7482
*/
75-
_sendFeedback() {
83+
_onSendFeedback() {
7684
openExternalLink(config.feedbackURL);
7785
}
7886

7987
/**
8088
* Render function of component.
8189
*
82-
* @return {ReactElement}
90+
* @returns {ReactElement}
8391
*/
8492
render() {
8593
return (
8694
<Droplist
8795
isOpen = { this.state.droplistOpen }
88-
onClick = { () => this._droplistToggle() }
89-
onOpenChange = { () => this._droplistToggle() }
96+
onClick = { this._onIconClick }
97+
onOpenChange = { this._onIconClick }
9098
position = 'right bottom'
9199
trigger = { <HelpIcon /> }>
92-
<Item onActivate = { this._openTermsPage }>Terms</Item>
93-
<Item onActivate = { this._openPrivacyPage }>Privacy</Item>
94-
<Item onActivate = { this._sendFeedback } >Send Feedback</Item>
100+
<Item onActivate = { this._onTermsOptionClick }>Terms</Item>
101+
<Item onActivate = { this._onPrivacyOptionClick }>Privacy</Item>
102+
<Item onActivate = { this._onSendFeedback }>Send Feedback</Item>
95103
</Droplist>
96104
);
97105
}

‎app/features/navbar/components/Navbar.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ import HelpAction from './HelpAction';
1515
class Navbar extends Component<*> {
1616
/**
1717
* Get the array of Secondary actions of Global Navigation.
18+
*
19+
* @returns {ReactElement[]}
1820
*/
1921
_getSecondaryActions() {
2022
return [
21-
<AkGlobalItem key={0}>
23+
<AkGlobalItem key = { 0 }>
2224
<HelpAction />
2325
</AkGlobalItem>
2426
];
@@ -27,7 +29,7 @@ class Navbar extends Component<*> {
2729
/**
2830
* Render function of component.
2931
*
30-
* @return {ReactElement}
32+
* @returns {ReactElement}
3133
*/
3234
render() {
3335
return (

‎app/features/utils/functions.js

+5
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@ import { shell } from 'electron';
66

77
/**
88
* Opens the provided link in default broswer.
9+
*
10+
* @param {string} link - Link to open outside the desktop app.
11+
* @returns {void}
912
*/
1013
export function openExternalLink(link: string) {
1114
shell.openExternal(link);
1215
}
1316

1417
/**
1518
* Return true if Electron app is running on Mac system.
19+
*
20+
* @returns {boolean}
1621
*/
1722
export function isElectronMac() {
1823
return process.platform === 'darwin';

‎app/features/welcome/components/Welcome.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class Welcome extends Component<Props, State> {
5858
/**
5959
* Render function of component.
6060
*
61-
* @return {ReactElement}
61+
* @returns {ReactElement}
6262
*/
6363
render() {
6464
return (
@@ -92,6 +92,9 @@ class Welcome extends Component<Props, State> {
9292

9393
/**
9494
* Prevents submission of the form and delegates the join logic.
95+
*
96+
* @param {Event} event - Event by which this function is called.
97+
* @returns {void}
9598
*/
9699
_onFormSubmit(event: Event) {
97100
event.preventDefault();
@@ -102,6 +105,8 @@ class Welcome extends Component<Props, State> {
102105

103106
/**
104107
* Redirect and join conference.
108+
*
109+
* @returns {void}
105110
*/
106111
_onJoin() {
107112
const url = URL.parse(this.state.url);
@@ -122,6 +127,10 @@ class Welcome extends Component<Props, State> {
122127

123128
/**
124129
* Keeps URL input value and URL in state in sync.
130+
*
131+
* @param {SyntheticInputEvent<HTMLInputElement>} event - Event by which
132+
* this function is called.
133+
* @returns {void}
125134
*/
126135
_onURLChange(event: SyntheticInputEvent<HTMLInputElement>) {
127136
this.setState({

‎app/index.js

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import { store } from './features/redux';
1818
class Root extends Component<*> {
1919
/**
2020
* Implements React's {@link Component#render()}.
21+
*
22+
* @returns {ReactElement}
2123
*/
2224
render() {
2325
return (

‎package-lock.json

+8-10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
"electron-packager": "12.0.2",
6262
"electron-rebuild": "1.7.3",
6363
"eslint": "4.12.1",
64-
"eslint-config-jitsi": "jitsi/eslint-config-jitsi",
64+
"eslint-config-jitsi": "jitsi/eslint-config-jitsi#v0.1.0",
6565
"eslint-plugin-flowtype": "2.46.3",
6666
"eslint-plugin-import": "2.11.0",
6767
"eslint-plugin-jsdoc": "3.2.0",

0 commit comments

Comments
 (0)
Please sign in to comment.