@1stg/eslint-config 9.0.1 → 9.0.2
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 +7 -1
- package/_util.js +4 -0
- package/js-base.js +1 -1
- package/overrides.js +9 -7
- package/package.json +1 -1
- package/test.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 9.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#347](https://github.com/1stG/configs/pull/347) [`fac96c2`](https://github.com/1stG/configs/commit/fac96c21f6335f369c86f1ac74b59881dd35c5cb) Thanks [@JounQin](https://github.com/JounQin)! - fix: `reactJsx` should be optional for `mdx`
|
|
8
|
+
|
|
3
9
|
## 9.0.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
6
12
|
|
|
7
|
-
- [#343](https://github.com/1stG/configs/pull/343) [`ad28a13`](https://github.com/1stG/configs/commit/ad28a1398b427b4e5253ab65b1136a3b5d997f7e) Thanks [@JounQin](https://github.com/JounQin)! - fix: add missing `
|
|
13
|
+
- [#343](https://github.com/1stG/configs/pull/343) [`ad28a13`](https://github.com/1stG/configs/commit/ad28a1398b427b4e5253ab65b1136a3b5d997f7e) Thanks [@JounQin](https://github.com/JounQin)! - fix: add missing `homepage` field
|
|
8
14
|
|
|
9
15
|
- Updated dependencies [[`ad28a13`](https://github.com/1stG/configs/commit/ad28a1398b427b4e5253ab65b1136a3b5d997f7e)]:
|
|
10
16
|
- @1stg/config@1.0.5
|
package/_util.js
CHANGED
|
@@ -41,6 +41,10 @@ export const isTsAvailable = isPkgAvailable('typescript')
|
|
|
41
41
|
export const isWebpackAvailable =
|
|
42
42
|
isPkgAvailable('webpack') || isPkgAvailable('@rspack/core')
|
|
43
43
|
|
|
44
|
+
export const isReactPluginAvailable = isPkgAvailable(
|
|
45
|
+
'@eslint-react/eslint-plugin',
|
|
46
|
+
)
|
|
47
|
+
|
|
44
48
|
export const webpackSpecVars = [
|
|
45
49
|
'__non_webpack_require__',
|
|
46
50
|
'__resourceQuery',
|
package/js-base.js
CHANGED
package/overrides.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
-
/** @import {TSESLint} from '@typescript-eslint/utils' */
|
|
3
|
+
/** @import { TSESLint } from '@typescript-eslint/utils' */
|
|
4
4
|
|
|
5
5
|
import { jsoncFiles, nonJsonRcFiles, preferPrettier } from '@1stg/config'
|
|
6
6
|
import { isPkgAvailable } from '@pkgr/utils'
|
|
@@ -13,6 +13,7 @@ import yml_ from 'eslint-plugin-yml'
|
|
|
13
13
|
import tseslint from 'typescript-eslint'
|
|
14
14
|
|
|
15
15
|
import {
|
|
16
|
+
isReactPluginAvailable,
|
|
16
17
|
isTsAvailable,
|
|
17
18
|
magicNumbers,
|
|
18
19
|
nonSourceRules,
|
|
@@ -20,7 +21,6 @@ import {
|
|
|
20
21
|
} from './_util.js'
|
|
21
22
|
import { jsBase } from './js-base.js'
|
|
22
23
|
import { js } from './js.js'
|
|
23
|
-
import { reactJsx } from './react.js'
|
|
24
24
|
import { test } from './test.js'
|
|
25
25
|
import { resolveSettings, tsBase } from './ts-base.js'
|
|
26
26
|
|
|
@@ -128,16 +128,20 @@ export const md = tseslint.config(
|
|
|
128
128
|
mdx_.configs.flatCodeBlocks,
|
|
129
129
|
)
|
|
130
130
|
|
|
131
|
+
const react = isReactPluginAvailable ? await import('./react.js') : undefined
|
|
132
|
+
|
|
131
133
|
export const mdx = tseslint.config(
|
|
132
134
|
{
|
|
133
135
|
name: '@1stg/mdx',
|
|
134
136
|
files: ['**/*.mdx'],
|
|
135
|
-
extends: [reactJsx, mdx_.configs.flat],
|
|
137
|
+
extends: [react?.reactJsx, mdx_.configs.flat].filter(Boolean),
|
|
136
138
|
languageOptions: {
|
|
137
139
|
...jsBase.languageOptions,
|
|
138
140
|
parser: eslintMdx,
|
|
139
141
|
},
|
|
140
|
-
settings:
|
|
142
|
+
settings: react?.reactJsx
|
|
143
|
+
? { ...react.reactJsx[0].settings, ...resolveSettings }
|
|
144
|
+
: resolveSettings,
|
|
141
145
|
rules: {
|
|
142
146
|
'prettier/prettier': preferPrettier ? 0 : 2,
|
|
143
147
|
},
|
|
@@ -216,9 +220,7 @@ export const yml = yaml
|
|
|
216
220
|
export const overrides = tseslint.config(
|
|
217
221
|
js,
|
|
218
222
|
isTsAvailable ? ts : [],
|
|
219
|
-
|
|
220
|
-
? await import('./react.js').then(({ react }) => react)
|
|
221
|
-
: [],
|
|
223
|
+
react?.react || [],
|
|
222
224
|
// The order matters, the later should to be preferred
|
|
223
225
|
markup,
|
|
224
226
|
isPkgAvailable('eslint-plugin-vue')
|
package/package.json
CHANGED