Skip to content

Commit 627ee47

Browse files
committed
chore(lint): added comma-dangle rule
1 parent 530602e commit 627ee47

File tree

185 files changed

+1230
-1229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

185 files changed

+1230
-1229
lines changed

.eslintrc.js

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,59 @@
11
module.exports = {
22
root: true,
33
env: {
4-
browser: true
4+
browser: true,
55
},
66
extends: [
77
'plugin:vue/recommended',
88
'@vue/standard',
9-
'@vue/typescript/recommended'
9+
'@vue/typescript/recommended',
1010
],
1111
parserOptions: {
12-
ecmaVersion: 2020
12+
ecmaVersion: 2020,
1313
},
1414
globals: {
1515
bridge: true,
1616
chrome: true,
1717
localStorage: 'off',
1818
HTMLDocument: true,
1919
name: 'off',
20-
browser: true
20+
browser: true,
2121
},
2222
rules: {
2323
'vue/html-closing-bracket-newline': [
2424
'error',
2525
{
2626
singleline: 'never',
27-
multiline: 'always'
28-
}
27+
multiline: 'always',
28+
},
2929
],
3030
'no-var': ['error'],
3131
'@typescript-eslint/member-delimiter-style': [
3232
'error',
3333
{
3434
multiline: {
35-
delimiter: 'none'
35+
delimiter: 'none',
3636
},
3737
singleline: {
38-
delimiter: 'comma'
39-
}
40-
}
38+
delimiter: 'comma',
39+
},
40+
},
4141
],
4242
'@typescript-eslint/ban-ts-comment': 'warn',
4343
'@typescript-eslint/no-use-before-define': 'off',
4444
'@typescript-eslint/explicit-module-boundary-types': 'off',
4545
camelcase: 'warn',
4646
'no-prototype-builtins': 'off',
4747
'no-use-before-define': 'off',
48-
'no-console': ['error', { allow: ['warn', 'error'] }]
48+
'no-console': ['error', { allow: ['warn', 'error'] }],
49+
'comma-dangle': ['error', 'always-multiline'],
4950
},
5051
ignorePatterns: [
5152
'node_modules/',
5253
'/packages/*/lib/',
5354
'dist/',
5455
'build/',
55-
'/legacy'
56+
'/legacy',
5657
],
5758
overrides: [
5859
{
@@ -61,30 +62,30 @@ module.exports = {
6162
'sign-firefox.js',
6263
'packages/build-tools/**',
6364
'packages/shell-electron/**',
64-
'**webpack.config.js'
65+
'**webpack.config.js',
6566
],
6667
rules: {
6768
'@typescript-eslint/no-var-requires': 'off',
68-
'@typescript-eslint/camelcase': 'off'
69-
}
69+
'@typescript-eslint/camelcase': 'off',
70+
},
7071
},
7172
{
7273
files: ['packages/shell-dev-vue3/**'],
7374
rules: {
74-
'vue/valid-template-root': 'off'
75-
}
75+
'vue/valid-template-root': 'off',
76+
},
7677
},
7778
{
7879
files: [
7980
'packages/shell-dev-vue2/**',
80-
'packages/shell-dev-vue3/**'
81+
'packages/shell-dev-vue3/**',
8182
],
8283
rules: {
8384
'@typescript-eslint/no-unused-vars': 'off',
8485
'vue/require-default-prop': 'off',
8586
'vue/require-prop-types': 'off',
86-
'no-console': 'off'
87-
}
88-
}
89-
]
87+
'no-console': 'off',
88+
},
89+
},
90+
],
9091
}

cypress/.eslintrc.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module.exports = {
22
plugins: [
3-
'cypress'
3+
'cypress',
44
],
55
env: {
66
mocha: true,
7-
'cypress/globals': true
7+
'cypress/globals': true,
88
},
99
rules: {
10-
strict: 'off'
11-
}
10+
strict: 'off',
11+
},
1212
}

packages/api/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function setupDevtoolsPlugin<TSettings = any> (pluginDescriptor: PluginDe
2323
list.push({
2424
pluginDescriptor,
2525
setupFn,
26-
proxy
26+
proxy,
2727
})
2828

2929
if (proxy) setupFn(proxy.proxiedTarget as DevtoolsPluginApi<TSettings>)

packages/api/src/proxy.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class ApiProxy<TTarget extends DevtoolsPluginApi<any> = DevtoolsPluginApi
5656
// noop
5757
}
5858
currentSettings = value
59-
}
59+
},
6060
}
6161

6262
hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => {
@@ -73,11 +73,11 @@ export class ApiProxy<TTarget extends DevtoolsPluginApi<any> = DevtoolsPluginApi
7373
return (...args) => {
7474
this.onQueue.push({
7575
method: prop,
76-
args
76+
args,
7777
})
7878
}
7979
}
80-
}
80+
},
8181
})
8282

8383
this.proxiedTarget = new Proxy({} as TTarget, {
@@ -91,7 +91,7 @@ export class ApiProxy<TTarget extends DevtoolsPluginApi<any> = DevtoolsPluginApi
9191
this.targetQueue.push({
9292
method: prop,
9393
args,
94-
resolve: () => { /* noop */ }
94+
resolve: () => { /* noop */ },
9595
})
9696
return this.fallbacks[prop](...args)
9797
}
@@ -101,12 +101,12 @@ export class ApiProxy<TTarget extends DevtoolsPluginApi<any> = DevtoolsPluginApi
101101
this.targetQueue.push({
102102
method: prop,
103103
args,
104-
resolve
104+
resolve,
105105
})
106106
})
107107
}
108108
}
109-
}
109+
},
110110
})
111111
}
112112

packages/app-backend-api/src/api.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
getPluginDefaultSettings,
77
getPluginSettings,
88
setPluginSettings,
9-
StateEditor
9+
StateEditor,
1010
} from '@vue-devtools/shared-utils'
1111
import {
1212
Hooks,
@@ -20,7 +20,7 @@ import {
2020
EditStatePayload,
2121
WithId,
2222
ComponentTreeNode,
23-
ComponentDevtoolsOptions
23+
ComponentDevtoolsOptions,
2424
} from '@vue/devtools-api'
2525
import { DevtoolsHookable } from './hooks'
2626
import { BackendContext } from './backend-context'
@@ -56,15 +56,15 @@ export class DevtoolsApi {
5656
const payload = await this.callHook(Hooks.TRANSFORM_CALL, {
5757
callName,
5858
inArgs: args,
59-
outArgs: args.slice()
59+
outArgs: args.slice(),
6060
})
6161
return payload.outArgs
6262
}
6363

6464
async getAppRecordName (app: App, defaultName: string): Promise<string> {
6565
const payload = await this.callHook(Hooks.GET_APP_RECORD_NAME, {
6666
app,
67-
name: null
67+
name: null,
6868
})
6969
if (payload.name) {
7070
return payload.name
@@ -76,14 +76,14 @@ export class DevtoolsApi {
7676
async getAppRootInstance (app: App) {
7777
const payload = await this.callHook(Hooks.GET_APP_ROOT_INSTANCE, {
7878
app,
79-
root: null
79+
root: null,
8080
})
8181
return payload.root
8282
}
8383

8484
async registerApplication (app: App) {
8585
await this.callHook(Hooks.REGISTER_APPLICATION, {
86-
app
86+
app,
8787
})
8888
}
8989

@@ -92,7 +92,7 @@ export class DevtoolsApi {
9292
componentInstance: instance,
9393
componentTreeData: null,
9494
maxDepth,
95-
filter
95+
filter,
9696
})
9797
return payload.componentTreeData
9898
}
@@ -102,15 +102,15 @@ export class DevtoolsApi {
102102
app,
103103
componentInstance: instance,
104104
treeNode,
105-
filter
105+
filter,
106106
})
107107
return payload.treeNode
108108
}
109109

110110
async walkComponentParents (instance: ComponentInstance) {
111111
const payload = await this.callHook(Hooks.WALK_COMPONENT_PARENTS, {
112112
componentInstance: instance,
113-
parentInstances: []
113+
parentInstances: [],
114114
})
115115
return payload.parentInstances
116116
}
@@ -119,47 +119,47 @@ export class DevtoolsApi {
119119
const payload = await this.callHook(Hooks.INSPECT_COMPONENT, {
120120
app,
121121
componentInstance: instance,
122-
instanceData: null
122+
instanceData: null,
123123
})
124124
return payload.instanceData
125125
}
126126

127127
async getComponentBounds (instance: ComponentInstance) {
128128
const payload = await this.callHook(Hooks.GET_COMPONENT_BOUNDS, {
129129
componentInstance: instance,
130-
bounds: null
130+
bounds: null,
131131
})
132132
return payload.bounds
133133
}
134134

135135
async getComponentName (instance: ComponentInstance) {
136136
const payload = await this.callHook(Hooks.GET_COMPONENT_NAME, {
137137
componentInstance: instance,
138-
name: null
138+
name: null,
139139
})
140140
return payload.name
141141
}
142142

143143
async getComponentInstances (app: App) {
144144
const payload = await this.callHook(Hooks.GET_COMPONENT_INSTANCES, {
145145
app,
146-
componentInstances: []
146+
componentInstances: [],
147147
})
148148
return payload.componentInstances
149149
}
150150

151151
async getElementComponent (element: HTMLElement | any) {
152152
const payload = await this.callHook(Hooks.GET_ELEMENT_COMPONENT, {
153153
element,
154-
componentInstance: null
154+
componentInstance: null,
155155
})
156156
return payload.componentInstance
157157
}
158158

159159
async getComponentRootElements (instance: ComponentInstance) {
160160
const payload = await this.callHook(Hooks.GET_COMPONENT_ROOT_ELEMENTS, {
161161
componentInstance: instance,
162-
rootElements: []
162+
rootElements: [],
163163
})
164164
return payload.rootElements
165165
}
@@ -172,15 +172,15 @@ export class DevtoolsApi {
172172
path: arrayPath,
173173
type,
174174
state,
175-
set: (object, path = arrayPath, value = state.value, cb?) => this.stateEditor.set(object, path, value, cb || this.stateEditor.createDefaultSetCallback(state))
175+
set: (object, path = arrayPath, value = state.value, cb?) => this.stateEditor.set(object, path, value, cb || this.stateEditor.createDefaultSetCallback(state)),
176176
})
177177
return payload.componentInstance
178178
}
179179

180180
async getComponentDevtoolsOptions (instance: ComponentInstance): Promise<ComponentDevtoolsOptions> {
181181
const payload = await this.callHook(Hooks.GET_COMPONENT_DEVTOOLS_OPTIONS, {
182182
componentInstance: instance,
183-
options: null
183+
options: null,
184184
})
185185
return payload.options || {}
186186
}
@@ -190,10 +190,10 @@ export class DevtoolsApi {
190190
}> {
191191
const payload = await this.callHook(Hooks.GET_COMPONENT_RENDER_CODE, {
192192
componentInstance: instance,
193-
code: null
193+
code: null,
194194
})
195195
return {
196-
code: payload.code
196+
code: payload.code,
197197
}
198198
}
199199

@@ -203,7 +203,7 @@ export class DevtoolsApi {
203203
layerId: eventData.layerId,
204204
app,
205205
data: eventData.event.data,
206-
all: eventData.all
206+
all: eventData.all,
207207
})
208208
return payload.data
209209
}
@@ -217,7 +217,7 @@ export class DevtoolsApi {
217217
inspectorId,
218218
app,
219219
filter,
220-
rootNodes: []
220+
rootNodes: [],
221221
})
222222
return payload.rootNodes
223223
}
@@ -227,7 +227,7 @@ export class DevtoolsApi {
227227
inspectorId,
228228
app,
229229
nodeId,
230-
state: null
230+
state: null,
231231
})
232232
return payload.state
233233
}
@@ -241,7 +241,7 @@ export class DevtoolsApi {
241241
path: arrayPath,
242242
type,
243243
state,
244-
set: (object, path = arrayPath, value = state.value, cb?) => this.stateEditor.set(object, path, value, cb || this.stateEditor.createDefaultSetCallback(state))
244+
set: (object, path = arrayPath, value = state.value, cb?) => this.stateEditor.set(object, path, value, cb || this.stateEditor.createDefaultSetCallback(state)),
245245
})
246246
}
247247
}

0 commit comments

Comments
 (0)