flatlint 5.2.2 → 5.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,13 @@
1
+ 2026.04.04, v5.4.0
2
+
3
+ feature:
4
+ - 3043e38 flatlint: remove-useless-assign: function
5
+
6
+ 2026.03.29, v5.3.0
7
+
8
+ feature:
9
+ - 325946f flatlint: remove-useless-import-curly-braces: add
10
+
1
11
  2026.03.29, v5.2.2
2
12
 
3
13
  feature:
package/README.md CHANGED
@@ -228,6 +228,20 @@ if (a) {
228
228
 
229
229
  </details>
230
230
 
231
+ <details><summary>remove useless import curly braces</summary>
232
+
233
+ ```diff
234
+ -import info from '../package.json' {
235
+ - with: {
236
+ - type: 'json',
237
+ - }
238
+ +import info from '../package.json' with {
239
+ + type: 'json',
240
+ -};
241
+ ```
242
+
243
+ </details>
244
+
231
245
  <details><summary>remove useless square brace</summary>
232
246
 
233
247
  ```diff
@@ -4,4 +4,5 @@ export const replace = () => ({
4
4
  'import __a = from "__b"': 'import __a from "__b"',
5
5
  'import {__a} = from "__b"': 'import {__a} from "__b"',
6
6
  'import {__a, __b} = from "__c"': 'import {__a, __b} from "__c"',
7
+ 'function __a = (': 'function __a(',
7
8
  });
@@ -0,0 +1,17 @@
1
+ import montag from 'montag';
2
+
3
+ export const report = () => 'Remove useless curly braces from ImportDeclaration';
4
+
5
+ export const replace = () => ({
6
+ [montag`
7
+ import __a from "__b" {
8
+ with: {
9
+ type: 'json',
10
+ }
11
+ };
12
+ `]: montag`
13
+ import __a from "__b" with {
14
+ type: 'json',
15
+ };
16
+ `,
17
+ });
package/lib/plugins.js CHANGED
@@ -17,6 +17,7 @@ import * as convertFromToRequire from './plugins/convert-from-to-require/index.j
17
17
  import * as removeUselessComma from './plugins/remove-useless-comma/index.js';
18
18
  import * as removeUselessArrow from './plugins/remove-useless-arrow/index.js';
19
19
  import * as removeUselessDot from './plugins/remove-useless-dot/index.js';
20
+ import * as removeUselessImportCurlyBraces from './plugins/remove-useless-import-curly-braces/index.js';
20
21
  import * as removeInvalidCharacter from './plugins/remove-invalid-character/index.js';
21
22
  import * as removeUselessRoundBrace from './plugins/remove-useless-round-brace/index.js';
22
23
  import * as splitNamespaceWithSpecifiers from './plugins/split-namespace-with-specifiers/index.js';
@@ -50,6 +51,7 @@ export const plugins = [
50
51
  ['convert-from-to-require', convertFromToRequire],
51
52
  ['remove-useless-comma', removeUselessComma],
52
53
  ['remove-useless-round-brace', removeUselessRoundBrace],
54
+ ['remove-useless-import-curly-braces', removeUselessImportCurlyBraces],
53
55
  ['remove-useless-arrow', removeUselessArrow],
54
56
  ['remove-useless-assign', removeUselessAssign],
55
57
  ['remove-useless-dot', removeUselessDot],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "5.2.2",
3
+ "version": "5.4.0",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",
@@ -63,6 +63,7 @@
63
63
  "@putout/engine-loader": "^17.0.4",
64
64
  "@putout/operator-keyword": "^5.0.0",
65
65
  "js-tokens": "^10.0.0",
66
+ "montag": "^1.2.1",
66
67
  "obug": "^2.1.1"
67
68
  },
68
69
  "devDependencies": {
@@ -71,7 +72,6 @@
71
72
  "eslint-plugin-putout": "^31.0.0",
72
73
  "madrun": "^13.0.0",
73
74
  "mock-require": "^3.0.3",
74
- "montag": "^1.0.0",
75
75
  "nodemon": "^3.0.1",
76
76
  "putout": "^42.0.3",
77
77
  "superc8": "^12.3.1",