From 68610c478e6533d67335d7d65c6ab909d17a70b6 Mon Sep 17 00:00:00 2001 From: Shinnosuke Watanabe Date: Fri, 25 Nov 2016 17:58:42 +0900 Subject: [PATCH] update devDependencies Highlights: * VFile#quiet no longer exists, and VFile#fail throws an error instead of returning value. https://github.com/wooorm/vfile/releases/tag/2.0.0 * ESLint now supports abeautiful `codeframe` formatter. https://github.com/eslint/eslint/commit/e46666b --- LICENSE | 2 +- README.md | 18 +++++++++--------- package.json | 15 +++++++++------ test.js | 4 ++-- 4 files changed, 21 insertions(+), 18 deletions(-) mode change 100755 => 100644 README.md mode change 100755 => 100644 test.js diff --git a/LICENSE b/LICENSE index a469a41..1837c1b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015 Shinnosuke Watanabe +Copyright (c) 2015 - 2016 Shinnosuke Watanabe Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 358c273..496b783 --- a/README.md +++ b/README.md @@ -6,16 +6,16 @@ [![Dependency Status](https://david-dm.org/shinnn/vfile-messages-to-vscode-diagnostics.svg)](https://david-dm.org/shinnn/vfile-messages-to-vscode-diagnostics) [![devDependency Status](https://david-dm.org/shinnn/vfile-messages-to-vscode-diagnostics/dev-status.svg)](https://david-dm.org/shinnn/vfile-messages-to-vscode-diagnostics#info=devDependencies) -A [Node](https://nodejs.org/) module to convert [VFile#messages](https://github.com/wooorm/vfile#vfilemessages) into an array of [VS Code](https://code.visualstudio.com/) [diagnostic](https://github.com/Microsoft/vscode-extension-vscode/blob/0.10.6/vscode.d.ts#L2220)s +A [Node.js](https://nodejs.org/) module to convert [VFile#messages](https://github.com/wooorm/vfile#vfilemessages) into an array of [VS Code](https://code.visualstudio.com/) [diagnostic](https://github.com/Microsoft/vscode-languageserver-node/blob/v2.6.2/types/src/main.ts#L153)s ```javascript const VFile = require('vfile'); const vFileMessagesToVSCodeDiagnostics = require('vfile-messages-to-vscode-diagnostics'); -vFileMessagesToVSCodeDiagnostics(new VFile().warn('error!', {line: 10, column: 2})); +vFileMessagesToVSCodeDiagnostics(new VFile().message('warning!', {line: 10, column: 2})); /* => [{ - message: 'error!', + message: 'warning!', severity: 2, range: { start: {line: 9, character: 1}, @@ -51,8 +51,8 @@ const VFile = require('vfile'); const vFileMessagesToVSCodeDiagnostics = require('vfile-messages-to-vscode-diagnostics'); const file = new VFile(); -file.warn('err1'); -file.warn('err2', { +file.message('warning1'); +file.message('warning2', { position: { start: {line: 23, column: 5}, end: {line: 23, column: 11} @@ -62,14 +62,14 @@ file.warn('err2', { vFileMessagesToVSCodeDiagnostics(file.messages); /* => [{ - message: 'err1', + message: 'warning1', severity: 2, range: { start: {line: 0, character: 0}, end: {line: 0, character: 0} - } + } }, { - message: 'err2', + message: 'warning2', severity: 2, range: { start: {line: 22, character: 4}, @@ -81,6 +81,6 @@ vFileMessagesToVSCodeDiagnostics(file.messages); ## License -Copyright (c) 2015 [Shinnosuke Watanabe](https://github.com/shinnn) +Copyright (c) 2015 - 2016 [Shinnosuke Watanabe](https://github.com/shinnn) Licensed under [the MIT License](./LICENSE). diff --git a/package.json b/package.json index 1031bce..56a6103 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "repository": "shinnn/vfile-messages-to-vscode-diagnostics", "author": "Shinnosuke Watanabe (https://github.com/shinnn)", "scripts": { - "pretest": "eslint --fix --config @shinnn/node index.js test.js", + "pretest": "eslint --fix --format=codeframe index.js test.js", "test": "node --throw-deprecation --track-heap-objects test.js", "coverage": "istanbul cover test.js" }, @@ -36,10 +36,13 @@ }, "devDependencies": { "@shinnn/eslint-config-node": "^3.0.0", - "alex": "^3.1.0", - "eslint": "^3.2.2", - "istanbul": "^0.4.4", - "tape": "^4.6.0", - "vfile": "^1.4.0" + "alex": "^4.0.1", + "eslint": "^3.10.2", + "istanbul": "^0.4.5", + "tape": "^4.6.3", + "vfile": "^2.0.0" + }, + "eslintConfig": { + "extends": "@shinnn/node" } } diff --git a/test.js b/test.js old mode 100755 new mode 100644 index 2d83cbd..a3cf1ab --- a/test.js +++ b/test.js @@ -54,8 +54,8 @@ test('vFileMessagesToVSCodeDiagnostics()', t => { ); const file = new VFile(); - file.quiet = true; - file.fail('foo'); + file.message('foo'); + file.messages[0].fatal = true; t.deepEqual( vFileMessagesToVSCodeDiagnostics(file.messages),