Upgrades to eslint-plugin-vue 7.5.0 (#3685)

This commit is contained in:
Shefali Joshi 2021-02-12 13:46:53 -08:00 committed by GitHub
parent abb1a5c75b
commit a9be9f1827
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
69 changed files with 126 additions and 116 deletions

View File

@ -54,7 +54,7 @@ module.exports = {
{
"anonymous": "always",
"asyncArrow": "always",
"named": "never",
"named": "never"
}
],
"array-bracket-spacing": "error",
@ -178,7 +178,10 @@ module.exports = {
//https://eslint.org/docs/rules/no-whitespace-before-property
"no-whitespace-before-property": "error",
// https://eslint.org/docs/rules/object-curly-newline
"object-curly-newline": ["error", {"consistent": true, "multiline": true}],
"object-curly-newline": ["error", {
"consistent": true,
"multiline": true
}],
// https://eslint.org/docs/rules/object-property-newline
"object-property-newline": "error",
// https://eslint.org/docs/rules/brace-style
@ -188,7 +191,7 @@ module.exports = {
// https://eslint.org/docs/rules/operator-linebreak
"operator-linebreak": ["error", "before", {"overrides": {"=": "after"}}],
// https://eslint.org/docs/rules/padding-line-between-statements
"padding-line-between-statements":["error", {
"padding-line-between-statements": ["error", {
"blankLine": "always",
"prev": "multiline-block-like",
"next": "*"
@ -200,11 +203,17 @@ module.exports = {
// https://eslint.org/docs/rules/space-infix-ops
"space-infix-ops": "error",
// https://eslint.org/docs/rules/space-unary-ops
"space-unary-ops": ["error", {"words": true, "nonwords": false}],
"space-unary-ops": ["error", {
"words": true,
"nonwords": false
}],
// https://eslint.org/docs/rules/arrow-spacing
"arrow-spacing": "error",
// https://eslint.org/docs/rules/semi-spacing
"semi-spacing": ["error", {"before": false, "after": true}],
"semi-spacing": ["error", {
"before": false,
"after": true
}],
"vue/html-indent": [
"error",
@ -237,6 +246,7 @@ module.exports = {
}],
"vue/multiline-html-element-content-newline": "off",
"vue/singleline-html-element-content-newline": "off",
"vue/no-mutating-props": "off"
},
"overrides": [

View File

@ -23,7 +23,7 @@
"d3-time": "1.0.x",
"d3-time-format": "2.1.x",
"eslint": "7.0.0",
"eslint-plugin-vue": "^6.0.0",
"eslint-plugin-vue": "^7.5.0",
"eslint-plugin-you-dont-need-lodash-underscore": "^6.10.0",
"eventemitter3": "^1.2.0",
"exports-loader": "^0.7.0",

View File

@ -30,12 +30,12 @@ class Menu extends EventEmitter {
this.options = options;
this.component = new Vue({
provide: {
actions: options.actions
},
components: {
MenuComponent
},
provide: {
actions: options.actions
},
template: '<menu-component />'
});

View File

@ -48,7 +48,7 @@ define([
this.providers.push(function () {
return key;
});
} else if (_.isFunction(key)) {
} else if (typeof key === "function") {
this.providers.push(key);
}
};

View File

@ -6,6 +6,9 @@ class Dialog extends Overlay {
constructor({iconClass, message, title, hint, timestamp, ...options}) {
let component = new Vue({
components: {
DialogComponent: DialogComponent
},
provide: {
iconClass,
message,
@ -13,9 +16,6 @@ class Dialog extends Overlay {
hint,
timestamp
},
components: {
DialogComponent: DialogComponent
},
template: '<dialog-component></dialog-component>'
}).$mount();

View File

@ -7,6 +7,9 @@ let component;
class ProgressDialog extends Overlay {
constructor({progressPerc, progressText, iconClass, message, title, hint, timestamp, ...options}) {
component = new Vue({
components: {
ProgressDialogComponent: ProgressDialogComponent
},
provide: {
iconClass,
message,
@ -14,9 +17,6 @@ class ProgressDialog extends Overlay {
hint,
timestamp
},
components: {
ProgressDialogComponent: ProgressDialogComponent
},
data() {
return {
model: {

View File

@ -38,12 +38,12 @@
<script>
export default {
inject: ['dismiss', 'element', 'buttons', 'dismissable'],
data: function () {
return {
focusIndex: -1
};
},
inject: ['dismiss', 'element', 'buttons', 'dismissable'],
mounted() {
const element = this.$refs.element;
element.appendChild(this.element);

View File

@ -43,15 +43,15 @@ export default function LADTableViewProvider(openmct) {
components: {
LadTableComponent: LadTable
},
provide: {
openmct
},
data: () => {
return {
domainObject,
objectPath
};
},
provide: {
openmct
},
template: '<lad-table-component :domain-object="domainObject" :object-path="objectPath"></lad-table-component>'
});
},

View File

@ -48,10 +48,10 @@
import LadRow from './LADRow.vue';
export default {
inject: ['openmct'],
components: {
LadRow
},
inject: ['openmct'],
props: {
domainObject: {
type: Object,

View File

@ -57,10 +57,10 @@
import LadRow from './LADRow.vue';
export default {
inject: ['openmct', 'domainObject'],
components: {
LadRow
},
inject: ['openmct', 'domainObject'],
data() {
return {
ladTableObjects: [],

View File

@ -37,12 +37,12 @@ define([
return function install(openmct) {
if (installIndicator) {
let component = new Vue ({
provide: {
openmct
},
components: {
GlobalClearIndicator: GlobaClearIndicator.default
},
provide: {
openmct
},
template: '<GlobalClearIndicator></GlobalClearIndicator>'
});

View File

@ -195,11 +195,11 @@ import { TRIGGER, TRIGGER_LABEL } from "@/plugins/condition/utils/constants";
import uuid from 'uuid';
export default {
inject: ['openmct'],
components: {
Criterion,
ConditionDescription
},
inject: ['openmct'],
props: {
currentConditionId: {
type: String,

View File

@ -81,10 +81,10 @@ import Condition from './Condition.vue';
import ConditionManager from '../ConditionManager';
export default {
inject: ['openmct', 'domainObject'],
components: {
Condition
},
inject: ['openmct', 'domainObject'],
props: {
isEditing: Boolean,
testData: {

View File

@ -58,11 +58,11 @@ import TestData from './TestData.vue';
import ConditionCollection from './ConditionCollection.vue';
export default {
inject: ["openmct", "domainObject"],
components: {
TestData,
ConditionCollection
},
inject: ["openmct", "domainObject"],
props: {
isEditing: Boolean
},

View File

@ -68,10 +68,10 @@ import viewControl from '@/ui/components/viewControl.vue';
export default {
name: 'ConditionSetDialogTreeItem',
inject: ['openmct'],
components: {
viewControl
},
inject: ['openmct'],
props: {
node: {
type: Object,

View File

@ -85,12 +85,12 @@ import search from '@/ui/components/search.vue';
import ConditionSetDialogTreeItem from './ConditionSetDialogTreeItem.vue';
export default {
inject: ['openmct'],
name: 'ConditionSetSelectorDialog',
components: {
search,
ConditionSetDialogTreeItem
},
inject: ['openmct'],
data() {
return {
expanded: false,

View File

@ -401,15 +401,15 @@ describe('the plugin', function () {
let viewContainer = document.createElement('div');
child.append(viewContainer);
component = new Vue({
el: viewContainer,
components: {
StylesView
},
provide: {
openmct: openmct,
selection: selection,
stylesManager
},
el: viewContainer,
components: {
StylesView
},
template: '<styles-view/>'
});

View File

@ -56,14 +56,14 @@ define([
return {
show: function (element) {
component = new Vue({
provide: {
openmct,
objectPath
},
el: element,
components: {
AlphanumericFormatView: AlphanumericFormatView.default
},
provide: {
openmct,
objectPath
},
template: '<alphanumeric-format-view ref="alphanumericFormatView"></alphanumeric-format-view>'
});
},

View File

@ -51,11 +51,11 @@ export default {
height: 5
};
},
inject: ['openmct'],
components: {
LayoutFrame
},
mixins: [conditionalStylesMixin],
inject: ['openmct'],
props: {
item: {
type: Object,

View File

@ -51,11 +51,11 @@ export default {
url: element.url
};
},
inject: ['openmct'],
components: {
LayoutFrame
},
mixins: [conditionalStylesMixin],
inject: ['openmct'],
props: {
item: {
type: Object,

View File

@ -99,8 +99,8 @@ export default {
stroke: '#717171'
};
},
inject: ['openmct'],
mixins: [conditionalStylesMixin],
inject: ['openmct'],
props: {
item: {
type: Object,

View File

@ -80,11 +80,11 @@ export default {
viewKey
};
},
inject: ['openmct', 'objectPath'],
components: {
ObjectFrame,
LayoutFrame
},
inject: ['openmct', 'objectPath'],
props: {
item: {
type: Object,

View File

@ -98,11 +98,11 @@ export default {
font: 'default'
};
},
inject: ['openmct', 'objectPath'],
components: {
LayoutFrame
},
mixins: [conditionalStylesMixin],
inject: ['openmct', 'objectPath'],
props: {
item: {
type: Object,

View File

@ -59,11 +59,11 @@ export default {
font: 'default'
};
},
inject: ['openmct'],
components: {
LayoutFrame
},
mixins: [conditionalStylesMixin],
inject: ['openmct'],
props: {
item: {
type: Object,

View File

@ -47,13 +47,13 @@ define([
return {
show: function (element) {
component = new Vue({
provide: {
openmct
},
el: element,
components: {
FiltersView: FiltersView.default
},
provide: {
openmct
},
template: '<filters-view></filters-view>'
});
},

View File

@ -65,11 +65,11 @@ import ToggleSwitch from '../../../ui/components/ToggleSwitch.vue';
import isEmpty from 'lodash/isEmpty';
export default {
inject: ['openmct'],
components: {
FilterField,
ToggleSwitch
},
inject: ['openmct'],
props: {
filterObject: {
type: Object,

View File

@ -41,10 +41,10 @@
import FilterField from './FilterField.vue';
export default {
inject: ['openmct'],
components: {
FilterField
},
inject: ['openmct'],
props: {
globalMetadata: {
type: Object,

View File

@ -87,12 +87,12 @@ import DropHint from './dropHint.vue';
const MIN_FRAME_SIZE = 5;
export default {
inject: ['openmct'],
components: {
FrameComponent,
ResizeHandle,
DropHint
},
inject: ['openmct'],
props: {
container: {
type: Object,

View File

@ -140,12 +140,12 @@ function sizeToFill(items) {
}
export default {
inject: ['openmct', 'objectPath', 'layoutObject'],
components: {
ContainerComponent,
ResizeHandle,
DropHint
},
inject: ['openmct', 'objectPath', 'layoutObject'],
props: {
isEditing: Boolean
},

View File

@ -58,10 +58,10 @@
import ObjectFrame from '../../../ui/components/ObjectFrame.vue';
export default {
inject: ['openmct'],
components: {
ObjectFrame
},
inject: ['openmct'],
props: {
frame: {
type: Object,

View File

@ -44,15 +44,15 @@ define([
return {
show: function (element, isEditing) {
component = new Vue({
el: element,
components: {
FlexibleLayoutComponent: FlexibleLayoutComponent.default
},
provide: {
openmct,
objectPath,
layoutObject: domainObject
},
el: element,
components: {
FlexibleLayoutComponent: FlexibleLayoutComponent.default
},
data() {
return {
isEditing: isEditing

View File

@ -117,13 +117,13 @@ import objectUtils from 'objectUtils';
import { throttle } from 'lodash';
export default {
inject: ['openmct', 'domainObject', 'snapshotContainer'],
components: {
NotebookEntry,
Search,
SearchResults,
Sidebar
},
inject: ['openmct', 'domainObject', 'snapshotContainer'],
data() {
return {
defaultPageId: getDefaultNotebook() ? getDefaultNotebook().page.id : '',

View File

@ -33,10 +33,10 @@ import SnapshotTemplate from './snapshot-template.html';
import Vue from 'vue';
export default {
inject: ['openmct'],
components: {
PopupMenu
},
inject: ['openmct'],
props: {
embed: {
type: Object,

View File

@ -61,10 +61,10 @@ import { createNewEmbed, getEntryPosById, getNotebookEntries } from '../utils/no
import Moment from 'moment';
export default {
inject: ['openmct', 'snapshotContainer'],
components: {
NotebookEmbed
},
inject: ['openmct', 'snapshotContainer'],
props: {
domainObject: {
type: Object,

View File

@ -56,11 +56,11 @@ import { NOTEBOOK_SNAPSHOT_MAX_COUNT } from '../snapshot-container';
import { EVENT_SNAPSHOTS_UPDATED } from '../notebook-constants';
export default {
inject: ['openmct', 'snapshotContainer'],
components: {
NotebookEmbed,
PopupMenu
},
inject: ['openmct', 'snapshotContainer'],
props: {
toggleSnapshot: {
type: Function,

View File

@ -69,14 +69,14 @@ export default {
const divElement = document.querySelector('.l-shell__drawer div');
this.component = new Vue({
provide: {
openmct,
snapshotContainer
},
el: divElement,
components: {
SnapshotContainerComponent
},
provide: {
openmct,
snapshotContainer
},
data() {
return {
toggleSnapshot

View File

@ -22,10 +22,10 @@ import { getDefaultNotebook } from '../utils/notebook-storage';
import Page from './PageComponent.vue';
export default {
inject: ['openmct'],
components: {
Page
},
inject: ['openmct'],
props: {
defaultPageId: {
type: String,

View File

@ -18,10 +18,10 @@ import PopupMenu from './PopupMenu.vue';
import RemoveDialog from '../utils/removeDialog';
export default {
inject: ['openmct'],
components: {
PopupMenu
},
inject: ['openmct'],
props: {
defaultPageId: {
type: String,

View File

@ -21,10 +21,10 @@
import NotebookEntry from './NotebookEntry.vue';
export default {
inject: ['openmct', 'snapshotContainer'],
components: {
NotebookEntry
},
inject: ['openmct', 'snapshotContainer'],
props: {
domainObject: {
type: Object,

View File

@ -22,10 +22,10 @@ import { getDefaultNotebook } from '../utils/notebook-storage';
import sectionComponent from './SectionComponent.vue';
export default {
inject: ['openmct'],
components: {
sectionComponent
},
inject: ['openmct'],
props: {
defaultSectionId: {
type: String,

View File

@ -21,10 +21,10 @@ import PopupMenu from './PopupMenu.vue';
import RemoveDialog from '../utils/removeDialog';
export default {
inject: ['openmct'],
components: {
PopupMenu
},
inject: ['openmct'],
props: {
defaultSectionId: {
type: String,

View File

@ -61,11 +61,11 @@ import PageCollection from './PageCollection.vue';
import uuid from 'uuid';
export default {
inject: ['openmct'],
components: {
SectionCollection,
PageCollection
},
inject: ['openmct'],
props: {
defaultPageId: {
type: String,

View File

@ -88,13 +88,13 @@ export default function NotebookPlugin() {
const snapshotContainer = new SnapshotContainer(openmct);
const notebookSnapshotIndicator = new Vue ({
components: {
NotebookSnapshotIndicator
},
provide: {
openmct,
snapshotContainer
},
components: {
NotebookSnapshotIndicator
},
template: '<NotebookSnapshotIndicator></NotebookSnapshotIndicator>'
});
const indicator = {

View File

@ -27,10 +27,10 @@
import NotificationsList from './NotificationsList.vue';
export default {
inject: ['openmct'],
components: {
NotificationsList
},
inject: ['openmct'],
data() {
return {
notifications: this.openmct.notifications.notifications,

View File

@ -25,12 +25,12 @@ import NotificationIndicator from './components/NotificationIndicator.vue';
export default function plugin() {
return function install(openmct) {
let component = new Vue ({
provide: {
openmct
},
components: {
NotificationIndicator: NotificationIndicator
},
provide: {
openmct
},
template: '<NotificationIndicator></NotificationIndicator>'
});

View File

@ -136,7 +136,7 @@ define([
};
}
if (objectPath && !_.isFunction(objectPath)) {
if (objectPath && (typeof objectPath !== "function")) {
const staticObjectPath = objectPath;
objectPath = function () {
return staticObjectPath;

View File

@ -79,10 +79,10 @@ const unknownObjectType = {
};
export default {
inject: ['openmct', 'domainObject', 'composition', 'objectPath'],
components: {
ObjectView
},
inject: ['openmct', 'domainObject', 'composition', 'objectPath'],
props: {
isEditing: {
type: Boolean,

View File

@ -53,14 +53,14 @@ define([
return {
show: function (element) {
component = new Vue({
provide: {
openmct,
tableConfiguration
},
el: element,
components: {
TableConfiguration: TableConfigurationComponent.default
},
provide: {
openmct,
tableConfiguration
},
template: '<table-configuration></table-configuration>'
});
},

View File

@ -67,6 +67,11 @@ define([
components: {
TableComponent: TableComponent.default
},
provide: {
openmct,
table,
objectPath
},
data() {
return {
isEditing: editMode,
@ -74,11 +79,6 @@ define([
view
};
},
provide: {
openmct,
table,
objectPath
},
template: '<table-component ref="tableComponent" :isEditing="isEditing" :marking="markingProp" :view="view"/>'
});
},

View File

@ -46,10 +46,10 @@
import TableCell from './table-cell.vue';
export default {
inject: ['openmct'],
components: {
TableCell
},
inject: ['openmct'],
props: {
headers: {
type: Object,

View File

@ -168,7 +168,6 @@ import ConductorHistory from './ConductorHistory.vue';
const DEFAULT_DURATION_FORMATTER = 'duration';
export default {
inject: ['openmct', 'configuration'],
components: {
ConductorMode,
ConductorTimeSystem,
@ -177,6 +176,7 @@ export default {
ConductorModeIcon,
ConductorHistory
},
inject: ['openmct', 'configuration'],
data() {
let bounds = this.openmct.time.bounds();
let offsets = this.openmct.time.clockOffsets();

View File

@ -72,8 +72,8 @@ const LOCAL_STORAGE_HISTORY_KEY_REALTIME = 'tcHistoryRealtime';
const DEFAULT_RECORDS = 10;
export default {
inject: ['openmct', 'configuration'],
mixins: [toggleMixin],
inject: ['openmct', 'configuration'],
props: {
bounds: {
type: Object,

View File

@ -63,8 +63,8 @@
import toggleMixin from '../../ui/mixins/toggle-mixin';
export default {
inject: ['openmct', 'configuration'],
mixins: [toggleMixin],
inject: ['openmct', 'configuration'],
data: function () {
let activeClock = this.openmct.time.clock();
if (activeClock !== undefined) {

View File

@ -53,8 +53,8 @@
import toggleMixin from '../../ui/mixins/toggle-mixin';
export default {
inject: ['openmct', 'configuration'],
mixins: [toggleMixin],
inject: ['openmct', 'configuration'],
data: function () {
let activeClock = this.openmct.time.clock();

View File

@ -108,8 +108,8 @@ const TIME_OPTIONS = (function makeRanges() {
}());
export default {
inject: ['openmct'],
mixins: [toggleMixin],
inject: ['openmct'],
props: {
defaultDateTime: {
type: String,

View File

@ -32,10 +32,10 @@
import Plan from './Plan.vue';
export default {
inject: ['openmct', 'domainObject'],
components: {
Plan
},
inject: ['openmct', 'domainObject'],
data() {
return {
plans: []

View File

@ -131,14 +131,14 @@ describe('the plugin', function () {
let viewContainer = document.createElement('div');
child.append(viewContainer);
component = new Vue({
provide: {
openmct: openmct,
domainObject: planDomainObject
},
el: viewContainer,
components: {
TimelineViewLayout
},
provide: {
openmct: openmct,
domainObject: planDomainObject
},
template: '<timeline-view-layout/>'
});

View File

@ -111,10 +111,10 @@ const SIMPLE_CONTENT_TYPES = [
];
export default {
inject: ['openmct'],
components: {
ObjectView
},
inject: ['openmct'],
props: {
domainObject: {
type: Object,

View File

@ -54,11 +54,11 @@ import Search from '../components/search.vue';
import ObjectLabel from '../components/ObjectLabel.vue';
export default {
inject: ['openmct'],
components: {
'Search': Search,
'ObjectLabel': ObjectLabel
},
inject: ['openmct'],
data() {
return {
elements: [],

View File

@ -66,10 +66,6 @@ import StylesInspectorView from '@/ui/inspector/styles/StylesInspectorView.vue';
import SavedStylesInspectorView from '@/ui/inspector/styles/SavedStylesInspectorView.vue';
export default {
provide: {
stylesManager: stylesManager
},
inject: ['openmct'],
components: {
StylesInspectorView,
SavedStylesInspectorView,
@ -81,6 +77,10 @@ export default {
Location,
InspectorViews
},
provide: {
stylesManager: stylesManager
},
inject: ['openmct'],
props: {
isEditing: {
type: Boolean,

View File

@ -41,10 +41,10 @@
import ObjectLabel from '../components/ObjectLabel.vue';
export default {
inject: ['openmct'],
components: {
ObjectLabel
},
inject: ['openmct'],
data() {
return {
domainObject: {},

View File

@ -23,10 +23,10 @@ import {
} from '@/ui/inspector/styles/constants';
export default {
inject: ['openmct'],
components: {
ToolbarSelectMenu
},
inject: ['openmct'],
props: {
fontStyle: {
type: Object,

View File

@ -124,11 +124,11 @@ import NotebookMenuSwitcher from '@/plugins/notebook/components/NotebookMenuSwit
const PLACEHOLDER_OBJECT = {};
export default {
inject: ['openmct'],
components: {
NotebookMenuSwitcher,
ViewSwitcher
},
inject: ['openmct'],
props: {
actionCollection: {
type: Object,

View File

@ -119,7 +119,6 @@ import Indicators from './status-bar/Indicators.vue';
import NotificationBanner from './status-bar/NotificationBanner.vue';
export default {
inject: ['openmct'],
components: {
Inspector,
MctTree,
@ -134,6 +133,7 @@ export default {
Indicators,
NotificationBanner
},
inject: ['openmct'],
data: function () {
let storedHeadProps = window.localStorage.getItem('openmct-shell-head');
let headExpanded = true;

View File

@ -140,12 +140,12 @@ const ROOT_PATH = 'browse';
const ITEM_BUFFER = 5;
export default {
inject: ['openmct'],
name: 'MctTree',
components: {
search,
treeItem
},
inject: ['openmct'],
props: {
syncTreeNavigation: {
type: Boolean,

View File

@ -68,10 +68,10 @@ function updateMaxProgressBar(progressPerc, progressText) {
}
export default {
inject: ['openmct'],
components: {
ProgressBar: ProgressBar
},
inject: ['openmct'],
data() {
return {
activeModel: {

View File

@ -49,11 +49,11 @@ import ObjectLabel from '../components/ObjectLabel.vue';
export default {
name: 'TreeItem',
inject: ['openmct'],
components: {
viewControl,
ObjectLabel
},
inject: ['openmct'],
props: {
node: {
type: Object,

View File

@ -46,12 +46,12 @@ const HIDDEN_ACTIONS = [
];
export default {
inject: [
'openmct'
],
components: {
ViewSwitcher
},
inject: [
'openmct'
],
props: {
currentView: {
type: Object,

View File

@ -36,7 +36,6 @@ import toolbarToggleButton from './components/toolbar-toggle-button.vue';
import _ from 'lodash';
export default {
inject: ['openmct'],
components: {
toolbarButton,
toolbarColorPicker,
@ -47,6 +46,7 @@ export default {
toolbarSeparator,
toolbarToggleButton
},
inject: ['openmct'],
data: function () {
return {
structure: []