@putout/plugin-putout 17.1.0 → 17.3.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.
@@ -1,12 +1,7 @@
1
1
  'use strict';
2
2
 
3
- const getRule = (name, options) => {
4
- const plugin = require(`./${name}`);
5
- const pluginWithOptions = !options ? plugin : [options, plugin];
6
-
7
- return {
8
- [name]: pluginWithOptions,
9
- };
10
- };
3
+ const getRule = (name, options = 'on') => ({
4
+ [name]: [options, require(`./${name}`)],
5
+ });
11
6
 
12
7
  module.exports.getRule = getRule;
@@ -5,6 +5,7 @@ module.exports = {
5
5
  renameFile: 'const {renameFile} = operator',
6
6
  removeFile: 'const {removeFile} = operator',
7
7
  moveFile: 'const {moveFile} = operator',
8
+ createFile: 'const {createFile} = operator',
8
9
  createDirectory: 'const {createDirectory} = operator',
9
10
  getParentDirectory: 'const {getParentDirectory} = operator',
10
11
  readFileContent: 'const {readFileContent} = operator',
@@ -58,7 +58,10 @@ module.exports.replace = () => ({
58
58
  const buildRequire = template(`const NAME = REQUIRE`);
59
59
 
60
60
  function declareRequire({__a, __b}, path) {
61
- const shortName = __a.value || __a.name.split('/').pop();
61
+ const shortName = __a.value || __a
62
+ .name
63
+ .split('/')
64
+ .pop();
62
65
 
63
66
  const name = justCamelCase(shortName);
64
67
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-putout",
3
- "version": "17.1.0",
3
+ "version": "17.3.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin helps with plugins development",