@putout/plugin-printer 7.0.0 → 7.1.1

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.
package/README.md CHANGED
@@ -16,6 +16,7 @@ npm i @putout/plugin-printer -D
16
16
  - ✅ [add-args](#add-args);
17
17
  - ✅ [apply-breakline](#apply-breakline);
18
18
  - ✅ [apply-computed-print](#apply-computed-print);
19
+ - ✅ [apply-create-test-url](#apply-create-test-url);
19
20
  - ✅ [apply-linebreak](#apply-linebreak);
20
21
  - ✅ [apply-types](#apply-types);
21
22
  - ✅ [declare](#declare);
@@ -31,6 +32,7 @@ npm i @putout/plugin-printer -D
31
32
  "printer/apply-breakline": "on",
32
33
  "printer/apply-linebreak": "on",
33
34
  "printer/apply-computed-print": "on",
35
+ "printer/apply-create-test-url": "on",
34
36
  "printer/apply-types": "on",
35
37
  "printer/declare": "on",
36
38
  "printer/remove-args": "on"
@@ -104,6 +106,26 @@ print(path.get('block'));
104
106
  print('__block');
105
107
  ```
106
108
 
109
+ ## apply-create-test-url
110
+
111
+ Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/ddf1425ace2a53e9010b82ded1dd1012/3e56365b58d01ebe8abba46caf04ed5e51043feb).
112
+
113
+ ### ❌ Example of incorrect code
114
+
115
+ ```js
116
+ import {createTest} from '#test';
117
+
118
+ const {test, fixture} = createTest(__dirname);
119
+ ```
120
+
121
+ ### ✅ Example of correct code
122
+
123
+ ```js
124
+ import {createTest} from '#test';
125
+
126
+ const {test, fixture} = createTest(import.meta.url);
127
+ ```
128
+
107
129
  ## remove-args
108
130
 
109
131
  ### ❌ Example of incorrect code
@@ -0,0 +1,13 @@
1
+ import {operator} from 'putout';
2
+
3
+ const {isESM} = operator;
4
+
5
+ export const report = () => `Use 'import.meta.url' instead of '__dirname'`;
6
+
7
+ export const match = () => ({
8
+ 'createTest(__dirname)': (vars, path) => isESM(path),
9
+ });
10
+
11
+ export const replace = () => ({
12
+ 'createTest(__dirname)': 'createTest(import.meta.url)',
13
+ });
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import * as applyCreateTestUrl from './apply-create-test-url/index.js';
1
2
  import * as removeArgs from './remove-args/index.js';
2
3
  import * as applyBreakline from './apply-breakline/index.js';
3
4
  import * as applyLinebreak from './apply-linebreak/index.js';
@@ -16,4 +17,5 @@ export const rules = {
16
17
  declare,
17
18
  'apply-types': applyTypes,
18
19
  'remove-legacy-test-declaration': removeLegacyTestDeclaration,
20
+ 'apply-create-test-url': applyCreateTestUrl,
19
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-printer",
3
- "version": "7.0.0",
3
+ "version": "7.1.1",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds support of transformations for @putout/printer",
@@ -34,7 +34,7 @@
34
34
  "printer"
35
35
  ],
36
36
  "devDependencies": {
37
- "@putout/eslint-flat": "^3.0.0",
37
+ "@putout/eslint-flat": "^4.0.0",
38
38
  "@putout/plugin-declare-before-reference": "*",
39
39
  "@putout/plugin-for-of": "*",
40
40
  "@putout/plugin-remove-nested-blocks": "*",
@@ -42,7 +42,7 @@
42
42
  "c8": "^10.0.0",
43
43
  "eslint": "^10.0.0-alpha.0",
44
44
  "eslint-plugin-n": "^17.0.0",
45
- "eslint-plugin-putout": "^29.0.0",
45
+ "eslint-plugin-putout": "^30.0.0",
46
46
  "madrun": "^12.0.0",
47
47
  "montag": "^1.2.1",
48
48
  "nodemon": "^3.0.1"