Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
[chore] migrate to eslint@8 and run --fix (#2256)
Browse files Browse the repository at this point in the history
closes #2107

- updated related babel dependencies
- bumped eslint
- ran `yarn lint:js --fix`
- added eslint ignore comments for some required non-camel-case properties
  • Loading branch information
gabrielcsapo authored Feb 10, 2022
1 parent c7383b4 commit 15f0aa7
Show file tree
Hide file tree
Showing 93 changed files with 323 additions and 326 deletions.
8 changes: 7 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
/* eslint-env node */
module.exports = {
root: true,
parser: 'babel-eslint',
parser: '@babel/eslint-parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
allowImportExportEverywhere: false,
ecmaFeatures: {
globalReturn: false,
legacyDecorators: true
},
requireConfigFile: false,
babelOptions: {
plugins: ['@babel/plugin-proposal-class-properties', ['@babel/plugin-proposal-decorators', {legacy: true}]]
}
},
plugins: [
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default class GhAlerts extends Component {
@service notifications;

@alias('notifications.alerts')
messages;
messages;
}
2 changes: 1 addition & 1 deletion app/components/gh-basic-dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import BasicDropdown from 'ember-basic-dropdown/components/basic-dropdown';
import {inject as service} from '@ember/service';

class GhBasicDropdown extends BasicDropdown {
@service dropdown
@service dropdown;

constructor() {
super(...arguments);
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-billing-update-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class GhBillingUpdateButton extends Component {
subscription = null;

@reads('billing.subscription.isActiveTrial')
showUpgradeButton;
showUpgradeButton;

@action
openBilling() {
Expand Down
4 changes: 2 additions & 2 deletions app/components/gh-cm-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CmEditorComponent extends Component {
update = () => {};

@boundOneWay('value')
_value; // make sure a value exists
_value; // make sure a value exists

didReceiveAttrs() {
super.didReceiveAttrs(...arguments);
Expand Down Expand Up @@ -77,7 +77,7 @@ class CmEditorComponent extends Component {

scheduleOnce('afterRender', this, this._initCodeMirror);
})
initCodeMirror;
initCodeMirror;

_initCodeMirror() {
let options = this.getProperties('lineNumbers', 'lineWrapping', 'indentUnit', 'mode', 'theme', 'autofocus');
Expand Down
4 changes: 2 additions & 2 deletions app/components/gh-date-time-picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ export default class GhDateTimePicker extends Component {
setTypedDateError() {}

@reads('settings.timezone')
blogTimezone;
blogTimezone;

@or('dateError', 'timeError')
hasError;
hasError;

@computed('_date', '_scratchDate')
get dateValue() {
Expand Down
1 change: 0 additions & 1 deletion app/components/gh-launch-wizard/connect-stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export default class GhLaunchWizardConnectStripeComponent extends Component {
@service ghostPaths;
@service settings;
@service store;
@service settings;

@tracked hasActiveStripeSubscriptions = false;
@tracked showDisconnectStripeConnectModal = false;
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-member-activity-feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MemberActivity {
iconClass: 'red-d2',
tooltip: 'Email delivery failed'
}
}
};

constructor(props) {
Object.assign(this, props);
Expand Down
12 changes: 6 additions & 6 deletions app/components/gh-member-settings-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import {task} from 'ember-concurrency';
import {tracked} from '@glimmer/tracking';

export default class extends Component {
@service membersUtils
@service ghostPaths
@service ajax
@service store
@service feature
@service settings
@service membersUtils;
@service ghostPaths;
@service ajax;
@service store;
@service feature;
@service settings;

constructor(...args) {
super(...args);
Expand Down
4 changes: 2 additions & 2 deletions app/components/gh-nav-menu/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ export default class Footer extends Component {
@service feature;

@and('config.clientExtensions.dropdown', 'session.user.isOwnerOnly')
showDropdownExtension;
showDropdownExtension;

@match('router.currentRouteName', /^settings/)
isSettingsRoute;
isSettingsRoute;

// equivalent to "left: auto; right: -20px"
userDropdownPosition(trigger, dropdown) {
Expand Down
16 changes: 8 additions & 8 deletions app/components/gh-nav-menu/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,27 +34,27 @@ export default class Main extends Component.extend(ShortcutsMixin) {
shortcuts = null;

@match('router.currentRouteName', /^settings\.integration/)
isIntegrationRoute;
isIntegrationRoute;

// HACK: {{link-to}} should be doing this automatically but there appears to
// be a bug in Ember that's preventing it from working immediately after login
@equal('router.currentRouteName', 'site')
isOnSite;
isOnSite;

@or('session.user.isAdmin', 'session.user.isEditor')
showTagsNavigation;
showTagsNavigation;

@and('config.clientExtensions.menu', 'session.user.isOwnerOnly')
showMenuExtension;
showMenuExtension;

@and('config.clientExtensions.script', 'session.user.isOwnerOnly')
showScriptExtension;
showScriptExtension;

@reads('config.hostSettings.billing.enabled')
showBilling;
showBilling;

@reads('settings.stripeConnectAccountId')
isStripeConnected;
isStripeConnected;

init() {
super.init(...arguments);
Expand Down Expand Up @@ -123,7 +123,7 @@ export default class Main extends Component.extend(ShortcutsMixin) {
return false;
}
})
_loadMemberCountsTask;
_loadMemberCountsTask;

_setIconStyle() {
let icon = this.icon;
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-notifications.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ export default class GhNotifications extends Component {
@service notifications;

@alias('notifications.notifications')
messages;
messages;
}
6 changes: 3 additions & 3 deletions app/components/gh-portal-links.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class GhPortalLinks extends Component {
});
}
})
fetchProducts;
fetchProducts;

@task(function* (id) {
this.set('copiedPrice', id);
Expand All @@ -90,7 +90,7 @@ export default class GhPortalLinks extends Component {
copyTextToClipboard(data);
yield timeout(this.isTesting ? 50 : 3000);
})
copyStaticLink;
copyStaticLink;

@task(function* (interval) {
this.set('copiedSignupInterval', interval);
Expand All @@ -103,5 +103,5 @@ export default class GhPortalLinks extends Component {
copyTextToClipboard(data);
yield timeout(this.isTesting ? 50 : 3000);
})
copyProductSignupLink;
copyProductSignupLink;
}
42 changes: 21 additions & 21 deletions app/components/gh-post-settings-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,43 +25,43 @@ export default class GhPostSettingsMenu extends Component {
isViewingSubview = false;

@alias('post.canonicalUrlScratch')
canonicalUrlScratch;
canonicalUrlScratch;

@alias('post.customExcerptScratch')
customExcerptScratch;
customExcerptScratch;

@alias('post.codeinjectionFootScratch')
codeinjectionFootScratch;
codeinjectionFootScratch;

@alias('post.codeinjectionHeadScratch')
codeinjectionHeadScratch;
codeinjectionHeadScratch;

@alias('post.metaDescriptionScratch')
metaDescriptionScratch;
metaDescriptionScratch;

@alias('post.metaTitleScratch')
metaTitleScratch;
metaTitleScratch;

@alias('post.ogDescriptionScratch')
ogDescriptionScratch;
ogDescriptionScratch;

@alias('post.ogTitleScratch')
ogTitleScratch;
ogTitleScratch;

@alias('post.twitterDescriptionScratch')
twitterDescriptionScratch;
twitterDescriptionScratch;

@alias('post.twitterTitleScratch')
twitterTitleScratch;
twitterTitleScratch;

@boundOneWay('post.slug')
slugValue;
slugValue;

@boundOneWay('post.uuid')
uuidValue;
uuidValue;

@or('metaDescriptionScratch', 'customExcerptScratch', 'post.excerpt')
seoDescription;
seoDescription;

@or(
'ogDescriptionScratch',
Expand All @@ -71,18 +71,18 @@ export default class GhPostSettingsMenu extends Component {
'settings.description',
''
)
facebookDescription;
facebookDescription;

@or(
'post.ogImage',
'post.featureImage',
'settings.ogImage',
'settings.coverImage'
)
facebookImage;
facebookImage;

@or('ogTitleScratch', 'seoTitle')
facebookTitle;
facebookTitle;

@or(
'twitterDescriptionScratch',
Expand All @@ -92,32 +92,32 @@ export default class GhPostSettingsMenu extends Component {
'settings.description',
''
)
twitterDescription;
twitterDescription;

@or(
'post.twitterImage',
'post.featureImage',
'settings.twitterImage',
'settings.coverImage'
)
twitterImage;
twitterImage;

@or('twitterTitleScratch', 'seoTitle')
twitterTitle;
twitterTitle;

@or(
'session.user.isOwnerOnly',
'session.user.isAdminOnly',
'session.user.isEditor'
)
showVisibilityInput;
showVisibilityInput;

@or(
'session.user.isOwnerOnly',
'session.user.isAdminOnly',
'session.user.isEditor'
)
showEmailNewsletter;
showEmailNewsletter;

@computed('metaTitleScratch', 'post.titleScratch')
get seoTitle() {
Expand Down
12 changes: 6 additions & 6 deletions app/components/gh-post-settings-menu/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,16 @@ export default class Email extends Component {
close() {}

@or('emailSubjectScratch', 'post.title')
emailSubject;
emailSubject;

@alias('post.emailSubjectScratch')
emailSubjectScratch;
emailSubjectScratch;

@oneWay('session.user.email')
testEmailAddress;
testEmailAddress;

@not('mailgunIsEnabled')
mailgunError;
mailgunError;

@computed(
'settings.{mailgunApiKey,mailgunDomain,mailgunBaseUrl}',
Expand Down Expand Up @@ -109,7 +109,7 @@ export default class Email extends Component {
}
}
}).drop())
sendTestEmail;
sendTestEmail;

@task(function* () {
let {email} = this.post;
Expand All @@ -136,5 +136,5 @@ export default class Email extends Component {

return true;
})
retryEmail;
retryEmail;
}
2 changes: 1 addition & 1 deletion app/components/gh-psm-tags-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export default class GhPsmTagsInput extends Component {
// ignorePunctuation means the # in internal tag names is ignored
return tagA.name.localeCompare(tagB.name, undefined, {ignorePunctuation: true});
})
availableTags;
availableTags;

@computed('[email protected]')
get availableTagNames() {
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-psm-template-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,5 @@ export default class GhPsmTemplateSelect extends Component {

this.set('activeTheme', activeTheme);
})
loadActiveTheme;
loadActiveTheme;
}
2 changes: 1 addition & 1 deletion app/components/gh-search-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default class GhSearchInputComponent extends Component {
fields: ['slug', 'name'],
idField: 'slug',
titleField: 'name'
}]
}];

@action
openSelected(selected) {
Expand Down
2 changes: 1 addition & 1 deletion app/components/gh-simplemde.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,5 @@ export default class GhSimplemde extends TextArea {

this.onEditorInit(this._editor);
})
initSimpleMDE;
initSimpleMDE;
}
2 changes: 1 addition & 1 deletion app/components/gh-timezone-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class GhTimezoneSelect extends Component {
update = () => {};

@mapBy('availableTimezones', 'name')
availableTimezoneNames;
availableTimezoneNames;

@computed('timezone', 'availableTimezoneNames')
get hasTimezoneOverride() {
Expand Down
Loading

0 comments on commit 15f0aa7

Please sign in to comment.