@smartive/eslint-config 6.2.0 → 6.3.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/README.md CHANGED
@@ -22,6 +22,9 @@ export default configs.typescript;
22
22
 
23
23
  // .. or React applications
24
24
  export default configs.react;
25
+
26
+ // .. or Next.js applications
27
+ export default configs.next;
25
28
  ```
26
29
 
27
30
  ### Legacy Config (`.eslintrc`)
package/dist/cjs/index.js CHANGED
@@ -32,6 +32,7 @@ __export(src_exports, {
32
32
  generateLegacyConfig: () => generateLegacyConfig
33
33
  });
34
34
  module.exports = __toCommonJS(src_exports);
35
+ var import_eslintrc = require("@eslint/eslintrc");
35
36
  var import_js = __toESM(require("@eslint/js"));
36
37
  var import_eslint_plugin_import = require("eslint-plugin-import");
37
38
  var import_recommended = __toESM(require("eslint-plugin-prettier/recommended"));
@@ -114,15 +115,24 @@ const flatConfigTypescript = import_typescript_eslint.default.config(
114
115
  }
115
116
  }
116
117
  );
117
- const flatConfigReact = import_typescript_eslint.default.config(
118
+ const flatConfigNext = () => new import_eslintrc.FlatCompat().extends("next").map((config) => {
119
+ const { plugins } = config;
120
+ if (plugins?.import) {
121
+ plugins.import = import_eslint_plugin_import.flatConfigs.errors.plugins.import;
122
+ }
123
+ return config;
124
+ });
125
+ const flatConfigReact = (includeNextConfig = false) => import_typescript_eslint.default.config(
118
126
  flatConfigTypescript,
119
127
  import_eslint_plugin_react.default.configs.flat.recommended,
120
128
  import_eslint_plugin_react.default.configs.flat["jsx-runtime"],
129
+ ...includeNextConfig ? flatConfigNext() : [],
121
130
  { rules: reactRules }
122
131
  );
123
132
  const configs = {
124
133
  typescript: flatConfigTypescript,
125
- react: flatConfigReact
134
+ react: flatConfigReact(),
135
+ next: flatConfigReact(true)
126
136
  };
127
137
  const generateLegacyConfig = (react) => ({
128
138
  rules: rules(react),
package/dist/esm/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { FlatCompat } from "@eslint/eslintrc";
1
2
  import js from "@eslint/js";
2
3
  import { flatConfigs as eslintPluginImportConfigs } from "eslint-plugin-import";
3
4
  import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
@@ -80,15 +81,24 @@ const flatConfigTypescript = tsEslint.config(
80
81
  }
81
82
  }
82
83
  );
83
- const flatConfigReact = tsEslint.config(
84
+ const flatConfigNext = () => new FlatCompat().extends("next").map((config) => {
85
+ const { plugins } = config;
86
+ if (plugins?.import) {
87
+ plugins.import = eslintPluginImportConfigs.errors.plugins.import;
88
+ }
89
+ return config;
90
+ });
91
+ const flatConfigReact = (includeNextConfig = false) => tsEslint.config(
84
92
  flatConfigTypescript,
85
93
  reactPlugin.configs.flat.recommended,
86
94
  reactPlugin.configs.flat["jsx-runtime"],
95
+ ...includeNextConfig ? flatConfigNext() : [],
87
96
  { rules: reactRules }
88
97
  );
89
98
  const configs = {
90
99
  typescript: flatConfigTypescript,
91
- react: flatConfigReact
100
+ react: flatConfigReact(),
101
+ next: flatConfigReact(true)
92
102
  };
93
103
  const generateLegacyConfig = (react) => ({
94
104
  rules: rules(react),
package/dist/index.d.ts CHANGED
@@ -2,5 +2,6 @@ import type { Linter } from 'eslint';
2
2
  export declare const configs: {
3
3
  typescript: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
4
4
  react: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
5
+ next: import("@typescript-eslint/utils/dist/ts-eslint").FlatConfig.ConfigArray;
5
6
  };
6
7
  export declare const generateLegacyConfig: (react: boolean) => Linter.LegacyConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smartive/eslint-config",
3
- "version": "6.2.0",
3
+ "version": "6.3.0",
4
4
  "description": "ESLint configuration by smartive",
5
5
  "files": [
6
6
  "README.md",
@@ -39,6 +39,7 @@
39
39
  },
40
40
  "homepage": "https://github.com/smartive/eslint-config#readme",
41
41
  "dependencies": {
42
+ "@eslint/eslintrc": "^3.2.0",
42
43
  "@typescript-eslint/eslint-plugin": "^8.15.0",
43
44
  "@typescript-eslint/parser": "^8.15.0",
44
45
  "eslint-config-prettier": "^9.1.0",
@@ -50,17 +51,20 @@
50
51
  "typescript-eslint": "^8.15.0"
51
52
  },
52
53
  "peerDependencies": {
53
- "eslint": "^8.57.0 || ^9.0.0"
54
+ "eslint": "^8.57.0 || ^9.0.0",
55
+ "eslint-config-next": "^14.0.0 || ^15.0.0"
54
56
  },
55
57
  "devDependencies": {
56
58
  "@commitlint/cli": "^19.6.0",
57
59
  "@commitlint/config-conventional": "^19.6.0",
58
60
  "@eslint/js": "^9.15.0",
59
61
  "@smartive/prettier-config": "^3.0.0",
62
+ "@types/eslint__eslintrc": "^2.1.2",
60
63
  "@types/node": "^22.9.1",
61
64
  "cz-conventional-changelog": "^3.3.0",
62
65
  "esbuild": "0.24.0",
63
66
  "eslint": "^9.15.0",
67
+ "eslint-config-next": "^15.0.4",
64
68
  "husky": "^9.1.7",
65
69
  "prettier": "^3.3.3",
66
70
  "typescript": "^5.6.3"