@pengzhanbo/eslint-config-react 1.3.4 → 1.5.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/dist/index.cjs CHANGED
@@ -40,6 +40,9 @@ __export(src_exports, {
40
40
  module.exports = __toCommonJS(src_exports);
41
41
 
42
42
  // src/factory.ts
43
+ var import_eslint_config4 = require("@pengzhanbo/eslint-config");
44
+
45
+ // src/preset.ts
43
46
  var import_eslint_config3 = require("@pengzhanbo/eslint-config");
44
47
 
45
48
  // src/react.ts
@@ -168,18 +171,18 @@ async function next(options = {}) {
168
171
  // src/preset.ts
169
172
  var reactPreset = (options) => {
170
173
  return [react({
171
- overrides: options.overrides.react,
174
+ overrides: (0, import_eslint_config3.getOverrides)(options, "react"),
172
175
  typescript: !!options.typescript
173
176
  })];
174
177
  };
175
178
  var nextPreset = (options) => {
176
179
  return [next({
177
- overrides: options.overrides.nextjs
180
+ overrides: (0, import_eslint_config3.getOverrides)(options, "nextjs")
178
181
  })];
179
182
  };
180
183
 
181
184
  // src/factory.ts
182
- var eslintReactConfig = (0, import_eslint_config3.createConfig)([reactPreset, nextPreset]);
185
+ var eslintReactConfig = (0, import_eslint_config4.createConfig)([reactPreset, nextPreset]);
183
186
 
184
187
  // src/index.ts
185
188
  __reExport(src_exports, require("@pengzhanbo/eslint-config"), module.exports);
package/dist/index.d.cts CHANGED
@@ -1,7 +1,13 @@
1
1
  import * as _pengzhanbo_eslint_config from '@pengzhanbo/eslint-config';
2
- import { OptionsHasTypeScript, OptionsOverrides, OptionsFiles, FlatConfigItem, PresetItem } from '@pengzhanbo/eslint-config';
2
+ import { OptionsOverrides, OptionsHasTypeScript, OptionsFiles, FlatConfigItem, PresetItem } from '@pengzhanbo/eslint-config';
3
3
  export * from '@pengzhanbo/eslint-config';
4
4
 
5
+ declare module '@pengzhanbo/eslint-config' {
6
+ interface OptionsFrameworkExtract {
7
+ react?: OptionsOverrides;
8
+ nextjs?: OptionsOverrides;
9
+ }
10
+ }
5
11
  declare const eslintReactConfig: typeof _pengzhanbo_eslint_config.default;
6
12
 
7
13
  declare function react(options?: OptionsHasTypeScript & OptionsOverrides & OptionsFiles): Promise<FlatConfigItem[]>;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,13 @@
1
1
  import * as _pengzhanbo_eslint_config from '@pengzhanbo/eslint-config';
2
- import { OptionsHasTypeScript, OptionsOverrides, OptionsFiles, FlatConfigItem, PresetItem } from '@pengzhanbo/eslint-config';
2
+ import { OptionsOverrides, OptionsHasTypeScript, OptionsFiles, FlatConfigItem, PresetItem } from '@pengzhanbo/eslint-config';
3
3
  export * from '@pengzhanbo/eslint-config';
4
4
 
5
+ declare module '@pengzhanbo/eslint-config' {
6
+ interface OptionsFrameworkExtract {
7
+ react?: OptionsOverrides;
8
+ nextjs?: OptionsOverrides;
9
+ }
10
+ }
5
11
  declare const eslintReactConfig: typeof _pengzhanbo_eslint_config.default;
6
12
 
7
13
  declare function react(options?: OptionsHasTypeScript & OptionsOverrides & OptionsFiles): Promise<FlatConfigItem[]>;
package/dist/index.js CHANGED
@@ -1,6 +1,9 @@
1
1
  // src/factory.ts
2
2
  import { createConfig } from "@pengzhanbo/eslint-config";
3
3
 
4
+ // src/preset.ts
5
+ import { getOverrides } from "@pengzhanbo/eslint-config";
6
+
4
7
  // src/react.ts
5
8
  import { isPackageExists } from "local-pkg";
6
9
  import { GLOB_JSX, GLOB_TSX, interopDefault } from "@pengzhanbo/eslint-config";
@@ -127,13 +130,13 @@ async function next(options = {}) {
127
130
  // src/preset.ts
128
131
  var reactPreset = (options) => {
129
132
  return [react({
130
- overrides: options.overrides.react,
133
+ overrides: getOverrides(options, "react"),
131
134
  typescript: !!options.typescript
132
135
  })];
133
136
  };
134
137
  var nextPreset = (options) => {
135
138
  return [next({
136
- overrides: options.overrides.nextjs
139
+ overrides: getOverrides(options, "nextjs")
137
140
  })];
138
141
  };
139
142
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pengzhanbo/eslint-config-react",
3
3
  "type": "module",
4
- "version": "1.3.4",
4
+ "version": "1.5.0",
5
5
  "author": "pengzhanbo <q942450674@outlook.com> (https://github/pengzhanbo/)",
6
6
  "license": "MIT",
7
7
  "homepage": "https://github.com/pengzhanbo/configs#readme",
@@ -51,11 +51,11 @@
51
51
  "eslint-plugin-react-hooks": "^4.6.0",
52
52
  "eslint-plugin-react-refresh": "^0.4.5",
53
53
  "local-pkg": "^0.5.0",
54
- "@pengzhanbo/eslint-config": "1.3.4"
54
+ "@pengzhanbo/eslint-config": "1.5.0"
55
55
  },
56
56
  "devDependencies": {
57
57
  "eslint": "^8.56.0",
58
- "eslint-flat-config-viewer": "^0.1.3",
58
+ "eslint-flat-config-viewer": "^0.1.4",
59
59
  "tsup": "^8.0.1"
60
60
  },
61
61
  "scripts": {