putout 42.7.4 → 42.7.5

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/ChangeLog CHANGED
@@ -1,3 +1,8 @@
1
+ 2026.06.21, v42.7.5
2
+
3
+ feature:
4
+ - 9f0295ca1 @putout/operator-ignore: TS
5
+
1
6
  2026.06.21, v42.7.4
2
7
 
3
8
  feature:
package/README.md CHANGED
@@ -306,6 +306,7 @@ const source = `
306
306
  putout(source, {
307
307
  plugins: ['remove-unused-variables'],
308
308
  });
309
+
309
310
  // returns
310
311
  `
311
312
  const t = 'hello';
@@ -327,6 +328,7 @@ const source = `
327
328
  await putoutAsync(source, {
328
329
  plugins: ['remove-unused-variables'],
329
330
  });
331
+
330
332
  // returns
331
333
  `
332
334
  const t = 'hello';
package/lib/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import {
5
5
  } from '@putout/babel';
6
6
  import {PutoutPlugin} from '../types/plugins.ts';
7
7
 
8
+ export type * from '../types/plugins.ts';
8
9
  export * as operator from '../types/operator.ts';
9
10
 
10
11
  export declare function parse(source: string): Program;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "42.7.4",
3
+ "version": "42.7.5",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊 Pluggable and configurable code transformer with built-in ESLint, Babel and support of js, jsx, typescript, flow, markdown, yaml and json",
package/types/operator.ts CHANGED
@@ -3,4 +3,5 @@ export * from '@putout/compare';
3
3
  export * from '@putout/traverse';
4
4
  export * from '@putout/operator-json';
5
5
  export * from '@putout/operator-jsx';
6
+ export * from '@putout/operator-ignore';
6
7
 
package/types/plugins.ts CHANGED
@@ -7,15 +7,27 @@ export type Traverse = (helpers: {
7
7
  pathStore: (path?: NodePath) => NodePath[];
8
8
  }) => Record<string, (path: NodePath) => void>;
9
9
 
10
- export interface PutoutPlugin {
10
+ export type Traverser = {
11
11
  report: Report;
12
- replace?: Replace;
13
- fix?: Fix;
14
- include?: Include;
12
+ traverse: Traverse;
13
+ fix: Fix;
14
+ };
15
+
16
+ export type Replacer = {
17
+ report: Report;
18
+ replace: Replace;
19
+ match?: Match;
20
+ };
21
+
22
+ export type Includer = {
23
+ report: Report;
24
+ fix: Fix;
25
+ include: Include;
15
26
  exclude?: Exclude;
16
27
  filter?: Filter;
17
- traverse?: Traverse;
18
- }
28
+ };
29
+
30
+ export type PutoutPlugin = Replacer | Includer | Traverser;
19
31
 
20
32
  export type Report = () => string;
21
33
 
@@ -23,9 +35,9 @@ export type Include = () => string[];
23
35
 
24
36
  export type Exclude = () => string[] | (() => boolean);
25
37
 
26
- export interface PluginOptions {
38
+ export type PluginOptions = {
27
39
  options?: Record<string, unknown>;
28
- }
40
+ };
29
41
 
30
42
  export type Filter = (path: NodePath, options: PluginOptions) => boolean;
31
43
 
@@ -34,3 +46,7 @@ export type Fix = (path: NodePath, options: PluginOptions) => void;
34
46
  type ReplaceResolver = (vars: Record<string, Node>, path: NodePath) => string | NodePath | '';
35
47
 
36
48
  export type Replace = () => Record<string, string | ReplaceResolver>;
49
+
50
+ type MatchResolver = (vars: Record<string, Node>, path: NodePath) => boolean;
51
+
52
+ export type Match = () => Record<string, MatchResolver>;