Gathering detailed insights and metrics for @putout/plugin-putout
Gathering detailed insights and metrics for @putout/plugin-putout
Gathering detailed insights and metrics for @putout/plugin-putout
Gathering detailed insights and metrics for @putout/plugin-putout
@putout/plugin-putout-config
🐊Putout plugin helps to maintain putout config
putout
🐊 Pluggable and configurable code transformer with built-in ESLint, Babel and support of js, jsx, typescript, flow, markdown, yaml and json
@putout/plugin-gitignore
🐊Putout plugin helps with .gitignore
@putout/plugin-npmignore
🐊Putout plugin helps with .npmignore
🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter, drop-in ESLint superpower replacement 💪 with built-in support for js, jsx, typescript, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏
npm install @putout/plugin-putout
Typescript
Module System
Min. Node Version
Node Version
NPM Version
64.1
Supply Chain
85.8
Quality
92.1
Maintenance
100
Vulnerability
97.3
License
JavaScript (99%)
TypeScript (0.62%)
WebAssembly (0.19%)
HTML (0.16%)
CSS (0.02%)
Svelte (0.01%)
Total Downloads
2,059,851
Last Day
868
Last Week
12,447
Last Month
51,887
Last Year
697,605
MIT License
753 Stars
16,333 Commits
41 Forks
9 Watchers
46 Branches
24 Contributors
Updated on Jun 30, 2025
Minified
Minified + Gzipped
Latest Version
26.0.0
Package Id
@putout/plugin-putout@26.0.0
Unpacked Size
196.09 kB
Size
35.89 kB
File Count
83
NPM Version
11.1.0
Node Version
24.2.0
Published on
Jun 24, 2025
Cumulative downloads
Total Downloads
Last Day
217.9%
868
Compared to previous day
Last Week
23.3%
12,447
Compared to previous week
Last Month
-9.9%
51,887
Compared to previous month
Last Year
41.1%
697,605
Compared to previous year
4
1
🐊Putout plugin helps with plugins development.
npm i @putout/plugin-putout -D
1{ 2 "rules": { 3 "putout/add-places-to-compare-places": "on", 4 "putout/add-path-arg-to-fix": "on", 5 "putout/add-path-arg-to-visitors": "on", 6 "putout/add-test-args": "on", 7 "putout/add-traverse-args": "on", 8 "putout/add-track-file": "on", 9 "putout/add-await-to-progress": "on", 10 "putout/apply-create-test": "on", 11 "putout/apply-create-nested-directory": "on", 12 "putout/apply-async-formatter": "on", 13 "putout/apply-declare": "on", 14 "putout/apply-exports": "off", 15 "putout/apply-exports-to-add-args": "on", 16 "putout/apply-exports-to-match-files": "on", 17 "putout/apply-exports-to-rename-files": "on", 18 "putout/apply-report": "on", 19 "putout/apply-processors-destructuring": "on", 20 "putout/apply-rename": "on", 21 "putout/apply-parens": "on", 22 "putout/apply-remove": "on", 23 "putout/apply-insert-before": "on", 24 "putout/apply-insert-after": "on", 25 "putout/apply-vars": "on", 26 "putout/apply-short-processors": "on", 27 "putout/apply-lowercase-to-node-builders": "on", 28 "putout/apply-namespace-specifier": "on", 29 "putout/apply-for-of-to-track-file": "on", 30 "putout/apply-fixture-name-to-message": "on", 31 "putout/check-match": "on", 32 "putout/check-declare": "on", 33 "putout/check-replace-code": ["on", { 34 "once": true 35 }], 36 "putout/convert-putout-test-to-create-test": "on", 37 "putout/convert-to-no-transform-code": "on", 38 "putout/convert-number-to-numeric": "on", 39 "putout/convert-replace-with": "on", 40 "putout/convert-replace-with-multiple": "on", 41 "putout/convert-replace-to-function": "on", 42 "putout/convert-match-to-function": "on", 43 "putout/convert-babel-types": "on", 44 "putout/convert-destructuring-to-identifier": "on", 45 "putout/convert-node-to-path-in-get-template-values": "on", 46 "putout/convert-include-to-traverse": "on", 47 "putout/convert-traverse-to-include": "on", 48 "putout/convert-traverse-to-replace": "on", 49 "putout/convert-traverse-to-scan": "on", 50 "putout/convert-process-to-find": "on", 51 "putout/convert-method-to-property": "on", 52 "putout/convert-add-argument-to-add-args": "on", 53 "putout/convert-dirname-to-url": "on", 54 "putout/convert-url-to-dirname": "on", 55 "putout/convert-report-to-function": "on", 56 "putout/convert-get-rule-to-require": "on", 57 "putout/convert-progress-to-track-file": "on", 58 "putout/create-test": "on", 59 "putout/shorten-imports": "on", 60 "putout/declare": "on", 61 "putout/declare-template-variables": "on", 62 "putout/declare-path-variable": "on", 63 "putout/includer": "on", 64 "putout/move-require-on-top-level": "on", 65 "putout/replace-test-message": "on", 66 "putout/remove-unused-get-properties-argument": "on", 67 "putout/remove-empty-array-from-process": "on", 68 "putout/remove-empty-object-from-transform": "on", 69 "putout/remove-useless-printer-option": "on", 70 "putout/simplify-replace-template": "on" 71 } 72}
Checkout in 🐊Putout Editor.
1path.node = identifier('x');
1path.node = identifier('x');
Checkout in 🐊Putout Editor.
1t.noReport('rename-files-full', { 2 from: ['/'], 3 to: [], 4}); 5 6t.noReportWithOptions('rename-files-full'); 7 8t.noReport('a', 'Use b'); 9t.report('a');
1t.noReportWithOptions('rename-files-full', { 2 from: ['/'], 3 to: [], 4}); 5 6t.noReport('rename-files-full'); 7 8t.report('a', 'Use b'); 9t.noReport('a');
1test('', async (t) => { 2 await t.process({}); 3});
1test('', async ({process}) => { 2 await process({}); 3});
1test('', async (t) => { 2 await t.process({}); 3});
1test('', async ({process}) => { 2 await process({}); 3});
Apply short names of processors, for example __json
instead of __putout_processor_json
. Checkout out in 🐊Putout Editor.
1export const match = () => ({ 2 '__putout_processor_ignore(__a)': ({__a}) => { 3 const list = __a.elements.map(getValue); 4 }, 5 '__putout_processor_filesystem(__a)': ({__a}) => { 6 const list = __a.elements.map(getValue); 7 }, 8});
1export const match = () => ({ 2 [__ignore]: ({__array}) => { 3 const list = __array.elements.map(getValue); 4 }, 5 [__filesystem]: ({__object}) => { 6 const list = __object.elements.map(getValue); 7 }, 8});
Better use rename(path, from, to)
method of operator
.
Check out in 🐊Putout Editor.
1export const fix = ({path, from, to}) => { 2 path.scope.rename(from, to); 3};
1import {operator} from 'putout'; 2 3const {rename} = operator; 4 5export const fix = ({path, from, to}) => { 6 rename(path, from, to); 7};
Better use addParens(path)
method of operator
instead of using path.node.extra
to have support of both printers:
@putout/printer
;babel
;Check out in 🐊Putout Editor.
1path.node.extra.parenthesized = false; 2path.node.extra.parenthesized = true; 3 4if (!path.node.extra?.parenthesized) 5 return;
1removeParens(path); 2addParens(path); 3 4if (!hasParens(path)) 5 return;
Better to use remove(path)
method of operator
.
It helps to preserve comments.
1export const fix = (path) => { 2 path.remove(); 3};
1import {operator} from 'putout'; 2 3const {remove} = operator; 4 5export const fix = (path) => { 6 remove(path); 7};
Better to use insertBefore(a, b)
method of operator
.
1export const fix = (path) => { 2 path.insertBefore(path.get('init')); 3};
1import {operator} from 'putout'; 2 3const {insertBefore} = operator; 4 5export const fix = (path) => { 6 insertBefore(path, path.get('init')); 7};
Better to use insertAfter(a, b)
method of operator
.
It helps to avoid duplication of comments.
1export const fix = (path) => { 2 path.insertAfter(path.get('init')); 3};
1import {operator} from 'putout'; 2 3const {insertAfter} = operator; 4 5export const fix = (path) => { 6 insertAfter(path, path.get('init')); 7};
Checkout in 🐊Putout Editor.
1export const replace = () => ({ 2 '__a(__args': ({}, path) => { 3 return true; 4 }, 5}); 6 7export const match = () => ({ 8 '__a(__args': ({}, path) => { 9 return ''; 10 }, 11});
1export const replace = () => ({ 2 '__a(__args': (vars, path) => { 3 return true; 4 }, 5}); 6 7export const match = () => ({ 8 '__a(__args': (vars, path) => { 9 return ''; 10 }, 11});
Better to use Declareator
instead of operator.declare()
.
Check out in 🐊Putout Editor.
1const {operator} = require('putout'); 2const {declare} = operator; 3 4module.exports = declare({ 5 tryCatch: `import tryCatch from 'try-catch'`, 6 tryToCatch: `import tryToCatch from 'try-to-catch'`, 7});
1module.exports.declare = () => ({ 2 tryCatch: `import tryCatch from 'try-catch'`, 3 tryToCatch: `import tryToCatch from 'try-to-catch'`, 4});
Check out in 🐊Putout Editor. Possible configuration:
1{ 2 "rules": { 3 "putout/apply-exports": ["on", { 4 "addArgs": [ 5 "report", 6 "fix", 7 "scan" 8 ] 9 }] 10 } 11}
1export default createRenameProperty([ 2 ...v32, 3 ...v29, 4]);
1export const { 2 report, 3 fix, 4 scan, 5} = createRenameProperty([ 6 ...v32, 7 ...v29, 8]);
Check out in 🐊Putout Editor.
1export default addArgs(__args);
1export const { 2 report, 3 fix, 4 traverse, 5} = addArgs(__args);
Check out in 🐊Putout Editor.
1export default matchFiles({ 2 '*.cjs': plugin, 3});
1export const { 2 report, 3 fix, 4 scan, 5} = matchFiles({ 6 '*.cjs': plugin, 7});
Check out in 🐊Putout Editor.
1export default renameFiles({ 2 type: 'module', 3 mask: '*.mjs', 4 rename(name) { 5 return name.replace(/mjs$/, 'js'); 6 }, 7});
1export const { 2 report, 3 fix, 4 scan, 5} = renameFiles({ 6 type: 'module', 7 mask: '*.mjs', 8 rename(name) { 9 return name.replace(/mjs$/, 'js'); 10 }, 11});
1test('formatter: codeframea', (t) => { 2 t.format(codeframe, 1); 3 t.end(); 4});
1test('formatter: codeframea', async ({format}) => { 2 await format(codeframe, 1); 3});
1const test = require('@putout/test')({ 2 'remove-debugger': plugin, 3});
1const {createTest} = require('@putout/test'); 2 3const test = createTest({ 4 'remove-debugger': plugin, 5});
Checkout in Putout Editor.
1const dirPath = createDirectory(path, '/hello/world'); 2const dirPath2 = createNestedDirectory(path, 'world');
1const dirPath = createNestedDirectory(path, '/hello/world'); 2const dirPath2 = createDirectory(path, 'world');
Most likely what you need is esm/resolve-imported-file
.
1import rmUnused from '@putout/plugin-remove-unused-variables';
1import * as rmUnused from '@putout/plugin-remove-unused-variables';
The Generator object is returned by a
generator function
and it conforms to both the iterable protocol and theiterator
protocol.(c) MDN
trackFile
is generator function used to count progress that can be used in Scanner.
Checkout in 🐊Putout Editor
1module.exports.scan = (path, {push, trackFile}) => {
2 trackFile(path, '*.swp').map(push);
3};
1module.exports.scan = (path, {push, trackFile}) => { 2 for (const file of trackFile(path, '*.swp')) { 3 push(file); 4 } 5};
Add properties to createTest
options, here is example of .putout.json
:
1{ 2 "rules": { 3 "putout/create-test": ["on", { 4 "add": [ 5 ["printer", "putout"] 6 ] 7 }] 8 } 9}
Check it out in 🐊Putout Editor.
1createTest(__dirname, {
2 'putout/create-test': plugin,
3});
1createTest(__dirname, { 2 printer: 'putout', 3 plugins: [ 4 ['putout/create-test', plugin], 5 ], 6});
Prevent Babel
warning: The node type NumberLiteral has been renamed to NumericLiteral
.
1const {isNumberLiteral} = types; 2isNumberLiteral(node);
1const {isNumericLiteral} = types; 2isNumericLiteral(node);
Fixes results of @putout/convert-commonjs-to-esm work.
1import putoutTest from '@putout/test';
2
3const test = putoutTest(__dirname, {
4 'remove-unused-variables': rmVars,
5});
1import {createTest} from '@putout/test';
2
3const test = createTest(__dirname, {
4 'remove-unused-variables': rmVars,
5});
1test('plugin-apply-destructuring: transform: array: destructuring', (t) => { 2 const code = 'const {name} = array[0]'; 3 4 t.transform(code, ''); 5 t.end(); 6});
1test('plugin-apply-destructuring: transform: array: destructuring', (t) => { 2 const code = 'const {name} = array[0]'; 3 4 t.noTransformCode(code); 5 t.end(); 6});
1module.exports.fix = (path) => { 2 path.replaceWith(identifier('hello')); 3};
1const {replaceWith} = require('putout').operator; 2 3module.exports.fix = (path) => { 4 replaceWith(path, identifier('hello')); 5};
1module.exports.fix = (path) => { 2 path.replaceWithMultiple([ 3 identifier('hello'), 4 ]); 5};
1const {replaceWithMultiple} = require('putout').operator; 2 3module.exports.fix = (path) => { 4 replaceWithMultiple(path, [ 5 identifier('hello'), 6 ]); 7};
1module.exports.replace = { 2 'let __a = __b': 'const __b = __a', 3};
1module.exports.replace = () => ({ 2 'let __a = __b': 'const __b = __a', 3});
1module.exports.match = { 2 'let __a = __b': () => false, 3};
1module.exports.match = () => ({ 2 'let __a = __b': () => false, 3});
1const { 2 ObjectExpression, 3 SpreadElement, 4 isObjectExpression, 5 isIdentifier, 6} = require('@babel/types');
1const { 2 ObjectExpression, 3 SpreadElement, 4 isObjectExpression, 5 isIdentifier, 6} = require('putout').types;
1module.exports.replace = () => ({ 2 'const __a = __b': ({}) => {}, 3 'const __c = __d': ({}, path) => {}, 4});
1module.exports.replace = () => ({ 2 'const __a = __b': (vars) => {}, 3 'const __c = __d': (vars, path) => {}, 4});
1const {__a, __b} = getTemplateValues(path.node, 'const __a = __b');
1const {__a, __b} = getTemplateValues(path, 'const __a = __b');
1const parseOptions = require('putout/lib/parse-options');
1const parseOptions = require('putout/parse-options');
Checkout in 🐊*Putout Editor.
1export const include = () => ({ 2 ClassDeclaration(path) {}, 3});
1export const traverse = () => ({ 2 ClassDeclaration(path) {}, 3});
1module.exports.traverse = ({push}) => ({ 2 TSTypeAssertion(path) { 3 push(path); 4 }, 5});
1module.exports.include = () => [ 2 'TSTypeAssertion', 3];
1module.exports.traverse = () => ({ 2 'async (__a) => __b': 'async ({process}) => __b', 3});
1module.exports.replace = () => ({ 2 'async (__a) => __b': 'async ({process}) => __b', 3});
Checkout in 🐊Putout Editor:
1module.exports.traverse = ({push, options}) => ({ 2 [__filesystem](path) { 3 const {names} = options; 4 5 for (const name of names) { 6 const files = findFile(path, name); 7 8 for (const file of files) { 9 push({ 10 name, 11 path: file, 12 }); 13 } 14 } 15 }, 16});
1module.exports.scan = (path, {push, options}) => { 2 const {names} = options; 3 4 for (const name of names) { 5 const files = findFile(path, name); 6 7 for (const file of files) { 8 push(file, { 9 name, 10 }); 11 } 12 } 13};
1module.exports.preProcess = () => {}; 2module.exports.postProcess = () => {};
1module.exports.branch = (rawSource) => []; 2module.exports.merge = (processedSource, list) => '';
convert-destructuring-to-identifier
which is Replacer
, while convert-method-to-property
is Includer
(searches for ObjectMethod
node);1module.exports.match = () => ({ 2 'module.exports.traverse = __a'({}, path) {}, 3});
1module.exports.match = () => ({ 2 'module.exports.traverse = __a': ({}, path) => {}, 3});
Checks that Declarator transform is possible. Checkout in 🐊Putout Editor:
1module.exports.declare = () => ({ 2 isNumber: 'const isNumber = () => {}', 3 isString: 'const isNumber = () => {}', 4});
☝️ There is no fix
for this rule, it used internally to be more confident about test coverage
, because of declaration form, transforms cannon be checked by nyc
and c8
, and uncovered lines can find unfixable false positives when running on code.
This is additional tests, if you forget to test some case (from a big list of rules that is supported) it will be checked with this rule
and make transforms more stable.
Checks that Replacer transform is possible.
Pass once=false
to always fail no matter how many fixCounts
passed.
1module.exports.replace = () => ({ 2 'if (__a = __b) __body': 'if (__a === "__b") __body', 3});
☝️ There is no fix
for this rule, it used internally to be more confident about test coverage
, because of declaration form, transforms cannon be checked by nyc
and c8
, and uncovered lines can find unfixable false positives when running on code.
This is additional tests, if you forget to test some case (from a big list of rules that is supported) it will be checked with this rule
and make transforms more stable.
Checks that Replacer match()
keys exists in replace
.
Checkout in 🐊Putout Editor.
1module.exports.match = () => ({ 2 '__a = __b': (vars, path) => {}, 3}); 4 5module.exports.replace = () => ({ 6 '__a = __': '__a', 7});
☝️ There is no fix
for this rule, it used internally to be more confident about test coverage
, because of declaration form, transforms cannon be checked by nyc
and c8
, and uncovered lines can find unfixable false positives when running on code.
This is additional tests, if you forget to test some case (from a big list of rules that is supported) it will be checked with this rule
and make transforms more stable.
Depends on @putout/convert-esm-to-commonjs and @putout/declare.
1compare(a, 'const __a = __b'); 2isIdentifier(a);
1const {operator, types} = require('putout'); 2 3const {compare} = operator; 4const {isIdentifier} = types; 5 6compare(a, 'const __a = __b'); 7isIdentifier(a);
Checkout in 🐊Putout Editor.
1export const match = () => ({ 2 '__a(__args': (vars, path) => { 3 fn(x); 4 5 return __args[__a]; 6 }, 7});
1export const match = () => ({ 2 '__a(__args': ({__args, __a}, path) => { 3 fn(x); 4 5 return __args[__a]; 6 }, 7});
Checkout in 🐊Putout Editor.
1export const match = () => ({ 2 '__x __a __expr': ({__x}) => { 3 if (path.isNextPunctuator(assign)) 4 return false; 5 6 return isOneOfKeywords(__x, ['const', 'let', 'var']); 7 }, 8});
1export const match = () => ({ 2 '__x __a __expr': ({__x}) => { 3 if (path.isNextPunctuator(assign)) 4 return false; 5 6 return isOneOfKeywords(__x, ['const', 'let', 'var']); 7 }, 8});
comparePlaces
takes two or more arguments.
Checkout in 🐊Putout Editor.
1comparePlaces('hello');
1comparePlaces('hello', []);
Checkout in 🐊Putout Editor.
1export const fix = () => { 2 path.remove(); 3};
1export const fix = (path) => { 2 path.remove(); 3};
Checkout in 🐊Putout Editor.
1export const traverse = () => ({ 2 TSUnionType() { 3 console.log(path); 4 }, 5});
1export const traverse = () => ({ 2 TSUnionType(path) { 3 console.log(path); 4 }, 5});
1test('', () => { 2 comparePlaces(); 3});
1test('', ({comparePlaces}) => { 2 comparePlaces(); 3});
Checkout in 🐊Putout Editor. Supported args:
push
:1module.exports.traverse = () => ({ 2 '__a.replace(/__b/g, __c)': (path) => { 3 push(path); 4 }, 5});
1module.exports.traverse = ({push}) => ({ 2 '__a.replace(/__b/g, __c)': (path) => { 3 push(path); 4 }, 5});
1module.exports.traverse = () => ({ 2 ImportDeclaration(path) { 3 const {node} = path; 4 const {name} = node.specifiers[0].local; 5 6 store('name', name); 7 }, 8});
1module.exports.traverse = ({store}) => ({ 2 ImportDeclaration(path) { 3 const {node} = path; 4 const {name} = node.specifiers[0].local; 5 6 store('name', name); 7 }, 8});
1export const traverse = () => ({ 2 ImportDeclaration(path) { 3 listStore(path); 4 }, 5});
1module.exports.traverse = ({listStore}) => ({ 2 ImportDeclaration(path) { 3 listStore(path); 4 }, 5});
1export const traverse = () => ({ 2 'module.exports.match = __object': pathStore, 3});
1export const traverse = ({pathStore}) => ({ 2 'module.exports.match = __object': pathStore, 3});
Checkout in 🐊Putout Editor.
1test('', ({progress}) => { 2 progress(); 3});
1test('', async ({progress}) => { 2 await progress(); 3});
Checkout in 🐊Putout Editor.
1export const scan = (root, {push, progress}) => { 2 trackFile(); 3};
1export const scan = (root, {push, progress, trackFile}) => { 2 trackFile(); 3};
1const {operator} = require('putout'); 2const {addArgument} = operator; 3 4module.exports = addArgument({ 5 t: ['t', 'test("__a", (__args) => __body)'], 6});
1const {operator} = require('putout'); 2const {addArgs} = operator; 3 4module.exports = addArgs({ 5 t: ['t', 'test("__a", (__args) => __body)'], 6});
1import {createTest} from '@putout/test'; 2import plugin from '@putout/plugin-debugger'; 3import {createSimport} from 'simport'; 4 5const {__dirname} = createSimport(import.meta.url); 6 7const test = createTest(__dirname, { 8 'remove-debugger': plugin, 9});
1import {createTest} from '@putout/test'; 2import plugin from '@putout/plugin-debugger'; 3 4const test = createTest(import.meta.url, { 5 'remove-debugger': plugin, 6});
1const {createTest} = require('@putout/test'); 2const plugin = require('@putout/plugin-debugger'); 3 4const test = createTest(__dirname, { 5 'remove-debugger': plugin, 6});
1const {createTest} = require('@putout/test'); 2const plugin = require('@putout/plugin-debugger'); 3 4const test = createTest(import.meta.url, { 5 'remove-debugger': plugin, 6});
1module.exports.report = `'report' should be a 'function'`;
1module.exports.report = () => `'report' should be a 'function'`;
Checkout in 🐊Putout Editor.
1module.exports.scan = (root, {push, progress}) => { 2 const files = findFile(root, ['*']); 3 const n = files.length; 4 5 for (const [i, file] of files.entries()) { 6 push(file); 7 progress({ 8 i, 9 n, 10 }); 11 } 12};
1module.exports.scan = (root, {push, trackFile}) => { 2 for (const file of trackFile(root, ['*'])) { 3 push(file); 4 } 5};
dynamicRequireTargets
;Checkout in 🐊Putout Editor.
1module.exports.rules = {
2 ...getRule('remove-unused-variables'),
3};
1const removeUnusedVariables = require('./remove-unused-variables'); 2 3module.exports.rules = { 4 'remove-unused-variables': removeUnusedVariables, 5};
1const test = require('@putout/test')(__dirname, { 2 'remove-debugger': require('..'), 3}); 4 5test('remove debugger: report', (t) => { 6 t.transform('debugger', { 7 'remove-debugger': require('..'), 8 }); 9 t.end(); 10});
1const removeDebugger = require('..'); 2 3const test = require('@putout/test')(__dirname, { 4 'remove-debugger': removeDebugger, 5}); 6 7test('remove debugger: report', (t) => { 8 t.transform('debugger', { 9 'remove-debugger': removeDebugger, 10 }); 11 t.end(); 12});
1module.exports.include = () => 'cons __a = __b'; 2module.exports.exclude = () => 'var __a = __b'; 3module.exports.include = 'cons __a = __b'; 4module.exports.exclude = 'var __a = __b'; 5 6module.exports.include = [ 7 'cons __a = __b', 8]; 9 10module.exports.exclude = [ 11 'var __a = __b', 12]; 13 14export const include = [ 15 'cons __a = __b', 16]; 17 18export const exclude = [ 19 'var __a = __b', 20];
1module.exports.include = () => [ 2 'const __a = __b', 3]; 4 5module.exports.exclude = () => [ 6 'var __a = __b', 7]; 8 9export const include = () => [ 10 'cons __a = __b', 11]; 12 13export const exclude = () => [ 14 'var __a = __b', 15];
Checks that test message
and used operator
are synchronized.
Check it out in 🐊Putout Editor.
1test('plugin-putout: rename-operate-to-operator: transform: operator exist', (t) => { 2 t.noTransform('operator'); 3 t.end(); 4}); 5 6test('plugin-putout: rename-operate-to-operator: report: operator exist', (t) => { 7 t.noReport('operator'); 8 t.end(); 9});
1test('plugin-putout: rename-operate-to-operator: no transform: operator exist', (t) => { 2 t.noTransform('operator'); 3 t.end(); 4}); 5 6test('plugin-putout: rename-operate-to-operator: no report: operator exist', (t) => { 7 t.noReport('operator'); 8 t.end(); 9});
Check it out in 🐊Putout Editor.
1await process('input', []);
1await process('input');
Check it out in 🐊Putout Editor.
1test('hello', (t) => { 2 t.transform('nested-labels', {}); 3});
1test('hello', (t) => { 2 t.transform('nested-labels'); 3});
Check it out in 🐊Putout Editor.
1const { 2 overridesPath, 3 parserPath, 4 rulesPath, 5} = getProperties(__jsonPath, [ 6 'parser', 7 'rules', 8 'overrides', 9 'extends', 10]);
1const { 2 overridesPath, 3 parserPath, 4 rulesPath, 5} = getProperties(__jsonPath, ['parser', 'rules', 'extends']);
Check it out in 🐊Putout Editor.
putout
printer used by default, so there is no need to pass it.
1const test = createTest(__dirname, {
2 printer: 'putout',
3 plugins: [
4 ['remove-unchanged-zero-declarations', plugin],
5 ],
6});
1const test = createTest(__dirname, { 2 plugins: [ 3 ['remove-unchanged-zero-declarations', plugin], 4 ], 5});
Checkout in 🐊Putout Editor.
1module.exports.replace = () => ({ 2 'if (__a) {__b} else {__c}': () => 'if (__a) __b; else __c', 3});
1module.exports.replace = () => ({ 2 'if (__a) {__b} else {__c}': 'if (__a) __b; else __c', 3});
Checkout in 🐊Putout Editor.
1test('flatlint: convert-comma-to-semicolon: no report: xxx', (t) => { 2 t.noReport('array'); 3 t.end(); 4});
1test('flatlint: convert-comma-to-semicolon: no report: array', (t) => { 2 t.noReport('array'); 3 t.end(); 4});
MIT
No vulnerabilities found.
Reason
30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
license file detected
Details
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
no binaries found in the repo
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
project is not fuzzed
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More