Skip to content
Snippets Groups Projects
Commit f044ba30 authored by Nils Brinckmann's avatar Nils Brinckmann
Browse files

Merge branch '229-eslint-type-annotation-spacings' into 'master'

Eslint rule for type annotation spacing

Closes #229

See merge request !193
parents 6f8b60bd e81e2917
No related branches found
No related tags found
1 merge request!193Eslint rule for type annotation spacing
Showing
with 40 additions and 25 deletions
......@@ -41,5 +41,20 @@ module.exports = {
],
// add your custom rules here
rules: {
// type annotations should look like this:
// const foo: SomeType
'@typescript-eslint/type-annotation-spacing': [
'warn',
{
before: false,
after: true,
overrides: {
arrow: {
before: true,
after: true
}
}
}
]
}
}
......@@ -155,7 +155,7 @@ export default class ConfigurationPlatformDeviceMountForm extends mixins(Rules)
type: String
})
// @ts-ignore
readonly currentUserMail:string|null
readonly currentUserMail: string|null
created () {
this.contact = this.currentUserAsMountContact
......
......@@ -301,7 +301,7 @@ export default class ConfigurationsPlatformDeviceSearch extends Vue {
type: String
})
// @ts-ignore
readonly currentUserMail:string|null
readonly currentUserMail: string|null
get searchTypes (): string[] {
return [SearchType.Platform, SearchType.Device]
......
......@@ -277,7 +277,7 @@ export default class ConfigurationsSelectedItem extends mixins(Rules) {
type: String
})
// @ts-ignore
readonly currentUserMail:string|null
readonly currentUserMail: string|null
/**
* returns the description of a node
......
......@@ -100,7 +100,7 @@ export default class ConfigurationsSelectedItemUnmountForm extends mixins(Rules)
type: String
})
// @ts-ignore
readonly currentUserMail:string|null
readonly currentUserMail: string|null
created () {
this.contact = this.currentUserAsMountContact
......
......@@ -99,7 +99,7 @@ export default class ContactSelect extends Vue {
*
* @return {ContactsLoaderFunction} a function that returns a promise which returns a list of contacts
*/
get findAllContacts () : ContactsLoaderFunction {
get findAllContacts (): ContactsLoaderFunction {
return () => { return this.$api.contacts.findAll() }
}
......
......@@ -242,7 +242,7 @@ export default class DateTimePicker extends Vue {
this.activeTab = 0
}
getPickerValue ():string {
getPickerValue (): string {
if (this.isDatetimeUsed) {
return this.datePickerValue + ' ' + this.timePickerValue
}
......
......@@ -817,7 +817,7 @@ export default class DevicePropertyForm extends Vue {
*
* @returns {Compartment[]} list of compartments
*/
get compartmentItems () : Compartment[] {
get compartmentItems (): Compartment[] {
return this.compartments
}
......
......@@ -112,7 +112,7 @@ export default class DevicePropertySelect extends Vue {
*
* @return {DevicePropertysLoaderFunction} a function that returns the list of DeviceProperties
*/
get getAvailableDeviceProperties () : DevicePropertysLoaderFunction {
get getAvailableDeviceProperties (): DevicePropertysLoaderFunction {
return () => new Promise((resolve) => {
resolve(
this.properties
......
......@@ -63,7 +63,7 @@ export default class DotMenuActionCopy extends Vue {
required: true,
type: String
})
readonly path!:string
readonly path!: string
@Prop({
default: false,
......
......@@ -143,7 +143,7 @@ export default class CommonActionForm extends Vue {
type: String
})
// @ts-ignore
readonly currentUserMail:string|null
readonly currentUserMail: string|null
async fetch () {
try {
......
......@@ -184,7 +184,7 @@ export default class DeviceCalibationActionForm extends Vue {
type: String
})
// @ts-ignore
readonly currentUserMail:string|null
readonly currentUserMail: string|null
created () {
this.createActionCopy(this.value)
......@@ -274,7 +274,7 @@ readonly currentUserMail:string|null
return innerFunc
}
measuredQuantitiesNotEmpty (selectedMeasuredQuantities: DeviceProperty[]) : boolean | string {
measuredQuantitiesNotEmpty (selectedMeasuredQuantities: DeviceProperty[]): boolean | string {
// in case that there are no measured quantities at all to use, we don't want
// to complain about that
if (this.measuredQuantities.length === 0) {
......
......@@ -165,7 +165,7 @@ export default class GenericActionCard extends Vue {
this.showDetails = !this.showDetails
}
get actionDate ():string {
get actionDate (): string {
let actionDate = dateToDateTimeString(this.value.beginDate)
if (this.value.endDate) {
actionDate += ' - ' + dateToDateTimeString(this.value.endDate)
......
......@@ -131,7 +131,7 @@ export default class GenericActionForm extends Vue {
type: String
})
// @ts-ignore
readonly currentUserMail:string|null
readonly currentUserMail: string|null
created () {
// create a copy of the original value on which all operations will be applied
......
......@@ -168,7 +168,7 @@ export default class SoftwareUpdateActionForm extends Vue {
type: String
})
// @ts-ignore
readonly currentUserMail:string|null
readonly currentUserMail: string|null
async fetch (): Promise<any> {
await this.fetchSoftwareTypes()
......
......@@ -243,7 +243,7 @@ export default class ConfigurationDynamicLocationActionDataForm extends mixins(R
return this.value.elevationDatumName
}
update (key: string, value: any) : void {
update (key: string, value: any): void {
const copy = DynamicLocationBeginAction.createFromObject(this.value)
switch (key) {
......@@ -397,7 +397,7 @@ export default class ConfigurationDynamicLocationActionDataForm extends mixins(R
]
}
combine (a: any[], b: any[]) : any[] {
combine (a: any[], b: any[]): any[] {
const result: any[] = []
a.forEach(x => result.push(x))
b.forEach(x => result.push(x))
......
......@@ -146,7 +146,7 @@ export default class ConfigurationDynamicLocationEndActionDataForm extends mixin
})
readonly latestDateExclusive!: DateTime | null
update (key: string, value: any) : void {
update (key: string, value: any): void {
const copy = DynamicLocationEndAction.createFromObject(this.value)
switch (key) {
......@@ -223,7 +223,7 @@ export default class ConfigurationDynamicLocationEndActionDataForm extends mixin
]
}
combine (a: any[], b: any[]) : any[] {
combine (a: any[], b: any[]): any[] {
const result: any[] = []
a.forEach(x => result.push(x))
b.forEach(x => result.push(x))
......
......@@ -253,7 +253,7 @@ export default class ConfigurationStaticLocationBeginActionDataForm extends mixi
return extractStationaryLocationFromStaticLocationBeginAction(this.value)
}
update (key: string, value: any) : void {
update (key: string, value: any): void {
const copy = StaticLocationBeginAction.createFromObject(this.value)
switch (key) {
......@@ -357,7 +357,7 @@ export default class ConfigurationStaticLocationBeginActionDataForm extends mixi
]
}
combine (a: any[], b: any[]) : any[] {
combine (a: any[], b: any[]): any[] {
const result: any[] = []
a.forEach(x => result.push(x))
b.forEach(x => result.push(x))
......
......@@ -146,7 +146,7 @@ export default class ConfigurationStaticLocationEndActionDataForm extends mixins
})
readonly latestDateExclusive!: DateTime | null
update (key: string, value: any) : void {
update (key: string, value: any): void {
const copy = StaticLocationEndAction.createFromObject(this.value)
switch (key) {
......@@ -223,7 +223,7 @@ export default class ConfigurationStaticLocationEndActionDataForm extends mixins
]
}
combine (a: any[], b: any[]) : any[] {
combine (a: any[], b: any[]): any[] {
const result: any[] = []
a.forEach(x => result.push(x))
b.forEach(x => result.push(x))
......
......@@ -91,7 +91,7 @@ export default class ConfigurationsBasicDataForm extends Vue {
required: true,
type: Configuration
})
readonly value!:Configuration
readonly value!: Configuration
readonly LOCATION_TYPE_STATIONARY = 'Stationary'
readonly LOCATION_TYPE_DYNAMIC = 'Dynamic'
......@@ -106,7 +106,7 @@ export default class ConfigurationsBasicDataForm extends Vue {
get configurationStates () { return this.$store.state.configurations.configurationStates }
get projectNames () { return this.$store.getters['configurations/projectNames'] }
// @ts-ignore
update (key:string, value:any) {
update (key: string, value: any) {
// @ts-ignore
if (typeof this.value[key] !== 'undefined') {
const newObj = Configuration.createFromObject(this.value)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment