flatlint 3.2.1 → 3.4.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 CHANGED
@@ -1,3 +1,15 @@
1
+ 2025.11.27, v3.4.0
2
+
3
+ feature:
4
+ - c3ac0fc flatlint: convert-assert-to-with: add
5
+ - e3c9370 flatlint: @putout/operator-keyword v3.0.0
6
+
7
+ 2025.09.16, v3.3.0
8
+
9
+ feature:
10
+ - 648b983 convert-semiclon-to-comma: improve
11
+ - 1dc5b62 flatlint: @putout/test v14.0.0
12
+
1
13
  2025.08.05, v3.2.1
2
14
 
3
15
  feature:
package/README.md CHANGED
@@ -37,6 +37,15 @@ npm i flatlint
37
37
 
38
38
  </details>
39
39
 
40
+ <details><summary>convert <code>assert</code> to <code>with</code></summary>
41
+
42
+ ```diff
43
+ -import a from 'a' assert {type: 'json'}
44
+ +import a from 'a' with {type: 'json'}
45
+ ```
46
+
47
+ </details>
48
+
40
49
  <details><summary>convert comma to semicolon</summary>
41
50
 
42
51
  ```diff
@@ -0,0 +1,6 @@
1
+ export const report = () => `Use 'with' instead of 'assert'`;
2
+ export const replace = () => ({
3
+ 'import __a from "__b" assert {type: "__c"}': 'import __a from "__b" with {type: "__c"}',
4
+ 'import {__a} from "__b" assert {type: "__c"}': 'import {__a} from "__b" with {type: "__c"}',
5
+ 'import {__a, __d} from "__b" assert {type: "__c"}': 'import {__a, __d} from "__b" with {type: "__c"}',
6
+ });
@@ -8,6 +8,7 @@ import {
8
8
  semicolon,
9
9
  assign,
10
10
  bitwiseAnd,
11
+ closeCurlyBrace,
11
12
  } from '#types';
12
13
 
13
14
  const keywords = [
@@ -86,6 +87,9 @@ export const match = () => ({
86
87
  '__a];': (vars, path) => {
87
88
  return path.isNextPunctuator(closeSquareBrace);
88
89
  },
90
+ '=> __a.__b(__c, __d);'(vars, path) {
91
+ return path.isNextPunctuator(closeCurlyBrace);
92
+ },
89
93
  });
90
94
 
91
95
  export const replace = () => ({
@@ -93,4 +97,5 @@ export const replace = () => ({
93
97
  '__a;': '__a,',
94
98
  ');': '),',
95
99
  '__a];': '__a],',
100
+ '=> __a.__b(__c, __d);': '=> __a.__b(__c, __d),',
96
101
  });
package/lib/plugins.js CHANGED
@@ -8,6 +8,7 @@ import * as addMissingSemicolon from './plugins/add-missing-semicolon/index.js';
8
8
  import * as addMissingComma from './plugins/add-missing-comma/index.js';
9
9
  import * as addConstToExport from './plugins/add-const-to-export/index.js';
10
10
  import * as applyImportOrder from './plugins/apply-import-order/index.js';
11
+ import * as convertAssertToWith from './plugins/convert-assert-to-with/index.js';
11
12
  import * as convertCommaToSemicolon from './plugins/convert-comma-to-semicolon/index.js';
12
13
  import * as convertFromToRequire from './plugins/convert-from-to-require/index.js';
13
14
  import * as removeUselessComma from './plugins/remove-useless-comma/index.js';
@@ -30,6 +31,7 @@ export const plugins = [
30
31
  ['add-missing-quote', addMissingQuote],
31
32
  ['add-const-to-export', addConstToExport],
32
33
  ['apply-import-order', applyImportOrder],
34
+ ['convert-assert-to-with', convertAssertToWith],
33
35
  ['convert-comma-to-semicolon', convertCommaToSemicolon],
34
36
  ['convert-colon-to-comma', convertColonToComma],
35
37
  ['convert-colon-to-semicolon', convertColonToSemicolon],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "3.2.1",
3
+ "version": "3.4.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",
@@ -78,13 +78,12 @@
78
78
  "license": "MIT",
79
79
  "dependencies": {
80
80
  "@putout/engine-loader": "^16.0.0",
81
- "@putout/operator-keyword": "^2.0.0",
81
+ "@putout/operator-keyword": "^3.0.0",
82
82
  "debug": "^4.4.0",
83
83
  "js-tokens": "^9.0.1"
84
84
  },
85
85
  "devDependencies": {
86
- "@putout/formatter-json": "^2.0.0",
87
- "@putout/test": "^13.0.0",
86
+ "@putout/test": "^14.0.0",
88
87
  "c8": "^10.1.2",
89
88
  "eslint": "^9.7.0",
90
89
  "eslint-plugin-putout": "^28.0.4",