Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 87d3cc8

Browse filesBrowse files
authored
feat: switch to stylish formatter for eslint (#6748)
1 parent 2658903 commit 87d3cc8
Copy full SHA for 87d3cc8

File tree

7 files changed

+16
-12
lines changed
Filter options

7 files changed

+16
-12
lines changed

‎docs/core-plugins/eslint.md

Copy file name to clipboardExpand all lines: docs/core-plugins/eslint.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
Options:
1313
14-
--format [formatter] specify formatter (default: codeframe)
14+
--format [formatter] specify formatter (default: stylish)
1515
--no-fix do not fix errors
1616
--max-errors specify number of errors to make build failed (default: 0)
1717
--max-warnings specify number of warnings to make build failed (default: Infinity)

‎docs/ru/core-plugins/eslint.md

Copy file name to clipboardExpand all lines: docs/ru/core-plugins/eslint.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
Опции:
1313
14-
--format [formatter] определяет форматтер (по умолчанию: codeframe)
14+
--format [formatter] определяет форматтер (по умолчанию: stylish)
1515
--no-fix отключает автоматическое исправление ошибок
1616
--max-errors количество ошибок, по достижению которого сборка заканчивается ошибкой (по умолчанию: 0)
1717
--max-warnings количество предупреждений, по достижению которого сборка заканчивается ошибкой (по умолчанию: Infinity)

‎packages/@vue/cli-plugin-eslint/README.md

Copy file name to clipboardExpand all lines: packages/@vue/cli-plugin-eslint/README.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
1212
Options:
1313
14-
--format [formatter] specify formatter (default: codeframe)
14+
--format [formatter] specify formatter (default: stylish)
1515
--no-fix do not fix errors
1616
--max-errors specify number of errors to make build failed (default: 0)
1717
--max-warnings specify number of warnings to make build failed (default: Infinity)

‎packages/@vue/cli-plugin-eslint/__tests__/eslintPlugin.spec.js

Copy file name to clipboardExpand all lines: packages/@vue/cli-plugin-eslint/__tests__/eslintPlugin.spec.js
+9-5Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ test('should persist cache', async () => {
227227
expect(has('node_modules/.cache/eslint/cache.json')).toBe(true)
228228
})
229229

230-
test.skip(`should use formatter 'codeframe'`, async () => {
231-
const project = await create('eslint-formatter-codeframe', {
230+
test(`should use formatter 'stylish'`, async () => {
231+
const project = await create('eslint-formatter-stylish', {
232232
plugins: {
233233
'@vue/cli-plugin-babel': {},
234234
'@vue/cli-plugin-eslint': {
@@ -259,9 +259,13 @@ test.skip(`should use formatter 'codeframe'`, async () => {
259259
isFirstMsg = false
260260
} else if (data.match(/semi/)) {
261261
// check the format of output
262-
// https://eslint.org/docs/user-guide/formatters/#codeframe
262+
// https://eslint.org/docs/user-guide/formatters/#stylish
263+
// it looks like:
264+
// ERROR in .../packages/test/eslint-formatter-stylish/src/main.js
265+
// 1:22 error Missing semicolon semi
266+
expect(data).toMatch(`src${path.sep}main.js`)
263267
expect(data).toMatch(`error`)
264-
expect(data).toMatch(`Missing semicolon (semi) at src${path.sep}main.js`)
268+
expect(data).toMatch(`Missing semicolon semi`)
265269

266270
server.stdin.write('close')
267271
done()
@@ -282,7 +286,7 @@ test(`should work with eslint v8`, async () => {
282286
}
283287
})
284288
const { read, write, run } = project
285-
await run('npm add -D eslint@^8.0.0-0 eslint-formatter-codeframe')
289+
await run('npm add -D eslint@^8.0.0-0')
286290
// should've applied airbnb autofix
287291
const main = await read('src/main.js')
288292
expect(main).toMatch(';')

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

Copy file name to clipboardExpand all lines: packages/@vue/cli-plugin-eslint/index.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ module.exports = (api, options) => {
5252
resolveModule('eslint/package.json', cwd) ||
5353
resolveModule('eslint/package.json', __dirname)
5454
),
55-
formatter: 'codeframe'
55+
formatter: 'stylish'
5656
}
5757
webpackConfig.plugin('eslint').use(eslintWebpackPlugin, [eslintWebpackPluginOptions])
5858
})
@@ -64,7 +64,7 @@ module.exports = (api, options) => {
6464
description: 'lint and fix source files',
6565
usage: 'vue-cli-service lint [options] [...files]',
6666
options: {
67-
'--format [formatter]': 'specify formatter (default: codeframe)',
67+
'--format [formatter]': 'specify formatter (default: stylish)',
6868
'--no-fix': 'do not fix errors or warnings',
6969
'--no-fix-warnings': 'fix errors, but do not fix warnings',
7070
'--max-errors [limit]':

‎packages/@vue/cli-plugin-eslint/lint.js

Copy file name to clipboardExpand all lines: packages/@vue/cli-plugin-eslint/lint.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ module.exports = async function lint (args = {}, api) {
124124
const reportWarningCount = resultResults.reduce((p, c) => p + c.warningCount, 0)
125125
process.cwd = processCwd
126126

127-
const formatter = await eslint.loadFormatter(args.format || 'codeframe')
127+
const formatter = await eslint.loadFormatter(args.format || 'stylish')
128128

129129
if (config.outputFile) {
130130
const outputFilePath = path.resolve(config.outputFile)

‎packages/@vue/cli-service/types/cli-service-test.ts

Copy file name to clipboardExpand all lines: packages/@vue/cli-service/types/cli-service-test.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const servicePlugin: ServicePlugin = (api, options) => {
1313
description: 'lint and fix source files',
1414
usage: 'vue-cli-service lint [options] [...files]',
1515
options: {
16-
'--format [formatter]': 'specify formatter (default: codeframe)'
16+
'--format [formatter]': 'specify formatter (default: stylish)'
1717
},
1818
details: 'For more options, see https://eslint.org/docs/user-guide/command-line-interface#options'
1919
},

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.