flatlint 1.7.1 → 1.7.3

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
+ 2024.12.30, v1.7.3
2
+
3
+ feature:
4
+ - bdaa1d3 flatlint: add-missing-squire-brace: number
5
+
6
+ 2024.12.30, v1.7.2
7
+
8
+ fix:
9
+ - 42b7194 add-missing-squire-braces: template
10
+
1
11
  2024.12.30, v1.7.1
2
12
 
3
13
  feature:
@@ -8,9 +8,7 @@ import {parseStringLiteral} from './string-literal.js';
8
8
  const isString = (a) => typeof a === 'string';
9
9
 
10
10
  const preprocess = (tokens) => {
11
- const n = tokens.length;
12
-
13
- for (let i = 0; i < n; i++) {
11
+ for (let i = 0; i < tokens.length; i++) {
14
12
  const token = tokens[i];
15
13
 
16
14
  if (isStringLiteral(token))
@@ -9,6 +9,7 @@ export function parseStringLiteral({i, token, tokens}) {
9
9
 
10
10
  if (closed) {
11
11
  const literal = StringLiteral(value.slice(1, -1));
12
+
12
13
  newTokens.push(literal, quote);
13
14
  tokens.splice(i, 1, ...newTokens);
14
15
  ++i;
@@ -4,7 +4,9 @@ export function report() {
4
4
 
5
5
  export function replace() {
6
6
  return {
7
- '["hello";': '["hello"];',
8
- '["hello", "world";': '["hello", "world"];',
7
+ '["__a";': '["__a"];',
8
+ '[__a;': '[__a];',
9
+ '["__a", "__b";': '["__a", "__b"];',
10
+ '[__a, __b;': '[__a, __b];',
9
11
  };
10
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flatlint",
3
- "version": "1.7.1",
3
+ "version": "1.7.3",
4
4
  "description": "JavaScript tokens-based linter",
5
5
  "main": "lib/flatlint.js",
6
6
  "type": "module",