@abinnovision/eslint-config-react 3.1.0-beta.2 → 3.1.1-beta.20

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.1.0](https://github.com/abinnovision/js-commons/compare/eslint-config-react-v3.0.3...eslint-config-react-v3.1.0) (2026-02-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * downgrade to eslint v9 and add documentation about it ([#575](https://github.com/abinnovision/js-commons/issues/575)) ([5810b53](https://github.com/abinnovision/js-commons/commit/5810b538b386fb56848a3d1755a8eda7123e88fd))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * migrate better-tailwindcss rules ([#577](https://github.com/abinnovision/js-commons/issues/577)) ([943ccca](https://github.com/abinnovision/js-commons/commit/943ccca44b166671bc7508481f618767b57a7dad))
14
+
3
15
  ## [3.0.3](https://github.com/abinnovision/js-commons/compare/eslint-config-react-v3.0.2...eslint-config-react-v3.0.3) (2026-02-19)
4
16
 
5
17
 
package/README.md CHANGED
@@ -1,69 +1,58 @@
1
1
  # @abinnovision/eslint-config-react
2
2
 
3
- ESLint configuration for React applications. Built on
4
- [@eslint-react/eslint-plugin](https://eslint-react.xyz) and
5
- [eslint-plugin-react-hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks).
3
+ ESLint configuration for React applications. Builds
4
+ upon [@abinnovision/eslint-config-base](../eslint-config-base).
6
5
 
7
- ## ESLint Compatibility
6
+ ## Installation
8
7
 
9
- This package requires **ESLint v9** (`^9.0.0`). ESLint v10 is **not** supported
10
- because key plugins in the ecosystem have not yet released compatible versions.
8
+ ```shell
9
+ yarn add --dev @abinnovision/eslint-config-react @abinnovision/eslint-config-base eslint
10
+ ```
11
11
 
12
- Until all dependencies fully support ESLint v10, we pin to v9 to ensure a stable
13
- and working configuration out of the box.
12
+ ## ESLint Config Format
14
13
 
15
- ## External ESLint Plugin Dependencies
14
+ This package requires
15
+ ESLint's [flat config](https://eslint.org/docs/latest/use/configure/configuration-files)
16
+ format (not legacy `.eslintrc`).
16
17
 
17
- | Plugin | Purpose |
18
- | ---------------------------------- | ------------------------------------------------------------------------- |
19
- | `@eslint-react/eslint-plugin` | Comprehensive React linting (components, hooks, DOM, web APIs) |
20
- | `eslint-plugin-react-hooks` | Rules of Hooks enforcement and exhaustive-deps checking |
21
- | `eslint-plugin-better-tailwindcss` | Tailwind CSS class ordering, conflicts, and validation (tailwind flavour) |
18
+ | Config file | Requirements |
19
+ | ------------------ | --------------------------------------------------------------------- |
20
+ | `eslint.config.ts` | ESLint **9.18+** and [`jiti`](https://github.com/unjs/jiti) **v2.0+** |
21
+ | `eslint.config.js` | ESLint **9.0+** |
22
22
 
23
- ## Installation
23
+ TypeScript config files are preferred. Install `jiti` as a dev dependency:
24
24
 
25
25
  ```shell
26
- yarn add --dev @abinnovision/eslint-config-react @abinnovision/eslint-config-base eslint
26
+ yarn add --dev jiti
27
27
  ```
28
28
 
29
+ If ESLint 9.18+ or `jiti` cannot be provided, use `eslint.config.js` (or
30
+ `.mjs`) instead. The imports and configuration are identical.
31
+
29
32
  ## Usage
30
33
 
31
- ```javascript
32
- // eslint.config.js
34
+ ```typescript
33
35
  import { base } from "@abinnovision/eslint-config-base";
34
36
  import { react } from "@abinnovision/eslint-config-react";
35
37
  import { defineConfig } from "eslint/config";
36
38
 
37
- export default defineConfig([{ extends: [base] }, { extends: [react] }]);
39
+ export default defineConfig([{ extends: [base, react] }]);
38
40
  ```
39
41
 
40
42
  ## Flavours
41
43
 
42
- Specialized configurations for specific React use cases.
44
+ Flavours are optional rule sets that complement `react`. They must always be used alongside it.
43
45
 
44
46
  ### Tailwind CSS
45
47
 
46
- For React applications using Tailwind CSS. Enforces class ordering,
47
- detects conflicts, and validates Tailwind usage.
48
-
49
- ```javascript
48
+ ```typescript
50
49
  import { base } from "@abinnovision/eslint-config-base";
51
50
  import { react, tailwind } from "@abinnovision/eslint-config-react";
52
51
  import { defineConfig } from "eslint/config";
53
52
 
54
- export default defineConfig([
55
- { extends: [base] },
56
- { extends: [react] },
57
- { extends: [tailwind] },
58
- ]);
53
+ export default defineConfig([{ extends: [base, react, tailwind] }]);
59
54
  ```
60
55
 
61
- ## Related Packages
62
-
63
- - [@abinnovision/eslint-config-base](../eslint-config-base) - Base
64
- configuration
65
- - [@abinnovision/prettier-config](../prettier-config) - Code formatting
66
-
67
56
  ## License
68
57
 
69
58
  Apache-2.0
@@ -0,0 +1,23 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ //#endregion
23
+ exports.__toESM = __toESM;
@@ -0,0 +1,29 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
+ let eslint_config = require("eslint/config");
3
+ let eslint_plugin_better_tailwindcss = require("eslint-plugin-better-tailwindcss");
4
+ eslint_plugin_better_tailwindcss = require_runtime.__toESM(eslint_plugin_better_tailwindcss);
5
+ //#region src/configs/flavour-tailwind.ts
6
+ /**
7
+ * ESLint configuration for Tailwind CSS.
8
+ *
9
+ * Note that this configuration include stylistic rules.
10
+ */
11
+ const config = (0, eslint_config.defineConfig)([{
12
+ files: ["**/*.{js,jsx,ts,tsx}"],
13
+ plugins: { "better-tailwindcss": eslint_plugin_better_tailwindcss.default },
14
+ rules: {
15
+ "better-tailwindcss/enforce-consistent-line-wrapping": ["warn", {
16
+ preferSingleLine: true,
17
+ indent: "tab",
18
+ strictness: "loose"
19
+ }],
20
+ "better-tailwindcss/enforce-consistent-class-order": "warn",
21
+ "better-tailwindcss/enforce-shorthand-classes": "warn",
22
+ "better-tailwindcss/no-duplicate-classes": "warn",
23
+ "better-tailwindcss/no-unnecessary-whitespace": "warn",
24
+ "better-tailwindcss/no-unknown-classes": ["warn", { detectComponentClasses: true }],
25
+ "better-tailwindcss/no-conflicting-classes": "error"
26
+ }
27
+ }]);
28
+ //#endregion
29
+ exports.config = config;
@@ -0,0 +1,11 @@
1
+ import * as eslint_config0 from "eslint/config";
2
+
3
+ //#region src/configs/flavour-tailwind.d.ts
4
+ /**
5
+ * ESLint configuration for Tailwind CSS.
6
+ *
7
+ * Note that this configuration include stylistic rules.
8
+ */
9
+ declare const config: eslint_config0.Config[];
10
+ //#endregion
11
+ export { config };
@@ -0,0 +1,11 @@
1
+ import * as eslint_config0 from "eslint/config";
2
+
3
+ //#region src/configs/flavour-tailwind.d.ts
4
+ /**
5
+ * ESLint configuration for Tailwind CSS.
6
+ *
7
+ * Note that this configuration include stylistic rules.
8
+ */
9
+ declare const config: eslint_config0.Config[];
10
+ //#endregion
11
+ export { config };
@@ -0,0 +1,27 @@
1
+ import { defineConfig } from "eslint/config";
2
+ import betterTailwindcss from "eslint-plugin-better-tailwindcss";
3
+ //#region src/configs/flavour-tailwind.ts
4
+ /**
5
+ * ESLint configuration for Tailwind CSS.
6
+ *
7
+ * Note that this configuration include stylistic rules.
8
+ */
9
+ const config = defineConfig([{
10
+ files: ["**/*.{js,jsx,ts,tsx}"],
11
+ plugins: { "better-tailwindcss": betterTailwindcss },
12
+ rules: {
13
+ "better-tailwindcss/enforce-consistent-line-wrapping": ["warn", {
14
+ preferSingleLine: true,
15
+ indent: "tab",
16
+ strictness: "loose"
17
+ }],
18
+ "better-tailwindcss/enforce-consistent-class-order": "warn",
19
+ "better-tailwindcss/enforce-shorthand-classes": "warn",
20
+ "better-tailwindcss/no-duplicate-classes": "warn",
21
+ "better-tailwindcss/no-unnecessary-whitespace": "warn",
22
+ "better-tailwindcss/no-unknown-classes": ["warn", { detectComponentClasses: true }],
23
+ "better-tailwindcss/no-conflicting-classes": "error"
24
+ }
25
+ }]);
26
+ //#endregion
27
+ export { config };
@@ -0,0 +1,2 @@
1
+ require("./react.cjs");
2
+ require("./flavour-tailwind.cjs");
@@ -0,0 +1,2 @@
1
+ import { config } from "./react.mjs";
2
+ import { config as config$1 } from "./flavour-tailwind.mjs";
@@ -0,0 +1,3 @@
1
+ import "./react.mjs";
2
+ import "./flavour-tailwind.mjs";
3
+ export {};
@@ -0,0 +1,42 @@
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
2
+ let _eslint_react_eslint_plugin = require("@eslint-react/eslint-plugin");
3
+ _eslint_react_eslint_plugin = require_runtime.__toESM(_eslint_react_eslint_plugin);
4
+ let eslint_config = require("eslint/config");
5
+ let eslint_plugin_react_hooks = require("eslint-plugin-react-hooks");
6
+ eslint_plugin_react_hooks = require_runtime.__toESM(eslint_plugin_react_hooks);
7
+ //#region src/configs/react.ts
8
+ const { configs: _, ...eslintReactHooksPlugin } = eslint_plugin_react_hooks.default;
9
+ const config = (0, eslint_config.defineConfig)([{
10
+ files: ["**/*.{js,jsx,ts,tsx}"],
11
+ plugins: { "react-hooks": eslintReactHooksPlugin },
12
+ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
13
+ extends: [_eslint_react_eslint_plugin.default.configs.recommended],
14
+ rules: {
15
+ "react-hooks/rules-of-hooks": "error",
16
+ "react-hooks/exhaustive-deps": "warn",
17
+ "@eslint-react/dom/no-dangerously-set-innerhtml": "error",
18
+ "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
19
+ "@eslint-react/dom/no-script-url": "error",
20
+ "@eslint-react/dom/no-unsafe-target-blank": "error",
21
+ "@eslint-react/dom/no-missing-iframe-sandbox": "error",
22
+ "@eslint-react/dom/no-unsafe-iframe-sandbox": "error",
23
+ "@eslint-react/web-api/no-leaked-event-listener": "error",
24
+ "@eslint-react/web-api/no-leaked-interval": "error",
25
+ "@eslint-react/web-api/no-leaked-timeout": "error",
26
+ "@eslint-react/web-api/no-leaked-resize-observer": "error",
27
+ "@eslint-react/no-array-index-key": "warn",
28
+ "@eslint-react/no-nested-component-definitions": "error",
29
+ "@eslint-react/no-unstable-context-value": "warn",
30
+ "@eslint-react/no-unnecessary-use-callback": "warn",
31
+ "@eslint-react/no-unnecessary-use-memo": "warn",
32
+ "@eslint-react/jsx-no-duplicate-props": "error",
33
+ "@eslint-react/jsx-no-undef": "error",
34
+ "@eslint-react/no-missing-key": "error",
35
+ "@eslint-react/no-children-prop": "error",
36
+ "@eslint-react/no-direct-mutation-state": "error",
37
+ "@eslint-react/no-string-refs": "error",
38
+ "@eslint-react/dom/no-find-dom-node": "error"
39
+ }
40
+ }]);
41
+ //#endregion
42
+ exports.config = config;
@@ -0,0 +1,6 @@
1
+ import * as eslint_config0 from "eslint/config";
2
+
3
+ //#region src/configs/react.d.ts
4
+ declare const config: eslint_config0.Config[];
5
+ //#endregion
6
+ export { config };
@@ -0,0 +1,6 @@
1
+ import * as eslint_config0 from "eslint/config";
2
+
3
+ //#region src/configs/react.d.ts
4
+ declare const config: eslint_config0.Config[];
5
+ //#endregion
6
+ export { config };
@@ -0,0 +1,39 @@
1
+ import eslintReactPlugin from "@eslint-react/eslint-plugin";
2
+ import { defineConfig } from "eslint/config";
3
+ import eslintReactHooks from "eslint-plugin-react-hooks";
4
+ //#region src/configs/react.ts
5
+ const { configs: _, ...eslintReactHooksPlugin } = eslintReactHooks;
6
+ const config = defineConfig([{
7
+ files: ["**/*.{js,jsx,ts,tsx}"],
8
+ plugins: { "react-hooks": eslintReactHooksPlugin },
9
+ languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
10
+ extends: [eslintReactPlugin.configs.recommended],
11
+ rules: {
12
+ "react-hooks/rules-of-hooks": "error",
13
+ "react-hooks/exhaustive-deps": "warn",
14
+ "@eslint-react/dom/no-dangerously-set-innerhtml": "error",
15
+ "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
16
+ "@eslint-react/dom/no-script-url": "error",
17
+ "@eslint-react/dom/no-unsafe-target-blank": "error",
18
+ "@eslint-react/dom/no-missing-iframe-sandbox": "error",
19
+ "@eslint-react/dom/no-unsafe-iframe-sandbox": "error",
20
+ "@eslint-react/web-api/no-leaked-event-listener": "error",
21
+ "@eslint-react/web-api/no-leaked-interval": "error",
22
+ "@eslint-react/web-api/no-leaked-timeout": "error",
23
+ "@eslint-react/web-api/no-leaked-resize-observer": "error",
24
+ "@eslint-react/no-array-index-key": "warn",
25
+ "@eslint-react/no-nested-component-definitions": "error",
26
+ "@eslint-react/no-unstable-context-value": "warn",
27
+ "@eslint-react/no-unnecessary-use-callback": "warn",
28
+ "@eslint-react/no-unnecessary-use-memo": "warn",
29
+ "@eslint-react/jsx-no-duplicate-props": "error",
30
+ "@eslint-react/jsx-no-undef": "error",
31
+ "@eslint-react/no-missing-key": "error",
32
+ "@eslint-react/no-children-prop": "error",
33
+ "@eslint-react/no-direct-mutation-state": "error",
34
+ "@eslint-react/no-string-refs": "error",
35
+ "@eslint-react/dom/no-find-dom-node": "error"
36
+ }
37
+ }]);
38
+ //#endregion
39
+ export { config };
package/dist/index.cjs CHANGED
@@ -1,276 +1,6 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __export = (target, all) => {
9
- for (var name in all)
10
- __defProp(target, name, { get: all[name], enumerable: true });
11
- };
12
- var __copyProps = (to, from, except, desc) => {
13
- if (from && typeof from === "object" || typeof from === "function") {
14
- for (let key of __getOwnPropNames(from))
15
- if (!__hasOwnProp.call(to, key) && key !== except)
16
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
- }
18
- return to;
19
- };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/index.ts
31
- var src_exports = {};
32
- __export(src_exports, {
33
- react: () => config,
34
- tailwind: () => config2
35
- });
36
- module.exports = __toCommonJS(src_exports);
37
-
38
- // src/configs/react.ts
39
- var import_eslint_plugin = __toESM(require("@eslint-react/eslint-plugin"), 1);
40
- var import_config = require("eslint/config");
41
- var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
42
- var { configs: _, ...eslintReactHooksPlugin } = import_eslint_plugin_react_hooks.default;
43
- var config = (0, import_config.defineConfig)([
44
- {
45
- files: ["**/*.{js,jsx,ts,tsx}"],
46
- plugins: {
47
- "react-hooks": eslintReactHooksPlugin
48
- },
49
- languageOptions: {
50
- parserOptions: { ecmaFeatures: { jsx: true } }
51
- },
52
- extends: [
53
- /**
54
- * ESLint React Recommended Configuration.
55
- * Includes x (renderer-agnostic), dom, and web-api rules.
56
- *
57
- * @see https://eslint-react.xyz/docs/configuration
58
- */
59
- import_eslint_plugin.default.configs.recommended
60
- ],
61
- rules: {
62
- /**
63
- * Enforce Rules of Hooks.
64
- *
65
- * @see https://react.dev/reference/react/hooks#rules-of-hooks
66
- */
67
- "react-hooks/rules-of-hooks": "error",
68
- /**
69
- * Verify dependencies array in hooks.
70
- *
71
- * @see https://react.dev/reference/react/hooks#rules-of-hooks
72
- */
73
- "react-hooks/exhaustive-deps": "warn",
74
- /**
75
- * Disallow dangerouslySetInnerHTML.
76
- *
77
- * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
78
- */
79
- "@eslint-react/dom/no-dangerously-set-innerhtml": "error",
80
- /**
81
- * Disallow dangerouslySetInnerHTML with children.
82
- *
83
- * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
84
- */
85
- "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
86
- /**
87
- * Disallow javascript: URLs.
88
- *
89
- * @see https://eslint-react.xyz/docs/rules/dom-no-script-url
90
- */
91
- "@eslint-react/dom/no-script-url": "error",
92
- /**
93
- * Enforce security attributes on target="_blank" links.
94
- *
95
- * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
96
- */
97
- "@eslint-react/dom/no-unsafe-target-blank": "error",
98
- /**
99
- * Require sandbox attribute on iframes.
100
- *
101
- * @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
102
- */
103
- "@eslint-react/dom/no-missing-iframe-sandbox": "error",
104
- /**
105
- * Disallow unsafe iframe sandbox values.
106
- *
107
- * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
108
- */
109
- "@eslint-react/dom/no-unsafe-iframe-sandbox": "error",
110
- /**
111
- * Prevent memory leaks from event listeners.
112
- *
113
- * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
114
- */
115
- "@eslint-react/web-api/no-leaked-event-listener": "error",
116
- /**
117
- * Prevent memory leaks from intervals.
118
- *
119
- * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
120
- */
121
- "@eslint-react/web-api/no-leaked-interval": "error",
122
- /**
123
- * Prevent memory leaks from timeouts.
124
- *
125
- * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
126
- */
127
- "@eslint-react/web-api/no-leaked-timeout": "error",
128
- /**
129
- * Prevent memory leaks from resize observers.
130
- *
131
- * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
132
- */
133
- "@eslint-react/web-api/no-leaked-resize-observer": "error",
134
- /**
135
- * Warn against using array indices as keys.
136
- *
137
- * @see https://eslint-react.xyz/docs/rules/no-array-index-key
138
- */
139
- "@eslint-react/no-array-index-key": "warn",
140
- /**
141
- * Prevent unstable nested component definitions.
142
- *
143
- * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
144
- */
145
- "@eslint-react/no-nested-component-definitions": "error",
146
- /**
147
- * Warn against unstable context values.
148
- *
149
- * @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
150
- */
151
- "@eslint-react/no-unstable-context-value": "warn",
152
- /**
153
- * Warn against unnecessary useCallback.
154
- *
155
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
156
- */
157
- "@eslint-react/no-unnecessary-use-callback": "warn",
158
- /**
159
- * Warn against unnecessary useMemo.
160
- *
161
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
162
- */
163
- "@eslint-react/no-unnecessary-use-memo": "warn",
164
- /**
165
- * Disallow duplicate props in JSX.
166
- *
167
- * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
168
- */
169
- "@eslint-react/jsx-no-duplicate-props": "error",
170
- /**
171
- * Disallow undefined components in JSX.
172
- *
173
- * @see https://eslint-react.xyz/docs/rules/jsx-no-undef
174
- */
175
- "@eslint-react/jsx-no-undef": "error",
176
- /**
177
- * Require keys for array elements.
178
- *
179
- * @see https://eslint-react.xyz/docs/rules/no-missing-key
180
- */
181
- "@eslint-react/no-missing-key": "error",
182
- /**
183
- * Disallow children prop.
184
- *
185
- * @see https://eslint-react.xyz/docs/rules/no-children-prop
186
- */
187
- "@eslint-react/no-children-prop": "error",
188
- /**
189
- * Disallow direct state mutation.
190
- *
191
- * @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
192
- */
193
- "@eslint-react/no-direct-mutation-state": "error",
194
- /**
195
- * Disallow string refs.
196
- *
197
- * @see https://eslint-react.xyz/docs/rules/no-string-refs
198
- */
199
- "@eslint-react/no-string-refs": "error",
200
- /**
201
- * Disallow findDOMNode.
202
- *
203
- * @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
204
- */
205
- "@eslint-react/dom/no-find-dom-node": "error"
206
- }
207
- }
208
- ]);
209
-
210
- // src/configs/flavour-tailwind.ts
211
- var import_config2 = require("eslint/config");
212
- var import_eslint_plugin_better_tailwindcss = __toESM(require("eslint-plugin-better-tailwindcss"), 1);
213
- var config2 = (0, import_config2.defineConfig)([
214
- {
215
- files: ["**/*.{js,jsx,ts,tsx}"],
216
- plugins: {
217
- "better-tailwindcss": import_eslint_plugin_better_tailwindcss.default
218
- },
219
- rules: {
220
- /**
221
- * Enforce consistent line wrapping.
222
- *
223
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
224
- */
225
- "better-tailwindcss/enforce-consistent-line-wrapping": [
226
- "warn",
227
- // Prefer single line when possible. We use tabs for indentation.
228
- { preferSingleLine: true, indent: "tab" }
229
- ],
230
- /**
231
- * Enforce consistent class order.
232
- *
233
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
234
- */
235
- "better-tailwindcss/enforce-consistent-class-order": "warn",
236
- /**
237
- * Enforce shorthand classes.
238
- *
239
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
240
- */
241
- "better-tailwindcss/enforce-shorthand-classes": "warn",
242
- /**
243
- * Remove duplicate classes.
244
- *
245
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
246
- */
247
- "better-tailwindcss/no-duplicate-classes": "warn",
248
- /**
249
- * Disallow unnecessary whitespace.
250
- *
251
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
252
- */
253
- "better-tailwindcss/no-unnecessary-whitespace": "warn",
254
- /**
255
- * Report unregistered classes.
256
- *
257
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
258
- */
259
- "better-tailwindcss/no-unknown-classes": [
260
- "warn",
261
- { detectComponentClasses: true }
262
- ],
263
- /**
264
- * Report conflicting classes.
265
- *
266
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
267
- */
268
- "better-tailwindcss/no-conflicting-classes": "error"
269
- }
270
- }
271
- ]);
272
- // Annotate the CommonJS export names for ESM import in node:
273
- 0 && (module.exports = {
274
- react,
275
- tailwind
276
- });
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_react = require("./configs/react.cjs");
3
+ const require_flavour_tailwind = require("./configs/flavour-tailwind.cjs");
4
+ require("./configs/index.cjs");
5
+ exports.react = require_react.config;
6
+ exports.tailwind = require_flavour_tailwind.config;
package/dist/index.d.cts CHANGED
@@ -1,12 +1,3 @@
1
- import * as eslint_config from 'eslint/config';
2
-
3
- declare const config$1: eslint_config.Config[];
4
-
5
- /**
6
- * ESLint configuration for Tailwind CSS.
7
- *
8
- * Note that this configuration include stylistic rules.
9
- */
10
- declare const config: eslint_config.Config[];
11
-
12
- export { config$1 as react, config as tailwind };
1
+ import { config } from "./configs/react.cjs";
2
+ import { config as config$1 } from "./configs/flavour-tailwind.cjs";
3
+ export { config as react, config$1 as tailwind };
@@ -0,0 +1,3 @@
1
+ import { config } from "./configs/react.mjs";
2
+ import { config as config$1 } from "./configs/flavour-tailwind.mjs";
3
+ export { config as react, config$1 as tailwind };
package/dist/index.mjs ADDED
@@ -0,0 +1,4 @@
1
+ import { config } from "./configs/react.mjs";
2
+ import { config as config$1 } from "./configs/flavour-tailwind.mjs";
3
+ import "./configs/index.mjs";
4
+ export { config as react, config$1 as tailwind };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abinnovision/eslint-config-react",
3
- "version": "3.1.0-beta.2",
3
+ "version": "3.1.1-beta.20",
4
4
  "publishConfig": {
5
5
  "npm": true,
6
6
  "ghpr": true,
@@ -18,19 +18,23 @@
18
18
  },
19
19
  "exports": {
20
20
  ".": {
21
- "types": "./dist/index.d.ts",
22
- "import": "./dist/index.js",
23
- "require": "./dist/index.cjs"
21
+ "import": {
22
+ "types": "./dist/index.d.mts",
23
+ "default": "./dist/index.mjs"
24
+ },
25
+ "require": {
26
+ "types": "./dist/index.d.cts",
27
+ "default": "./dist/index.cjs"
28
+ }
24
29
  }
25
30
  },
26
31
  "main": "./dist/index.cjs",
27
- "module": "./dist/index.js",
28
- "types": "./dist/index.d.ts",
32
+ "types": "./dist/index.d.cts",
29
33
  "files": [
30
34
  "dist/"
31
35
  ],
32
36
  "scripts": {
33
- "build": "tsup src/index.ts --dts --format esm,cjs --clean",
37
+ "build": "tsdown",
34
38
  "format:check": "prettier --check 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
35
39
  "format:fix": "prettier --write 'src/**/*.{ts,js}' '**/*.{md,json,json5,yaml,yml}'",
36
40
  "lint:check": "eslint 'src/**/*.{ts,js}'",
@@ -48,15 +52,16 @@
48
52
  "prettier": "@abinnovision/prettier-config",
49
53
  "dependencies": {
50
54
  "@eslint-react/eslint-plugin": "^2.13.0",
51
- "eslint-plugin-better-tailwindcss": "^4.3.0",
55
+ "eslint-plugin-better-tailwindcss": "^4.3.2",
52
56
  "eslint-plugin-react-hooks": "^7.0.1"
53
57
  },
54
58
  "devDependencies": {
55
- "@abinnovision/eslint-config-base": "^3.1.0-beta.2",
59
+ "@abinnovision/eslint-config-base": "^3.2.2",
56
60
  "@abinnovision/prettier-config": "^2.1.5",
61
+ "@internal/tsconfig": "^1.0.0",
57
62
  "eslint": "^9.39.1",
58
63
  "prettier": "^3.6.2",
59
- "tsup": "^8.3.6",
64
+ "tsdown": "^0.21.3",
60
65
  "typescript": "^5.9.3"
61
66
  },
62
67
  "peerDependencies": {
package/dist/index.d.ts DELETED
@@ -1,12 +0,0 @@
1
- import * as eslint_config from 'eslint/config';
2
-
3
- declare const config$1: eslint_config.Config[];
4
-
5
- /**
6
- * ESLint configuration for Tailwind CSS.
7
- *
8
- * Note that this configuration include stylistic rules.
9
- */
10
- declare const config: eslint_config.Config[];
11
-
12
- export { config$1 as react, config as tailwind };
package/dist/index.js DELETED
@@ -1,238 +0,0 @@
1
- // src/configs/react.ts
2
- import eslintReactPlugin from "@eslint-react/eslint-plugin";
3
- import { defineConfig } from "eslint/config";
4
- import eslintReactHooks from "eslint-plugin-react-hooks";
5
- var { configs: _, ...eslintReactHooksPlugin } = eslintReactHooks;
6
- var config = defineConfig([
7
- {
8
- files: ["**/*.{js,jsx,ts,tsx}"],
9
- plugins: {
10
- "react-hooks": eslintReactHooksPlugin
11
- },
12
- languageOptions: {
13
- parserOptions: { ecmaFeatures: { jsx: true } }
14
- },
15
- extends: [
16
- /**
17
- * ESLint React Recommended Configuration.
18
- * Includes x (renderer-agnostic), dom, and web-api rules.
19
- *
20
- * @see https://eslint-react.xyz/docs/configuration
21
- */
22
- eslintReactPlugin.configs.recommended
23
- ],
24
- rules: {
25
- /**
26
- * Enforce Rules of Hooks.
27
- *
28
- * @see https://react.dev/reference/react/hooks#rules-of-hooks
29
- */
30
- "react-hooks/rules-of-hooks": "error",
31
- /**
32
- * Verify dependencies array in hooks.
33
- *
34
- * @see https://react.dev/reference/react/hooks#rules-of-hooks
35
- */
36
- "react-hooks/exhaustive-deps": "warn",
37
- /**
38
- * Disallow dangerouslySetInnerHTML.
39
- *
40
- * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml
41
- */
42
- "@eslint-react/dom/no-dangerously-set-innerhtml": "error",
43
- /**
44
- * Disallow dangerouslySetInnerHTML with children.
45
- *
46
- * @see https://eslint-react.xyz/docs/rules/dom-no-dangerously-set-innerhtml-with-children
47
- */
48
- "@eslint-react/dom/no-dangerously-set-innerhtml-with-children": "error",
49
- /**
50
- * Disallow javascript: URLs.
51
- *
52
- * @see https://eslint-react.xyz/docs/rules/dom-no-script-url
53
- */
54
- "@eslint-react/dom/no-script-url": "error",
55
- /**
56
- * Enforce security attributes on target="_blank" links.
57
- *
58
- * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-target-blank
59
- */
60
- "@eslint-react/dom/no-unsafe-target-blank": "error",
61
- /**
62
- * Require sandbox attribute on iframes.
63
- *
64
- * @see https://eslint-react.xyz/docs/rules/dom-no-missing-iframe-sandbox
65
- */
66
- "@eslint-react/dom/no-missing-iframe-sandbox": "error",
67
- /**
68
- * Disallow unsafe iframe sandbox values.
69
- *
70
- * @see https://eslint-react.xyz/docs/rules/dom-no-unsafe-iframe-sandbox
71
- */
72
- "@eslint-react/dom/no-unsafe-iframe-sandbox": "error",
73
- /**
74
- * Prevent memory leaks from event listeners.
75
- *
76
- * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-event-listener
77
- */
78
- "@eslint-react/web-api/no-leaked-event-listener": "error",
79
- /**
80
- * Prevent memory leaks from intervals.
81
- *
82
- * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-interval
83
- */
84
- "@eslint-react/web-api/no-leaked-interval": "error",
85
- /**
86
- * Prevent memory leaks from timeouts.
87
- *
88
- * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-timeout
89
- */
90
- "@eslint-react/web-api/no-leaked-timeout": "error",
91
- /**
92
- * Prevent memory leaks from resize observers.
93
- *
94
- * @see https://eslint-react.xyz/docs/rules/web-api-no-leaked-resize-observer
95
- */
96
- "@eslint-react/web-api/no-leaked-resize-observer": "error",
97
- /**
98
- * Warn against using array indices as keys.
99
- *
100
- * @see https://eslint-react.xyz/docs/rules/no-array-index-key
101
- */
102
- "@eslint-react/no-array-index-key": "warn",
103
- /**
104
- * Prevent unstable nested component definitions.
105
- *
106
- * @see https://eslint-react.xyz/docs/rules/no-nested-component-definitions
107
- */
108
- "@eslint-react/no-nested-component-definitions": "error",
109
- /**
110
- * Warn against unstable context values.
111
- *
112
- * @see https://eslint-react.xyz/docs/rules/no-unstable-context-value
113
- */
114
- "@eslint-react/no-unstable-context-value": "warn",
115
- /**
116
- * Warn against unnecessary useCallback.
117
- *
118
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-callback
119
- */
120
- "@eslint-react/no-unnecessary-use-callback": "warn",
121
- /**
122
- * Warn against unnecessary useMemo.
123
- *
124
- * @see https://eslint-react.xyz/docs/rules/no-unnecessary-use-memo
125
- */
126
- "@eslint-react/no-unnecessary-use-memo": "warn",
127
- /**
128
- * Disallow duplicate props in JSX.
129
- *
130
- * @see https://eslint-react.xyz/docs/rules/jsx-no-duplicate-props
131
- */
132
- "@eslint-react/jsx-no-duplicate-props": "error",
133
- /**
134
- * Disallow undefined components in JSX.
135
- *
136
- * @see https://eslint-react.xyz/docs/rules/jsx-no-undef
137
- */
138
- "@eslint-react/jsx-no-undef": "error",
139
- /**
140
- * Require keys for array elements.
141
- *
142
- * @see https://eslint-react.xyz/docs/rules/no-missing-key
143
- */
144
- "@eslint-react/no-missing-key": "error",
145
- /**
146
- * Disallow children prop.
147
- *
148
- * @see https://eslint-react.xyz/docs/rules/no-children-prop
149
- */
150
- "@eslint-react/no-children-prop": "error",
151
- /**
152
- * Disallow direct state mutation.
153
- *
154
- * @see https://eslint-react.xyz/docs/rules/no-direct-mutation-state
155
- */
156
- "@eslint-react/no-direct-mutation-state": "error",
157
- /**
158
- * Disallow string refs.
159
- *
160
- * @see https://eslint-react.xyz/docs/rules/no-string-refs
161
- */
162
- "@eslint-react/no-string-refs": "error",
163
- /**
164
- * Disallow findDOMNode.
165
- *
166
- * @see https://eslint-react.xyz/docs/rules/dom-no-find-dom-node
167
- */
168
- "@eslint-react/dom/no-find-dom-node": "error"
169
- }
170
- }
171
- ]);
172
-
173
- // src/configs/flavour-tailwind.ts
174
- import { defineConfig as defineConfig2 } from "eslint/config";
175
- import betterTailwindcss from "eslint-plugin-better-tailwindcss";
176
- var config2 = defineConfig2([
177
- {
178
- files: ["**/*.{js,jsx,ts,tsx}"],
179
- plugins: {
180
- "better-tailwindcss": betterTailwindcss
181
- },
182
- rules: {
183
- /**
184
- * Enforce consistent line wrapping.
185
- *
186
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
187
- */
188
- "better-tailwindcss/enforce-consistent-line-wrapping": [
189
- "warn",
190
- // Prefer single line when possible. We use tabs for indentation.
191
- { preferSingleLine: true, indent: "tab" }
192
- ],
193
- /**
194
- * Enforce consistent class order.
195
- *
196
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
197
- */
198
- "better-tailwindcss/enforce-consistent-class-order": "warn",
199
- /**
200
- * Enforce shorthand classes.
201
- *
202
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
203
- */
204
- "better-tailwindcss/enforce-shorthand-classes": "warn",
205
- /**
206
- * Remove duplicate classes.
207
- *
208
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
209
- */
210
- "better-tailwindcss/no-duplicate-classes": "warn",
211
- /**
212
- * Disallow unnecessary whitespace.
213
- *
214
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
215
- */
216
- "better-tailwindcss/no-unnecessary-whitespace": "warn",
217
- /**
218
- * Report unregistered classes.
219
- *
220
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
221
- */
222
- "better-tailwindcss/no-unknown-classes": [
223
- "warn",
224
- { detectComponentClasses: true }
225
- ],
226
- /**
227
- * Report conflicting classes.
228
- *
229
- * @see https://github.com/schoero/eslint-plugin-better-tailwindcss
230
- */
231
- "better-tailwindcss/no-conflicting-classes": "error"
232
- }
233
- }
234
- ]);
235
- export {
236
- config as react,
237
- config2 as tailwind
238
- };