@foray1010/eslint-config 12.0.0 → 12.1.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.md +6 -0
- package/bases/base.mjs +8 -6
- package/package.json +2 -2
- package/utils/applyConfig.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [12.1.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@12.0.0...@foray1010/eslint-config@12.1.0) (2023-11-17)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **eslint-config:** enable regexp strict mode ([07d035b](https://github.com/foray1010/common-presets/commit/07d035badb143ce4490cd4731b8bf43667bbf07b))
|
|
11
|
+
|
|
6
12
|
## [12.0.0](https://github.com/foray1010/common-presets/compare/@foray1010/eslint-config@11.0.3...@foray1010/eslint-config@12.0.0) (2023-11-17)
|
|
7
13
|
|
|
8
14
|
### ⚠ BREAKING CHANGES
|
package/bases/base.mjs
CHANGED
|
@@ -185,9 +185,9 @@ async function generateTypeScriptConfig() {
|
|
|
185
185
|
// reduce the difficult to use this rule
|
|
186
186
|
ignoreInferredTypes: true,
|
|
187
187
|
// escape hatch without using eslint-disable
|
|
188
|
-
ignoreNamePattern: /Mutable
|
|
188
|
+
ignoreNamePattern: /Mutable$/u.source,
|
|
189
189
|
ignoreTypePattern: [
|
|
190
|
-
/^React
|
|
190
|
+
/^React\./u.source, // Some React types does not work with `Readonly`
|
|
191
191
|
],
|
|
192
192
|
},
|
|
193
193
|
],
|
|
@@ -205,12 +205,12 @@ async function generateTypeScriptConfig() {
|
|
|
205
205
|
// modified from https://github.com/eslint-functional/eslint-plugin-functional/blob/main/docs/rules/type-declaration-immutability.md#preset-overrides
|
|
206
206
|
fixer: [
|
|
207
207
|
{
|
|
208
|
-
pattern: /^(Array|Map|Set)<(.+)
|
|
209
|
-
replace: /Readonly\$1<\$2
|
|
208
|
+
pattern: /^(Array|Map|Set)<(.+)>$/u.source,
|
|
209
|
+
replace: /Readonly\$1<\$2>/u.source,
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
|
-
pattern: /^(.+)
|
|
213
|
-
replace: /Readonly<\$1
|
|
212
|
+
pattern: /^(.+)$/u.source,
|
|
213
|
+
replace: /Readonly<\$1>/u.source,
|
|
214
214
|
},
|
|
215
215
|
],
|
|
216
216
|
},
|
|
@@ -411,6 +411,8 @@ const baseConfig = [
|
|
|
411
411
|
destructuring: 'all',
|
|
412
412
|
},
|
|
413
413
|
],
|
|
414
|
+
// enable regexp strict mode
|
|
415
|
+
'regexp/require-unicode-regexp': 'error',
|
|
414
416
|
// use with `unicorn/throw-new-error`
|
|
415
417
|
// disallow builtins to be created without `new` operator, to be consistent with es6 class syntax
|
|
416
418
|
'unicorn/new-for-builtins': 'error',
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@foray1010/eslint-config",
|
|
4
|
-
"version": "12.
|
|
4
|
+
"version": "12.1.0",
|
|
5
5
|
"homepage": "https://github.com/foray1010/common-presets/tree/master/packages/eslint-config#readme",
|
|
6
6
|
"bugs": "https://github.com/foray1010/common-presets/issues",
|
|
7
7
|
"repository": {
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"publishConfig": {
|
|
70
70
|
"access": "public"
|
|
71
71
|
},
|
|
72
|
-
"gitHead": "
|
|
72
|
+
"gitHead": "42c44850b5cf45044e373ab543d4bb83766cd678"
|
|
73
73
|
}
|
package/utils/applyConfig.mjs
CHANGED
|
@@ -64,7 +64,7 @@ function generateCombinations(prefixes, originalGlobs) {
|
|
|
64
64
|
|
|
65
65
|
return prefixes.flatMap((prefix) => {
|
|
66
66
|
return verifiedOriginalGlobs.flatMap((originalGlob) => {
|
|
67
|
-
const signRegexp = /^!/
|
|
67
|
+
const signRegexp = /^!/u
|
|
68
68
|
const sign = originalGlob.match(signRegexp)?.[0] ?? ''
|
|
69
69
|
return sign + path.join(prefix, originalGlob.replace(signRegexp, ''))
|
|
70
70
|
})
|