@putout/formatter-dump 6.0.2 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/dump.js +7 -15
  2. package/package.json +9 -11
package/lib/dump.js CHANGED
@@ -1,18 +1,10 @@
1
+ import {styleText} from 'node:util';
1
2
  import {
2
3
  table,
3
4
  getBorderCharacters,
4
5
  } from 'table';
5
- import chalk from 'chalk';
6
6
  import {jsonFormatter} from '@putout/formatter-json';
7
7
 
8
- const {
9
- underline,
10
- red,
11
- grey,
12
- bold,
13
- redBright,
14
- } = chalk;
15
-
16
8
  export default ({name, places, index, count, filesCount, errorsCount}) => {
17
9
  const json = jsonFormatter({
18
10
  name,
@@ -35,7 +27,7 @@ export default ({name, places, index, count, filesCount, errorsCount}) => {
35
27
  const line = buildLine(places);
36
28
 
37
29
  output.push([
38
- underline(name),
30
+ styleText('underline', name),
39
31
  table(line, {
40
32
  border: getBorderCharacters('void'),
41
33
  drawHorizontalLine: () => false,
@@ -46,8 +38,8 @@ export default ({name, places, index, count, filesCount, errorsCount}) => {
46
38
  const maybeErrors = errorsCount === 1 ? 'error' : 'errors';
47
39
  const maybeFiles = filesCount === 1 ? 'file' : 'files';
48
40
 
49
- output.push(bold(redBright(`✖ ${errorsCount} ${maybeErrors} in ${filesCount} ${maybeFiles}`)));
50
- output.push(bold(redBright(' fixable with the `--fix` option')));
41
+ output.push(styleText(['bold', 'redBright'], `✖ ${errorsCount} ${maybeErrors} in ${filesCount} ${maybeFiles}`));
42
+ output.push(styleText(['bold', 'redBright'], ' fixable with the `--fix` option'));
51
43
 
52
44
  return output.join('\n') + '\n';
53
45
  };
@@ -59,9 +51,9 @@ function buildLine(places) {
59
51
  const {line, column} = position;
60
52
 
61
53
  data.push([
62
- grey(`${line}:${column}`),
63
- `${red('error')} ${message}`,
64
- grey(rule),
54
+ styleText('gray', `${line}:${column}`),
55
+ `${styleText('red', 'error')} ${message}`,
56
+ styleText('gray', rule),
65
57
  ]);
66
58
  }
67
59
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/formatter-dump",
3
- "version": "6.0.2",
3
+ "version": "7.0.0",
4
4
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
5
5
  "description": "🐊Putout formatter stores output and dump it on end",
6
6
  "homepage": "https://github.com/coderaiser/putout/tree/master/packages/formatter-dump#readme",
@@ -25,7 +25,6 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@putout/formatter-json": "^3.0.0",
28
- "chalk": "^5.3.0",
29
28
  "table": "^6.0.1"
30
29
  },
31
30
  "keywords": [
@@ -35,21 +34,20 @@
35
34
  "dump"
36
35
  ],
37
36
  "devDependencies": {
38
- "@putout/eslint-flat": "^3.0.0",
39
- "@putout/plugin-remove-unused-variables": "*",
40
- "@putout/test": "^14.0.0",
41
- "c8": "^10.0.0",
42
- "eslint": "^9.0.0",
37
+ "@putout/plugin-variables": "*",
38
+ "@putout/test": "^15.0.0",
39
+ "eslint": "^10.0.0",
43
40
  "eslint-plugin-n": "^17.0.0",
44
- "eslint-plugin-putout": "^28.0.0",
45
- "madrun": "^11.0.0"
41
+ "eslint-plugin-putout": "^31.0.0",
42
+ "madrun": "^13.0.0",
43
+ "superc8": "^12.0.0"
46
44
  },
47
45
  "peerDependencies": {
48
- "putout": ">=40"
46
+ "putout": ">=42"
49
47
  },
50
48
  "license": "MIT",
51
49
  "engines": {
52
- "node": ">=20"
50
+ "node": ">=22"
53
51
  },
54
52
  "publishConfig": {
55
53
  "access": "public"