putout 42.18.0 → 42.20.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/ChangeLog +23 -0
- package/lib/operator.js +1 -0
- package/lib/parse-options/apply-match-rules.js +29 -0
- package/lib/parse-options/index.js +7 -0
- package/package.json +2 -1
- package/types/operator.ts +2 -1
package/ChangeLog
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
2026.09.28, v42.20.0
|
|
2
|
+
|
|
3
|
+
fix:
|
|
4
|
+
- 68a30b688 putout: parse-options: match more important then rule
|
|
5
|
+
- 9fc0ed334 @putout/plugin-putout: apply-type-check: report
|
|
6
|
+
|
|
7
|
+
feature:
|
|
8
|
+
- a3a8ebab3 @putout/plugin-logical-expressions: apply-destructuring: return
|
|
9
|
+
- e68d745fd @putout/plugin-logical-expressions: apply-destructuring: declared: exclude
|
|
10
|
+
- 9ab71f538 @putout/plugin-logical-expressions: apply-destructuring
|
|
11
|
+
- 78be97a4e @putout/plugin-putout: apply-type-check
|
|
12
|
+
|
|
13
|
+
2026.09.27, v42.19.0
|
|
14
|
+
|
|
15
|
+
fix:
|
|
16
|
+
- c29f76cf4 @putout/processor-css: rm happy-style
|
|
17
|
+
|
|
18
|
+
feature:
|
|
19
|
+
- 55ba52565 @putout/operator-match-files: @putout/processor-css -> @putout/operator-css
|
|
20
|
+
- 9a63abd43 @putout/processor-css: happy-style -> operator-css
|
|
21
|
+
- 9a03bf257 @putout/operator-css: add
|
|
22
|
+
- 134909f42 @putout/operator-match-files: css
|
|
23
|
+
|
|
1
24
|
2026.09.27, v42.18.0
|
|
2
25
|
|
|
3
26
|
fix:
|
package/lib/operator.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from '@putout/operate';
|
|
2
2
|
export * from '@putout/compare';
|
|
3
3
|
export * from '@putout/traverse';
|
|
4
|
+
export * from '@putout/operator-css';
|
|
4
5
|
export * from '@putout/operator-declare';
|
|
5
6
|
export * from '@putout/operator-json';
|
|
6
7
|
export * from '@putout/operator-jsx';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const {entries, keys} = Object;
|
|
2
|
+
|
|
3
|
+
const cut = (a) => a.split('/')[0];
|
|
4
|
+
const isEmpty = (a) => !keys(a).length;
|
|
5
|
+
const isNested = (a) => a.includes('/');
|
|
6
|
+
|
|
7
|
+
const isSuppressed = (matchRules, rule) => {
|
|
8
|
+
if (Object.hasOwn(matchRules, rule))
|
|
9
|
+
return true;
|
|
10
|
+
|
|
11
|
+
return isNested(rule) && matchRules[cut(rule)] === 'off';
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const applyMatchRules = (rules, matchRules = {}) => {
|
|
15
|
+
if (isEmpty(matchRules) || isEmpty(rules))
|
|
16
|
+
return rules;
|
|
17
|
+
|
|
18
|
+
const result = {};
|
|
19
|
+
|
|
20
|
+
for (const [rule, value] of entries(rules)) {
|
|
21
|
+
if (!isSuppressed(matchRules, rule))
|
|
22
|
+
result[rule] = value;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
...result,
|
|
27
|
+
...matchRules,
|
|
28
|
+
};
|
|
29
|
+
};
|
|
@@ -11,6 +11,7 @@ import _defaultOptions from '../../putout.json' with {
|
|
|
11
11
|
type: 'json',
|
|
12
12
|
};
|
|
13
13
|
import {mergeOptions} from './merge-options.js';
|
|
14
|
+
import {applyMatchRules} from './apply-match-rules.js';
|
|
14
15
|
import _recursiveRead from './recursive-read.js';
|
|
15
16
|
import applyModuleTypeRules from './apply-module-type-rules.js';
|
|
16
17
|
import {validateOptions} from './validate-options/index.js';
|
|
@@ -88,6 +89,12 @@ export const parseOptions = (info = {}, overrides = {}) => {
|
|
|
88
89
|
|
|
89
90
|
const finalMergedOptions = mergeOptions(...resultOptionsList);
|
|
90
91
|
|
|
92
|
+
const matched = parseMatch(name, options.match);
|
|
93
|
+
const withMatchRules = applyMatchRules(finalMergedOptions.rules, matched.rules);
|
|
94
|
+
|
|
95
|
+
if (withMatchRules !== finalMergedOptions.rules)
|
|
96
|
+
finalMergedOptions.rules = withMatchRules;
|
|
97
|
+
|
|
91
98
|
validateOptions(finalMergedOptions);
|
|
92
99
|
|
|
93
100
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "putout",
|
|
3
|
-
"version": "42.
|
|
3
|
+
"version": "42.20.0",
|
|
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",
|
|
@@ -76,6 +76,7 @@
|
|
|
76
76
|
"@putout/formatter-time": "^5.0.0",
|
|
77
77
|
"@putout/operate": "^15.0.0",
|
|
78
78
|
"@putout/operator-add-args": "^15.0.0",
|
|
79
|
+
"@putout/operator-css": "^1.0.1",
|
|
79
80
|
"@putout/operator-declare": "^18.0.0",
|
|
80
81
|
"@putout/operator-filesystem": "^11.0.0",
|
|
81
82
|
"@putout/operator-find-file-up": "^3.0.0",
|
package/types/operator.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
export * from '@putout/operator-keyword';
|
|
2
1
|
export * from '@putout/operate';
|
|
3
2
|
export * from '@putout/compare';
|
|
4
3
|
export * from '@putout/traverse';
|
|
4
|
+
export * from '@putout/operator-keyword';
|
|
5
|
+
export * from '@putout/operator-css';
|
|
5
6
|
export * from '@putout/operator-json';
|
|
6
7
|
export * from '@putout/operator-wasm';
|
|
7
8
|
export * from '@putout/operator-jsx';
|