Skip to content

Commit a1a29dc

Browse files
authored
refactor: update eslint-config-eslint (#128)
* chore: update eslint-config-eslint * fix lint errors * simplify @import pattern
1 parent f4f0d20 commit a1a29dc

File tree

5 files changed

+5
-6
lines changed

5 files changed

+5
-6
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"c8": "^10.1.3",
9393
"dedent": "^1.5.3",
9494
"eslint": "^9.31.0",
95-
"eslint-config-eslint": "^11.0.0",
95+
"eslint-config-eslint": "^12.0.0",
9696
"eslint-plugin-eslint-plugin": "^6.3.2",
9797
"got": "^14.4.2",
9898
"lint-staged": "^15.2.7",

src/languages/json-source-code.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
const commentParser = new ConfigCommentParser();
3434

3535
const INLINE_CONFIG =
36-
/^\s*(?:eslint(?:-enable|-disable(?:(?:-next)?-line)?)?)(?:\s|$)/u;
36+
/^\s*eslint(?:-enable|-disable(?:(?:-next)?-line)?)?(?:\s|$)/u;
3737

3838
/**
3939
* A class to represent a step in the traversal process.

src/rules/no-unsafe-values.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
* We separately capture the integer and fractional parts of a number, so that
2626
* we can check for unsafe numbers that will evaluate to Infinity.
2727
*/
28-
const NUMBER =
29-
/^-?(?<int>0|([1-9][0-9]*))(?:\.(?<frac>[0-9]+))?(?:[eE][+-]?[0-9]+)?$/u;
28+
const NUMBER = /^-?(?<int>0|([1-9]\d*))(?:\.(?<frac>\d+))?(?:e[+-]?\d+)?$/iu;
3029
const NON_ZERO = /[1-9]/u;
3130

3231
//-----------------------------------------------------------------------------

tools/dedupe-types.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import fs from "node:fs";
2020
//-----------------------------------------------------------------------------
2121

2222
const importRegExp =
23-
/^\s*\*\s*@import\s*\{\s*(?<ids>[^,}]+(?:\s*,\s*[^,}]+)*)\s*\}\s*from\s*"(?<source>[^"]+)"/u;
23+
/^\s*\*\s*@import\s*\{(?<ids>[^,}]+(?:,[^,}]+)*)\}\s*from\s*"(?<source>[^"]+)"/u;
2424

2525
// read files from the command line
2626
const files = process.argv.slice(2);

tools/update-readme.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const allSponsors = await fetchSponsorsMarkdown();
4444
const readme = readFileSync(README_FILE_PATH, "utf8");
4545

4646
let newReadme = readme.replace(
47-
/<!--sponsorsstart-->[\w\W]*?<!--sponsorsend-->/u,
47+
/<!--sponsorsstart-->[\s\S]*?<!--sponsorsend-->/u,
4848
`<!--sponsorsstart-->\n\n${allSponsors}\n<!--sponsorsend-->`,
4949
);
5050

0 commit comments

Comments
 (0)