putout 26.1.2 → 26.2.1

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,29 @@
1
+ 2022.05.16, v26.2.1
2
+
3
+ feature:
4
+ - (putout) parse-optios: apply-module-type-rules: simplify
5
+ - (package) @putout/processor-css v5.0.0
6
+ - (@putout/processor-html) convert to ESM
7
+
8
+
9
+ 2022.05.15, v26.2.0
10
+
11
+ feature:
12
+ - (@putout/processor-typescript) convert to ESM
13
+ - (package) @putout/plugin-eslint v3.0.0
14
+ - (@putout/eslint-plugin-putout) drop support of 🐊 < 26
15
+ - (@putout/plugin-eslint) add convert-require-to-import
16
+
17
+
18
+ 2022.05.14, v26.1.3
19
+
20
+ feature:
21
+ - (package) @putout/processor-css v5.0.0
22
+ - (@putout/processor-css) convert to ESM
23
+ - (@putout/processor-css) move out config-loader
24
+ - (@putout/processor-markdown) move out rules
25
+
26
+
1
27
  2022.05.14, v26.1.2
2
28
 
3
29
  fix:
@@ -1,21 +1,37 @@
1
1
  'use strict';
2
2
 
3
3
  const {assign} = Object;
4
-
5
- const getRuleByType = (a) => a === 'module' ? 'convert-commonjs-to-esm' : 'convert-esm-to-commonjs';
4
+ const merge = require('../merge');
6
5
 
7
6
  module.exports = ({type}, options) => {
8
- const rule = getRuleByType(type);
9
- const js = '*.js';
10
-
11
- assign(options, {
7
+ const rules = type === 'module' ? esm() : commonjs();
8
+ assign(options, merge(options, rules));
9
+ };
10
+
11
+ function commonjs() {
12
+ return {
12
13
  match: {
13
- ...options.match,
14
- [js]: {
15
- ...options.match?.[js],
16
- [rule]: 'on',
14
+ '*.js': {
15
+ 'convert-esm-to-commonjs': 'on',
16
+ },
17
+ '.eslintrc.json': {
18
+ 'eslint': 'on',
19
+ 'eslint/convert-require-to-import': 'off',
17
20
  },
18
21
  },
19
- });
20
- };
22
+ };
23
+ }
21
24
 
25
+ function esm() {
26
+ return {
27
+ match: {
28
+ '*.js': {
29
+ 'convert-commonjs-to-esm': 'on',
30
+ },
31
+ '.eslintrc.json': {
32
+ 'eslint': 'on',
33
+ 'eslint/convert-require-to-import': 'on',
34
+ },
35
+ },
36
+ };
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "putout",
3
- "version": "26.1.2",
3
+ "version": "26.2.1",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊 Pluggable and configurable code transformer with built-in eslint and babel plugins support of js, jsx typescript, flow files, markdown, yaml and json",
@@ -104,7 +104,7 @@
104
104
  "@putout/plugin-convert-typeof-to-is-type": "^2.0.0",
105
105
  "@putout/plugin-declare-before-reference": "^1.0.0",
106
106
  "@putout/plugin-declare-undefined-variables": "^7.0.0",
107
- "@putout/plugin-eslint": "^2.0.0",
107
+ "@putout/plugin-eslint": "^3.0.0",
108
108
  "@putout/plugin-extract-object-properties": "^8.0.0",
109
109
  "@putout/plugin-extract-sequence-expressions": "^3.0.0",
110
110
  "@putout/plugin-github": "^3.0.0",
@@ -169,7 +169,7 @@
169
169
  "@putout/plugin-try-catch": "^1.0.0",
170
170
  "@putout/plugin-typescript": "^2.0.0",
171
171
  "@putout/plugin-webpack": "^1.0.0",
172
- "@putout/processor-css": "^4.0.0",
172
+ "@putout/processor-css": "^5.0.0",
173
173
  "@putout/processor-ignore": "^3.0.0",
174
174
  "@putout/processor-javascript": "^4.0.0",
175
175
  "@putout/processor-json": "^5.0.0",
package/putout.json CHANGED
@@ -63,7 +63,8 @@
63
63
  ".browserlistrc": "on"
64
64
  },
65
65
  ".eslintrc.json": {
66
- "eslint": "on"
66
+ "eslint": "on",
67
+ "eslint/convert-require-to-import": "off"
67
68
  },
68
69
  "package.json": {
69
70
  "package-json": "on"