@smartive/eslint-config 6.1.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"));
@@ -57,6 +58,7 @@ const rules = (react) => ({
57
58
  "@typescript-eslint/consistent-type-definitions": "off",
58
59
  "@typescript-eslint/explicit-function-return-type": "off",
59
60
  "@typescript-eslint/explicit-module-boundary-types": "off",
61
+ "@typescript-eslint/prefer-regexp-exec": "off",
60
62
  "@typescript-eslint/no-var-requires": "warn",
61
63
  "@typescript-eslint/no-unused-vars": ["error"],
62
64
  "@typescript-eslint/no-floating-promises": ["error"],
@@ -113,15 +115,24 @@ const flatConfigTypescript = import_typescript_eslint.default.config(
113
115
  }
114
116
  }
115
117
  );
116
- 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(
117
126
  flatConfigTypescript,
118
127
  import_eslint_plugin_react.default.configs.flat.recommended,
119
128
  import_eslint_plugin_react.default.configs.flat["jsx-runtime"],
129
+ ...includeNextConfig ? flatConfigNext() : [],
120
130
  { rules: reactRules }
121
131
  );
122
132
  const configs = {
123
133
  typescript: flatConfigTypescript,
124
- react: flatConfigReact
134
+ react: flatConfigReact(),
135
+ next: flatConfigReact(true)
125
136
  };
126
137
  const generateLegacyConfig = (react) => ({
127
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";
@@ -23,6 +24,7 @@ const rules = (react) => ({
23
24
  "@typescript-eslint/consistent-type-definitions": "off",
24
25
  "@typescript-eslint/explicit-function-return-type": "off",
25
26
  "@typescript-eslint/explicit-module-boundary-types": "off",
27
+ "@typescript-eslint/prefer-regexp-exec": "off",
26
28
  "@typescript-eslint/no-var-requires": "warn",
27
29
  "@typescript-eslint/no-unused-vars": ["error"],
28
30
  "@typescript-eslint/no-floating-promises": ["error"],
@@ -79,15 +81,24 @@ const flatConfigTypescript = tsEslint.config(
79
81
  }
80
82
  }
81
83
  );
82
- 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(
83
92
  flatConfigTypescript,
84
93
  reactPlugin.configs.flat.recommended,
85
94
  reactPlugin.configs.flat["jsx-runtime"],
95
+ ...includeNextConfig ? flatConfigNext() : [],
86
96
  { rules: reactRules }
87
97
  );
88
98
  const configs = {
89
99
  typescript: flatConfigTypescript,
90
- react: flatConfigReact
100
+ react: flatConfigReact(),
101
+ next: flatConfigReact(true)
91
102
  };
92
103
  const generateLegacyConfig = (react) => ({
93
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.1.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"