Add linting for classic decorator (#8182)

This completes an installation step I missed when making #8144 and
marks classes that are using the EmberObject APIs as classic.
This commit is contained in:
Buck Doyle 2020-06-22 10:48:53 -05:00 committed by GitHub
parent 62894f1d35
commit ca7c252a96
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 0 deletions

View file

@ -33,6 +33,8 @@ module.exports = {
checkLoops: false, checkLoops: false,
}, },
], ],
'ember/classic-decorator-hooks': 'error',
'ember/classic-decorator-no-classic-methods': 'error',
}, },
overrides: [ overrides: [
// node files // node files

View file

@ -1,7 +1,9 @@
import AbstractAbility from './abstract'; import AbstractAbility from './abstract';
import { computed, get } from '@ember/object'; import { computed, get } from '@ember/object';
import { or } from '@ember/object/computed'; import { or } from '@ember/object/computed';
import classic from 'ember-classic-decorator';
@classic
export default class Client extends AbstractAbility { export default class Client extends AbstractAbility {
// Map abilities to policy options (which are coarse for nodes) // Map abilities to policy options (which are coarse for nodes)
// instead of specific behaviors. // instead of specific behaviors.

View file

@ -1,6 +1,8 @@
import { inject as service } from '@ember/service'; import { inject as service } from '@ember/service';
import Watchable from './watchable'; import Watchable from './watchable';
import classic from 'ember-classic-decorator';
@classic
export default class WatchableNamespaceIDs extends Watchable { export default class WatchableNamespaceIDs extends Watchable {
@service system; @service system;

View file

@ -7,7 +7,9 @@ import { fragment, fragmentArray } from 'ember-data-model-fragments/attributes';
import RSVP from 'rsvp'; import RSVP from 'rsvp';
import shortUUIDProperty from '../utils/properties/short-uuid'; import shortUUIDProperty from '../utils/properties/short-uuid';
import ipParts from '../utils/ip-parts'; import ipParts from '../utils/ip-parts';
import classic from 'ember-classic-decorator';
@classic
export default class Node extends Model { export default class Node extends Model {
// Available from list response // Available from list response
@attr('string') name; @attr('string') name;

View file

@ -5,7 +5,9 @@ import notifyError from 'nomad-ui/utils/notify-error';
import { qpBuilder } from 'nomad-ui/utils/classes/query-params'; import { qpBuilder } from 'nomad-ui/utils/classes/query-params';
import { watchRecord } from 'nomad-ui/utils/properties/watch'; import { watchRecord } from 'nomad-ui/utils/properties/watch';
import WithWatchers from 'nomad-ui/mixins/with-watchers'; import WithWatchers from 'nomad-ui/mixins/with-watchers';
import classic from 'ember-classic-decorator';
@classic
export default class VolumeRoute extends Route.extend(WithWatchers) { export default class VolumeRoute extends Route.extend(WithWatchers) {
@service store; @service store;
@service system; @service system;

View file

@ -3,7 +3,9 @@ import Route from '@ember/routing/route';
import RSVP from 'rsvp'; import RSVP from 'rsvp';
import notifyError from 'nomad-ui/utils/notify-error'; import notifyError from 'nomad-ui/utils/notify-error';
import { jobCrumbs } from 'nomad-ui/utils/breadcrumb-utils'; import { jobCrumbs } from 'nomad-ui/utils/breadcrumb-utils';
import classic from 'ember-classic-decorator';
@classic
export default class JobRoute extends Route { export default class JobRoute extends Route {
@service store; @service store;
@service token; @service token;

View file

@ -1,6 +1,7 @@
import { inject as service } from '@ember/service'; import { inject as service } from '@ember/service';
import { get } from '@ember/object'; import { get } from '@ember/object';
import ApplicationSerializer from './application'; import ApplicationSerializer from './application';
import classic from 'ember-classic-decorator';
const taskGroupFromJob = (job, taskGroupName) => { const taskGroupFromJob = (job, taskGroupName) => {
const taskGroups = job && job.TaskGroups; const taskGroups = job && job.TaskGroups;
@ -8,6 +9,7 @@ const taskGroupFromJob = (job, taskGroupName) => {
return taskGroup ? taskGroup : null; return taskGroup ? taskGroup : null;
}; };
@classic
export default class AllocationSerializer extends ApplicationSerializer { export default class AllocationSerializer extends ApplicationSerializer {
@service system; @service system;

View file

@ -2,7 +2,9 @@ import { inject as service } from '@ember/service';
import { get } from '@ember/object'; import { get } from '@ember/object';
import { assign } from '@ember/polyfills'; import { assign } from '@ember/polyfills';
import ApplicationSerializer from './application'; import ApplicationSerializer from './application';
import classic from 'ember-classic-decorator';
@classic
export default class Evaluation extends ApplicationSerializer { export default class Evaluation extends ApplicationSerializer {
@service system; @service system;