@putout/plugin-putout 28.11.0 → 28.12.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.
package/README.md CHANGED
@@ -53,6 +53,7 @@ npm i @putout/plugin-putout -D
53
53
  - ✅ [convert-dirname-to-url](#convert-dirname-to-url);
54
54
  - ✅ [convert-find-to-traverse](#convert-find-to-traverse);
55
55
  - ✅ [convert-get-rule-to-require](#convert-get-rule-to-require);
56
+ - ✅ [convert-get-file-content-to-read-file-content](#convert-get-file-content-to-read-file-content);
56
57
  - ✅ [convert-match-to-function](#convert-match-to-function);
57
58
  - ✅ [convert-method-to-property](#convert-method-to-property);
58
59
  - ✅ [convert-node-to-path-in-get-template-values](#convert-node-to-path-in-get-template-values);
@@ -152,6 +153,7 @@ npm i @putout/plugin-putout -D
152
153
  "putout/convert-url-to-dirname": "on",
153
154
  "putout/convert-report-to-function": "on",
154
155
  "putout/convert-get-rule-to-require": "on",
156
+ "putout/convert-get-file-content-to-read-file-content": "on",
155
157
  "putout/convert-progress-to-track-file": "on",
156
158
  "putout/convert-plugins-element-to-tuple": "on",
157
159
  "putout/convert-push-object-to-push-path": "on",
@@ -1724,6 +1726,24 @@ module.exports.rules = {
1724
1726
  };
1725
1727
  ```
1726
1728
 
1729
+ ## convert-get-file-content-to-read-file-content
1730
+
1731
+ To read file content use [`readFileContent`](https://github.com/coderaiser/putout/tree/master/packages/operator-filesystem#readfilecontentfilepath-filepath-string) and never confuse.
1732
+
1733
+ Checkout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/828da75f16a526652b138948d810ed9e/754bd02869a7e4e119e9fb442dab93df7785fb56).
1734
+
1735
+ ### ❌ Example of incorrect code
1736
+
1737
+ ```js
1738
+ const content = getFileContent(file);
1739
+ ```
1740
+
1741
+ ### ✅ Example of correct code
1742
+
1743
+ ```js
1744
+ const content = readFileContent(file);
1745
+ ```
1746
+
1727
1747
  ## move-require-on-top-level
1728
1748
 
1729
1749
  ### ❌ Example of incorrect code
@@ -0,0 +1,5 @@
1
+ export const report = () => `To read file content use 'readFileContent' instead of 'getFileContent'`;
2
+
3
+ export const replace = () => ({
4
+ 'getFileContent(__a)': 'readFileContent(__a)',
5
+ });
package/lib/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import * as convertGetFileContentToReadFileContent from './convert-get-file-content-to-read-file-content/index.js';
1
2
  import * as addPushArg from './add-push-arg/index.js';
2
3
  import * as convertReplaceToTraverse from './convert-replace-to-traverse/index.js';
3
4
  import * as applyEngineNodeVersion from './apply-engine-node-version/index.js';
@@ -150,4 +151,5 @@ export const rules = {
150
151
  'apply-engine-node-version': applyEngineNodeVersion,
151
152
  'convert-replace-to-traverse': convertReplaceToTraverse,
152
153
  'add-push-arg': addPushArg,
154
+ 'convert-get-file-content-to-read-file-content': convertGetFileContentToReadFileContent,
153
155
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "28.11.0",
3
+ "version": "28.12.0",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",