Skip to content

Commit 4378c8d

Browse files
authored
style: replace eslint-plugin-vue-libs with standard config (#6148)
1 parent ffc0686 commit 4378c8d

File tree

35 files changed

+459
-400
lines changed

35 files changed

+459
-400
lines changed

.eslintrc.js

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,19 @@
11
module.exports = {
22
extends: [
3-
'plugin:vue-libs/recommended'
3+
'@vue/standard'
44
],
5-
plugins: [
6-
'node'
7-
],
8-
env: {
9-
'jest': true
10-
},
115
globals: {
126
name: 'off'
137
},
148
rules: {
15-
'indent': ['error', 2, {
16-
'MemberExpression': 'off'
9+
indent: ['error', 2, {
10+
MemberExpression: 'off'
1711
}],
12+
quotes: [2, 'single', { avoidEscape: true, allowTemplateLiterals: true }],
13+
'quote-props': 'off',
1814
'no-shadow': ['error'],
1915
'node/no-extraneous-require': ['error', {
20-
'allowModules': [
16+
allowModules: [
2117
'@vue/cli-service',
2218
'@vue/cli-test-utils'
2319
]
@@ -26,6 +22,9 @@ module.exports = {
2622
overrides: [
2723
{
2824
files: ['**/__tests__/**/*.js', '**/cli-test-utils/**/*.js'],
25+
env: {
26+
jest: true
27+
},
2928
rules: {
3029
'node/no-extraneous-require': 'off'
3130
}

packages/@vue/babel-preset-app/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,13 @@ module.exports = (context, options = {}) => {
259259
return {
260260
sourceType: 'unambiguous',
261261
overrides: [{
262-
exclude: [/@babel[\/|\\\\]runtime/, /core-js/],
262+
exclude: [/@babel[/|\\\\]runtime/, /core-js/],
263263
presets,
264264
plugins
265265
}, {
266266
// there are some untranspiled code in @babel/runtime
267267
// https://github.com/babel/babel/issues/9903
268-
include: [/@babel[\/|\\\\]runtime/],
268+
include: [/@babel[/|\\\\]runtime/],
269269
presets: [
270270
[require('@babel/preset-env'), envOptions]
271271
]

packages/@vue/cli-plugin-babel/codemods/__tests__/usePluginPreset.spec.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ defineTest(__dirname, 'usePluginPreset', null, 'default')
66
defineTest(__dirname, 'usePluginPreset', null, 'customConfig')
77
defineTest(__dirname, 'usePluginPreset', null, 'require')
88
defineTest(__dirname, 'usePluginPreset', null, 'templateLiteral')
9-

packages/@vue/cli-plugin-babel/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ function genTranspileDepRegex (transpileDependencies) {
1212
} else if (dep instanceof RegExp) {
1313
return dep.source
1414
}
15+
16+
throw new Error('transpileDependencies only accepts an array of string or regular expressions')
1517
})
1618
return deps.length ? new RegExp(deps.join('|')) : null
1719
}

packages/@vue/cli-plugin-e2e-nightwatch/nightwatch.config.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const defaultSettings = {
3333
test_settings: {
3434
default: {
3535
detailed_output: !concurrentMode,
36-
launch_url: '${VUE_DEV_SERVER_URL}'
36+
launch_url: '${VUE_DEV_SERVER_URL}' // eslint-disable-line no-template-curly-in-string
3737
},
3838

3939
chrome: {
@@ -56,10 +56,12 @@ const defaultSettings = {
5656
}
5757
}
5858
},
59-
webdriver: useSelenium ? {} : {
60-
server_path: geckodriver.path,
61-
port: 4444
62-
}
59+
webdriver: useSelenium
60+
? {}
61+
: {
62+
server_path: geckodriver.path,
63+
port: 4444
64+
}
6365
}
6466
}
6567
}

packages/@vue/cli-plugin-e2e-webdriverio/__tests__/wdioGenerator.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ test('should add types to existing tsconfig.json', async () => {
1111
}
1212
}
1313
})
14-
await write('tsconfig.json', JSON.stringify({ compilerOptions: { types: ['some-type'] }}))
14+
await write('tsconfig.json', JSON.stringify({ compilerOptions: { types: ['some-type'] } }))
1515

1616
const invoke = require('@vue/cli/lib/invoke')
1717
await invoke('e2e-webdriverio', { webdrivers: ['chrome'] }, dir)
1818

1919
const tsconfig = await read('tsconfig.json')
2020
expect(tsconfig).toMatch(/\r?\n$/)
21-
expect(JSON.parse(tsconfig)['compilerOptions']['types'])
21+
expect(JSON.parse(tsconfig).compilerOptions.types)
2222
.toEqual(['some-type', 'mocha', '@wdio/mocha-framework', '@wdio/sync'])
2323
})

packages/@vue/cli-plugin-eslint/generator/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ module.exports = (api, { config, lintOn = [] }, rootOptions, invoking) => {
4444
'pre-commit': 'lint-staged'
4545
}
4646
const extensions = require('../eslintOptions').extensions(api)
47-
.map(ext => ext.replace(/^\./, '')) // remove the leading `.`
47+
.map(ext => ext.replace(/^\./, '')) // remove the leading `.`
4848
pkg['lint-staged'] = {
4949
[`*.{${extensions.join(',')}}`]: 'vue-cli-service lint'
5050
}

packages/@vue/cli-plugin-pwa/__tests__/pwaPlugin.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ test('pwa', async () => {
5959
browser = launched.browser
6060

6161
// workbox plugin fetches scripts from CDN so it takes a while...
62-
await new Promise(r => setTimeout(r, process.env.CI ? 5000 : 2000))
62+
await new Promise(resolve => setTimeout(resolve, process.env.CI ? 5000 : 2000))
6363
const logs = launched.logs
6464
expect(logs.some(msg => msg.match(/Content has been cached for offline use/))).toBe(true)
6565
expect(logs.some(msg => msg.match(/App is being served from cache by a service worker/))).toBe(true)

packages/@vue/cli-plugin-pwa/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,9 @@ module.exports = (api, options) => {
5454
]
5555
}
5656

57-
const defaultGenerateSWOptions = workboxPluginMode === 'GenerateSW' ? {
58-
cacheId: name
59-
} : {}
57+
const defaultGenerateSWOptions = workboxPluginMode === 'GenerateSW'
58+
? { cacheId: name }
59+
: {}
6060

6161
const workBoxConfig = Object.assign(defaultOptions, defaultGenerateSWOptions, userOptions.workboxOptions)
6262

packages/@vue/cli-plugin-pwa/ui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ module.exports = api => {
129129
// Update app manifest (only when there's a manifest.json file,
130130
// otherwise it will be inferred from options in vue.config.js)
131131
if (data.manifest) {
132-
const name = result['name']
132+
const name = result.name
133133
if (name) {
134134
onWriteApi.setData('manifest', {
135135
name,
136136
short_name: name
137137
})
138138
}
139139

140-
const themeColor = result['themeColor']
140+
const themeColor = result.themeColor
141141
if (themeColor) {
142142
onWriteApi.setData('manifest', {
143143
theme_color: themeColor

0 commit comments

Comments
 (0)