flatlint 1.46.0 → 1.47.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,16 @@
1
+ 2025.01.14, v1.47.1
2
+
3
+ fix:
4
+ - 77b0023 flatlint: add-missing-round-braces -> add-missing-round-brace
5
+
6
+ feature:
7
+ - 41cd4c4 flatlint: add-missing-round-brace: if
8
+
9
+ 2025.01.14, v1.47.0
10
+
11
+ feature:
12
+ - 5ebcad4 flatlint: remove-invalid-character: ·
13
+
1
14
  2025.01.14, v1.46.0
2
15
 
3
16
  feature:
package/README.md CHANGED
@@ -53,6 +53,10 @@ function x() {
53
53
  alert();
54
54
  }
55
55
 
56
+ -if (a.b() {
57
+ +if (a.b()) {
58
+ }
59
+
56
60
  -a('hello'
57
61
  +a('hello');
58
62
 
@@ -150,9 +154,9 @@ function x() {
150
154
 
151
155
  ```diff
152
156
  -const {¬
153
- - is,¬
154
- - isArgsStr
155
- - isTypeParamsStr,¬
157
+ -····is,¬
158
+ -····sArgsStr
159
+ -····isTypeParamsStr,¬
156
160
  -} = require('./is');¬
157
161
  +const {
158
162
  + is,
@@ -1,11 +1,18 @@
1
1
  import {
2
2
  closeRoundBrace,
3
3
  isPunctuator,
4
+ openRoundBrace,
4
5
  } from '#types';
5
6
 
6
- export const report = () => 'Add missing round braces';
7
+ export const report = () => 'Add missing round brace';
7
8
 
8
9
  export const match = () => ({
10
+ '(__args) {': ({__args}) => {
11
+ if (!isPunctuator(openRoundBrace, __args))
12
+ return false;
13
+
14
+ return !isPunctuator(closeRoundBrace, __args);
15
+ },
9
16
  '__a(__args': (vars, path) => {
10
17
  if (path.isCurrentPunctuator(closeRoundBrace))
11
18
  return false;
@@ -22,4 +29,5 @@ export const match = () => ({
22
29
  export const replace = () => ({
23
30
  'if __a > __b': 'if (__a > __b)',
24
31
  '__a(__args': '__a(__args)',
32
+ '(__args) {': '(__args)) {',
25
33
  });
@@ -1,6 +1,8 @@
1
1
  export const report = () => 'Remove invalid character';
2
2
 
3
3
  export const replace = () => ({
4
+ '·': ' ',
4
5
  '¬': '',
5
6
  ';¬': ';',
7
+ '}¬': '}',
6
8
  });
package/lib/plugins.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as addMissingArrow from './plugins/add-missing-arrow/index.js';
2
- import * as addMissingRoundBraces from './plugins/add-missing-round-braces/index.js';
2
+ import * as addMissingRoundBrace from './plugins/add-missing-round-brace/index.js';
3
3
  import * as addMissingSquireBrace from './plugins/add-missing-square-brace/index.js';
4
4
  import * as addMissingQuote from './plugins/add-missing-quote/index.js';
5
5
  import * as addMissingSemicolon from './plugins/add-missing-semicolon/index.js';
@@ -14,7 +14,7 @@ import * as wrapAssignmentInParens from './plugins/wrap-assignment-in-parens/ind
14
14
 
15
15
  export const plugins = [
16
16
  ['add-missing-arrow', addMissingArrow],
17
- ['add-missing-round-braces', addMissingRoundBraces],
17
+ ['add-missing-round-brace', addMissingRoundBrace],
18
18
  ['add-missing-squire-brace', addMissingSquireBrace],
19
19
  ['add-missing-semicolon', addMissingSemicolon],
20
20
  ['add-missing-comma', addMissingComma],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.46.0",
3
+ "version": "1.47.1",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",