@szum-tech/eslint-config 2.1.14 → 2.1.16

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
@@ -19,11 +19,16 @@
19
19
  A shared configuration is an NPM package that exports a configuration as an array. It's super convenient for anyone to
20
20
  use, because the configuration dynamically adapts to the needs of the project.
21
21
 
22
+ **✨ Ready for ESLint v10!** This configuration uses the modern flat config format and is compatible with ESLint v9.x. Full ESLint v10 support will be added once the ecosystem plugins (especially typescript-eslint) release compatible versions.
23
+
22
24
  ## 📚 Features
23
25
 
24
- - [Opinionated code formatter with support for: JavaScript, Typescript, JSX, ...](https://eslint.org/)
26
+ - **[ESLint v9](https://eslint.org/)** - Latest stable version with full plugin ecosystem support (ready for v10 migration)
27
+ - **Flat Config Format** - Uses the modern `eslint.config.js` format (legacy `.eslintrc` is not supported)
28
+ - **Auto-detection** - Automatically enables plugins based on your project dependencies
29
+ - [Opinionated code formatter with support for: JavaScript, TypeScript, JSX, ...](https://eslint.org/)
25
30
  - [Support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names](https://www.npmjs.com/package/eslint-plugin-import)
26
- - [Typescript support](https://typescript-eslint.io/packages/typescript-eslint/) - **only** if
31
+ - [TypeScript support](https://typescript-eslint.io/packages/typescript-eslint/) - **only** if
27
32
  [typescript](https://www.npmjs.com/package/typescript) is used in project
28
33
  - [React](https://www.npmjs.com/package/eslint-plugin-react) &
29
34
  [React Hooks](https://www.npmjs.com/package/eslint-plugin-react-hooks) specific linting rules - **only** if
@@ -67,52 +72,56 @@ use, because the configuration dynamically adapts to the needs of the project.
67
72
  [@szum-tech/eslint-config](https://github.com/JanSzewczyk/eslint-config) is available as
68
73
  [npm package](https://www.npmjs.com/package/@szum-tech/eslint-config).
69
74
 
75
+ **Requirements:**
76
+ - **ESLint** v9.0.0 or higher
77
+ - **Node.js** v20.x+ / v22.x+ / v24.x+
78
+
70
79
  ```shell
71
80
  # NPM
72
- npm install --save-dev eslint @szum-tech/eslint-config
81
+ npm install --save-dev eslint@latest @szum-tech/eslint-config
73
82
 
74
83
  # YARN
75
- yarn add -D eslint @szum-tech/eslint-config
84
+ yarn add -D eslint@latest @szum-tech/eslint-config
76
85
 
77
86
  # PNPM
78
- pnpm add --save-dev eslint @szum-tech/eslint-config
87
+ pnpm add --save-dev eslint@latest @szum-tech/eslint-config
79
88
 
80
89
  # BUN
81
- bun add --dev eslint @szum-tech/eslint-config
90
+ bun add --dev eslint@latest @szum-tech/eslint-config
82
91
  ```
83
92
 
84
93
  ### Configuration
85
94
 
86
- Basic information needed to understand, how to set up eslint configuration, you are able to find in
87
- [Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files) documentation.
88
-
89
- A `@szum-tech/eslint-config` is an npm package that exports a configuration object or array.
95
+ This package uses the [ESLint Flat Config format](https://eslint.org/docs/latest/use/configure/configuration-files)
96
+ introduced in ESLint v9 and required in ESLint v10. The legacy `.eslintrc` format is not supported.
90
97
 
91
- **`@szum-tech/eslint-config` could be set via either:**
98
+ A `@szum-tech/eslint-config` is an npm package that exports a configuration array that automatically adapts to your
99
+ project's dependencies.
92
100
 
93
- - A `eslint.config.(js|cjs|mjs)` file that exports an array
101
+ **Configuration file: `eslint.config.(js|cjs|mjs)`**
94
102
 
95
- **The following examples show how to integrate configuration in project:**
103
+ #### Simple Usage
96
104
 
97
- - Via `eslint.config.mjs` file:
98
-
99
- Once you use a predefined configuration, you can export the entire configuration.
105
+ Export the entire configuration as-is:
100
106
 
101
107
  ```js
108
+ // eslint.config.mjs
102
109
  export { default } from "@szum-tech/eslint-config";
103
110
  ```
104
111
 
105
- `@szum-tech/eslint-config` is flexible enough to allow for configuration extensions. You’ll need to use the spread
106
- operator to insert those items into the configuration array.
112
+ #### Extended Configuration
113
+
114
+ `@szum-tech/eslint-config` is flexible enough to allow for configuration extensions. Use the spread operator to insert
115
+ the configuration into your array:
107
116
 
108
117
  ```js
109
- // eslint.config.js
118
+ // eslint.config.mjs
110
119
  import szumTechEslintConfig from "@szum-tech/eslint-config";
111
120
 
112
121
  export default [
113
122
  ...szumTechEslintConfig,
114
123
 
115
- // your modifications
124
+ // Your custom modifications
116
125
  {
117
126
  rules: {
118
127
  "no-unused-vars": "warn"
@@ -121,21 +130,18 @@ export default [
121
130
  ];
122
131
  ```
123
132
 
124
- - Via `eslint.config.cjs` file:
133
+ #### CommonJS Format
125
134
 
126
- ```js
127
- module.exports = require("@szum-tech/semantic-release-config/with-npm");
128
- ```
129
-
130
- OR, extends
135
+ For projects using CommonJS:
131
136
 
132
137
  ```js
133
- const szumTechEslintConfig = require("@szum-tech/semantic-release-config/with-npm");
138
+ // eslint.config.cjs
139
+ const szumTechEslintConfig = require("@szum-tech/eslint-config");
134
140
 
135
141
  module.exports = [
136
142
  ...szumTechEslintConfig,
137
143
 
138
- // your modifications
144
+ // Your custom modifications
139
145
  {
140
146
  rules: {
141
147
  "no-unused-vars": "warn"
@@ -144,6 +150,9 @@ module.exports = [
144
150
  ];
145
151
  ```
146
152
 
153
+ > **Note:** The configuration automatically detects which libraries are installed in your project (React, TypeScript,
154
+ > Next.js, Vitest, etc.) and enables the appropriate ESLint plugins and rules.
155
+
147
156
  ## 💻 Scripts
148
157
 
149
158
  Suggested scripts you can add to `package.json` file:
@@ -168,11 +177,11 @@ Suggested scripts you can add to `package.json` file:
168
177
  - `lint:inspect`: Launches a visual representation of the ESLint configuration file (check http://localhost:7777 in your
169
178
  browser). Allows you to navigate through the rules, plugins, and language configurations that are enabled or disabled
170
179
 
171
- ## 🚀 Minimal GitHub ESlint check workflow
180
+ ## 🚀 Minimal GitHub ESLint check workflow
172
181
 
173
- Here are the minimal steps required to run an ESlint check. Creating or adding any content to a PR will trigger this
182
+ Here are the minimal steps required to run an ESLint check. Creating or adding any content to a PR will trigger this
174
183
  event. Not only will this action validate the code and return its results, but it will also add highlighted parts of the
175
- code that have an error to the comments under the PR thanks to the `Upload Eslint results to GitHub` step, which uses
184
+ code that have an error to the comments under the PR thanks to the `Upload ESLint results to GitHub` step, which uses
176
185
  `github/codeql-action/upload-sarif`.
177
186
 
178
187
  ```yaml
@@ -183,11 +192,11 @@ on:
183
192
 
184
193
  jobs:
185
194
  lint:
186
- name: ESlint
195
+ name: ESLint
187
196
  runs-on: ${{ matrix.os }}
188
197
  strategy:
189
198
  matrix:
190
- node-version: [22.x]
199
+ node-version: [24.x] # Use Node.js 20+, 22+, or 24+
191
200
  os: [ubuntu-latest]
192
201
  steps:
193
202
  - name: Checkout code 📚
@@ -199,10 +208,10 @@ jobs:
199
208
  cache: "npm"
200
209
  - name: Install dependencies ⚙️
201
210
  run: npm ci
202
- - name: ESlint Check ⬣
211
+ - name: ESLint Check ⬣
203
212
  run: npm run lint:ci
204
213
  continue-on-error: true
205
- - name: Upload ESlint results to GitHub
214
+ - name: Upload ESLint results to GitHub
206
215
  uses: github/codeql-action/upload-sarif@v3
207
216
  with:
208
217
  sarif_file: eslint-results.sarif
package/dist/index.cjs CHANGED
@@ -8,7 +8,7 @@ var playwrightPlugin = require('eslint-plugin-playwright');
8
8
  var reactPlugin = require('eslint-plugin-react');
9
9
  var reactHooksPlugin = require('eslint-plugin-react-hooks');
10
10
  var storybookPlugin = require('eslint-plugin-storybook');
11
- var tailwindcssPlugin = require('eslint-plugin-tailwindcss');
11
+ require('eslint-plugin-tailwindcss');
12
12
  var testingLibraryPlugin = require('eslint-plugin-testing-library');
13
13
  var globals = require('globals');
14
14
  var tsEslint = require('typescript-eslint');
@@ -41,7 +41,6 @@ var playwrightPlugin__default = /*#__PURE__*/_interopDefault(playwrightPlugin);
41
41
  var reactPlugin__default = /*#__PURE__*/_interopDefault(reactPlugin);
42
42
  var reactHooksPlugin__namespace = /*#__PURE__*/_interopNamespace(reactHooksPlugin);
43
43
  var storybookPlugin__default = /*#__PURE__*/_interopDefault(storybookPlugin);
44
- var tailwindcssPlugin__default = /*#__PURE__*/_interopDefault(tailwindcssPlugin);
45
44
  var testingLibraryPlugin__default = /*#__PURE__*/_interopDefault(testingLibraryPlugin);
46
45
  var globals__default = /*#__PURE__*/_interopDefault(globals);
47
46
  var tsEslint__default = /*#__PURE__*/_interopDefault(tsEslint);
@@ -81,7 +80,6 @@ function findPackageJson(startDir) {
81
80
  return null;
82
81
  }
83
82
  var hasTypeScript = isPackageInstalled("typescript");
84
- var hasTailwindcss = isPackageInstalled("tailwindcss");
85
83
  var hasReact = isPackageInstalled("react");
86
84
  var hasNext = isPackageInstalled("next");
87
85
  var hasTestingLibrary = isPackageInstalled("@testing-library/dom");
@@ -260,29 +258,7 @@ var config = [
260
258
  "react-hooks/exhaustive-deps": WARN
261
259
  }
262
260
  } : null,
263
- hasTailwindcss ? {
264
- name: "eslint/config/tailwindcss",
265
- plugins: {
266
- tailwindcss: tailwindcssPlugin__default.default
267
- },
268
- languageOptions: {
269
- parserOptions: {
270
- ecmaFeatures: {
271
- jsx: true
272
- }
273
- }
274
- },
275
- rules: {
276
- "tailwindcss/no-contradicting-classname": ERROR,
277
- "tailwindcss/classnames-order": WARN,
278
- "tailwindcss/enforces-negative-arbitrary-values": WARN,
279
- "tailwindcss/enforces-shorthand": WARN,
280
- "tailwindcss/migration-from-tailwind-2": WARN,
281
- "tailwindcss/no-custom-classname": WARN,
282
- "tailwindcss/no-unnecessary-arbitrary-value": WARN,
283
- "tailwindcss/no-arbitrary-value": OFF
284
- }
285
- } : null,
261
+ null,
286
262
  hasNext ? {
287
263
  name: "eslint/config/next",
288
264
  files: ["**/*.ts?(x)", "**/*.js?(x)"],
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import playwrightPlugin from 'eslint-plugin-playwright';
6
6
  import reactPlugin from 'eslint-plugin-react';
7
7
  import * as reactHooksPlugin from 'eslint-plugin-react-hooks';
8
8
  import storybookPlugin from 'eslint-plugin-storybook';
9
- import tailwindcssPlugin from 'eslint-plugin-tailwindcss';
9
+ import 'eslint-plugin-tailwindcss';
10
10
  import testingLibraryPlugin from 'eslint-plugin-testing-library';
11
11
  import globals from 'globals';
12
12
  import tsEslint from 'typescript-eslint';
@@ -46,7 +46,6 @@ function findPackageJson(startDir) {
46
46
  return null;
47
47
  }
48
48
  var hasTypeScript = isPackageInstalled("typescript");
49
- var hasTailwindcss = isPackageInstalled("tailwindcss");
50
49
  var hasReact = isPackageInstalled("react");
51
50
  var hasNext = isPackageInstalled("next");
52
51
  var hasTestingLibrary = isPackageInstalled("@testing-library/dom");
@@ -225,29 +224,7 @@ var config = [
225
224
  "react-hooks/exhaustive-deps": WARN
226
225
  }
227
226
  } : null,
228
- hasTailwindcss ? {
229
- name: "eslint/config/tailwindcss",
230
- plugins: {
231
- tailwindcss: tailwindcssPlugin
232
- },
233
- languageOptions: {
234
- parserOptions: {
235
- ecmaFeatures: {
236
- jsx: true
237
- }
238
- }
239
- },
240
- rules: {
241
- "tailwindcss/no-contradicting-classname": ERROR,
242
- "tailwindcss/classnames-order": WARN,
243
- "tailwindcss/enforces-negative-arbitrary-values": WARN,
244
- "tailwindcss/enforces-shorthand": WARN,
245
- "tailwindcss/migration-from-tailwind-2": WARN,
246
- "tailwindcss/no-custom-classname": WARN,
247
- "tailwindcss/no-unnecessary-arbitrary-value": WARN,
248
- "tailwindcss/no-arbitrary-value": OFF
249
- }
250
- } : null,
227
+ null,
251
228
  hasNext ? {
252
229
  name: "eslint/config/next",
253
230
  files: ["**/*.ts?(x)", "**/*.js?(x)"],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@szum-tech/eslint-config",
3
- "version": "2.1.14",
3
+ "version": "2.1.16",
4
4
  "description": "ESLint configuration for TypeScript projects",
5
5
  "keywords": [
6
6
  "eslint",
@@ -35,31 +35,31 @@
35
35
  "prettier:write": "prettier --write ."
36
36
  },
37
37
  "dependencies": {
38
- "@next/eslint-plugin-next": "^16.0.4",
39
- "@vitest/eslint-plugin": "^1.6.6",
38
+ "@next/eslint-plugin-next": "^16.1.6",
39
+ "@vitest/eslint-plugin": "^1.6.7",
40
40
  "eslint-import-resolver-typescript": "^4.4.4",
41
41
  "eslint-plugin-import": "^2.32.0",
42
42
  "eslint-plugin-jest-dom": "^5.4.0",
43
- "eslint-plugin-playwright": "^2.2.1",
43
+ "eslint-plugin-playwright": "^2.5.1",
44
44
  "eslint-plugin-react": "^7.37.5",
45
45
  "eslint-plugin-react-hooks": "^7.0.1",
46
- "eslint-plugin-storybook": "^10.0.8",
46
+ "eslint-plugin-storybook": "^10.2.8",
47
47
  "eslint-plugin-tailwindcss": "^4.0.0-beta.0",
48
48
  "eslint-plugin-testing-library": "^7.13.5",
49
- "globals": "^17.0.0",
50
- "typescript-eslint": "^8.52.0"
49
+ "globals": "^17.3.0",
50
+ "typescript-eslint": "^8.55.0"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@szum-tech/prettier-config": "^1.6.2",
54
- "@szum-tech/semantic-release-config": "^2.3.5",
55
- "eslint": "^9.32.0",
56
- "prettier": "^3.6.2",
57
- "semantic-release": "^25.0.2",
54
+ "@szum-tech/semantic-release-config": "^2.3.7",
55
+ "eslint": "^9.39.2",
56
+ "prettier": "^3.8.1",
57
+ "semantic-release": "^25.0.3",
58
58
  "tsup": "^8.5.0",
59
59
  "typescript": "^5.8.3"
60
60
  },
61
61
  "peerDependencies": {
62
- "eslint": ">=9.32"
62
+ "eslint": ">=9.0.0"
63
63
  },
64
64
  "publishConfig": {
65
65
  "access": "public"