eslint-config-conventions 20.1.1 β†’ 20.1.3

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.
Files changed (3) hide show
  1. package/.oxlintrc.json +102 -14
  2. package/README.md +13 -4
  3. package/package.json +28 -8
package/.oxlintrc.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "$schema": "./node_modules/oxlint/configuration_schema.json",
3
- "plugins": ["promise", "unicorn", "import"],
3
+ "plugins": ["typescript", "unicorn", "react", "oxc", "promise"],
4
4
  "categories": {
5
- "correctness": "off"
5
+ "correctness": "error",
6
+ "perf": "error",
7
+ "suspicious": "error"
6
8
  },
7
9
  "env": {
8
10
  "builtin": true,
9
- "es2025": true,
10
11
  "browser": true,
11
- "commonjs": true,
12
12
  "node": true,
13
13
  "shared-node-browser": true
14
14
  },
15
15
  "rules": {
16
+ "no-await-in-loop": "off",
16
17
  "for-direction": "error",
17
18
  "no-async-promise-executor": "error",
18
19
  "no-class-assign": "error",
@@ -159,6 +160,7 @@
159
160
  "yoda": ["error", "never"],
160
161
  "curly": ["error", "all"],
161
162
  "func-style": ["error", "expression"],
163
+ "arrow-body-style": ["error", "always"],
162
164
  "promise/param-names": "error",
163
165
  "promise/no-new-statics": "error",
164
166
  "promise/no-nesting": "error",
@@ -190,19 +192,61 @@
190
192
  "unicorn/no-unnecessary-array-flat-depth": "error",
191
193
  "unicorn/consistent-assert": "error",
192
194
  "unicorn/no-accessor-recursion": "error",
193
- "import-x/no-absolute-path": "error",
194
- "import-x/no-webpack-loader-syntax": "error",
195
- "import-x/no-self-import": "error",
196
- "import-x/no-duplicates": "error",
197
- "import-x/no-named-default": "error",
198
- "import-x/no-empty-named-blocks": "error",
199
- "import-x/no-anonymous-default-export": "error",
200
- "import-x/consistent-type-specifier-style": ["error", "prefer-top-level"]
195
+ "react/no-array-index-key": "off",
196
+ "react-hooks/rules-of-hooks": "error",
197
+ "react-hooks/exhaustive-deps": "error",
198
+ "react/jsx-key": "error",
199
+ "react/jsx-no-comment-textnodes": "error",
200
+ "react/jsx-no-duplicate-props": "error",
201
+ "react/jsx-no-target-blank": "off",
202
+ "react/jsx-no-undef": "error",
203
+ "react/no-children-prop": "error",
204
+ "react/no-danger-with-children": "error",
205
+ "react/no-direct-mutation-state": "error",
206
+ "react/no-find-dom-node": "error",
207
+ "react/no-is-mounted": "error",
208
+ "react/no-render-return-value": "error",
209
+ "react/no-string-refs": "error",
210
+ "react/no-unescaped-entities": "error",
211
+ "react/no-unknown-property": "off",
212
+ "react/react-in-jsx-scope": "off",
213
+ "react/iframe-missing-sandbox": "off",
214
+ "react/self-closing-comp": [
215
+ "error",
216
+ {
217
+ "component": true,
218
+ "html": true
219
+ }
220
+ ],
221
+ "react/void-dom-elements-no-children": "error",
222
+ "react/jsx-boolean-value": "error",
223
+ "@next/next/google-font-display": "error",
224
+ "@next/next/google-font-preconnect": "error",
225
+ "@next/next/next-script-for-ga": "error",
226
+ "@next/next/no-async-client-component": "error",
227
+ "@next/next/no-before-interactive-script-outside-document": "error",
228
+ "@next/next/no-css-tags": "error",
229
+ "@next/next/no-head-element": "error",
230
+ "@next/next/no-html-link-for-pages": "off",
231
+ "@next/next/no-img-element": "off",
232
+ "@next/next/no-page-custom-font": "error",
233
+ "@next/next/no-styled-jsx-in-document": "error",
234
+ "@next/next/no-sync-scripts": "error",
235
+ "@next/next/no-title-in-document-head": "error",
236
+ "@next/next/no-typos": "error",
237
+ "@next/next/no-unwanted-polyfillio": "error",
238
+ "@next/next/inline-script-id": "error",
239
+ "@next/next/no-assign-module-variable": "error",
240
+ "@next/next/no-document-import-in-page": "error",
241
+ "@next/next/no-duplicate-head": "error",
242
+ "@next/next/no-head-import-in-document": "error",
243
+ "@next/next/no-script-component-in-head": "error"
201
244
  },
202
245
  "overrides": [
203
246
  {
204
247
  "files": ["**/*.ts", "**/*.tsx"],
205
248
  "rules": {
249
+ "@typescript-eslint/no-unnecessary-type-arguments": "off",
206
250
  "no-unused-vars": [
207
251
  "error",
208
252
  {
@@ -215,6 +259,7 @@
215
259
  "ignoreRestSiblings": true
216
260
  }
217
261
  ],
262
+ "@typescript-eslint/no-implied-eval": "error",
218
263
  "no-redeclare": [
219
264
  "error",
220
265
  {
@@ -222,6 +267,7 @@
222
267
  }
223
268
  ],
224
269
  "no-throw-literal": "off",
270
+ "@typescript-eslint/only-throw-error": "error",
225
271
  "no-unused-expressions": [
226
272
  "error",
227
273
  {
@@ -230,6 +276,7 @@
230
276
  "allowTaggedTemplates": true
231
277
  }
232
278
  ],
279
+ "@typescript-eslint/no-unnecessary-template-expression": "error",
233
280
  "@typescript-eslint/adjacent-overload-signatures": "error",
234
281
  "@typescript-eslint/no-unsafe-function-type": "error",
235
282
  "@typescript-eslint/no-wrapper-object-types": "error",
@@ -248,14 +295,29 @@
248
295
  "allowDirectConstAssertionInArrowFunctions": true
249
296
  }
250
297
  ],
251
- "@typescript-eslint/no-dynamic-delete": "error",
298
+ "@typescript-eslint/no-base-to-string": "error",
299
+ "@typescript-eslint/no-dynamic-delete": "off",
252
300
  "@typescript-eslint/no-extra-non-null-assertion": "error",
301
+ "@typescript-eslint/no-redundant-type-constituents": "error",
253
302
  "@typescript-eslint/no-extraneous-class": [
254
303
  "error",
255
304
  {
256
305
  "allowWithDecorator": true
257
306
  }
258
307
  ],
308
+ "@typescript-eslint/no-floating-promises": [
309
+ "error",
310
+ {
311
+ "allowForKnownSafeCalls": [
312
+ {
313
+ "from": "package",
314
+ "name": ["test", "it", "suite", "describe"],
315
+ "package": "node:test"
316
+ }
317
+ ]
318
+ }
319
+ ],
320
+ "@typescript-eslint/no-for-in-array": "error",
259
321
  "@typescript-eslint/no-misused-new": "error",
260
322
  "@typescript-eslint/no-non-null-asserted-optional-chain": "error",
261
323
  "@typescript-eslint/no-non-null-assertion": "error",
@@ -265,11 +327,37 @@
265
327
  "allowDestructuring": true
266
328
  }
267
329
  ],
330
+ "@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
331
+ "@typescript-eslint/no-unnecessary-type-assertion": "error",
268
332
  "@typescript-eslint/no-require-imports": "error",
333
+ "@typescript-eslint/no-unsafe-unary-minus": "error",
269
334
  "@typescript-eslint/no-unsafe-declaration-merging": "error",
335
+ "@typescript-eslint/no-array-delete": "error",
270
336
  "@typescript-eslint/prefer-as-const": "error",
271
337
  "@typescript-eslint/prefer-function-type": "error",
272
- "prefer-promise-reject-errors": "off"
338
+ "@typescript-eslint/prefer-reduce-type-parameter": "error",
339
+ "@typescript-eslint/prefer-return-this-type": "error",
340
+ "@typescript-eslint/promise-function-async": "error",
341
+ "prefer-promise-reject-errors": "off",
342
+ "@typescript-eslint/prefer-promise-reject-errors": "error",
343
+ "@typescript-eslint/require-array-sort-compare": [
344
+ "error",
345
+ {
346
+ "ignoreStringArrays": true
347
+ }
348
+ ],
349
+ "@typescript-eslint/restrict-plus-operands": [
350
+ "error",
351
+ {
352
+ "skipCompoundAssignments": true
353
+ }
354
+ ],
355
+ "@typescript-eslint/restrict-template-expressions": [
356
+ "error",
357
+ {
358
+ "allowNumber": true
359
+ }
360
+ ]
273
361
  },
274
362
  "plugins": ["typescript"]
275
363
  }
package/README.md CHANGED
@@ -17,7 +17,7 @@
17
17
  <a href="https://www.npmjs.com/package/eslint-config-conventions"><img src="https://img.shields.io/npm/v/eslint-config-conventions.svg" alt="npm version"></a>
18
18
  </p>
19
19
 
20
- ## πŸ“œ About
20
+ ## About
21
21
 
22
22
  **eslint-config-conventions** is a [ESLint](https://eslint.org) configuration to enforce strict conventions and good code quality. It supports both **JavaScript** and **TypeScript**.
23
23
 
@@ -25,7 +25,7 @@ This configuration is mostly **for catching bugs** and **code-quality** so it is
25
25
 
26
26
  More information about **formatting rules** vs **code-quality rules** can be found on [Prettier vs. Linters](https://prettier.io/docs/en/comparison.html).
27
27
 
28
- ## βš™οΈ Getting Started
28
+ ## Getting Started
29
29
 
30
30
  ### Prerequisites
31
31
 
@@ -113,12 +113,21 @@ node --run lint:eslint -- --fix
113
113
  node --run lint:prettier
114
114
  ```
115
115
 
116
- ## πŸ’‘ Contributing
116
+ ### `.oxlintrc.json` (if using [oxlint](https://oxc.rs/))
117
+
118
+ ```json
119
+ {
120
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
121
+ "extends": ["node_modules/eslint-config-conventions/.oxlintrc.json"]
122
+ }
123
+ ```
124
+
125
+ ## Contributing
117
126
 
118
127
  Anyone can help to improve the project, submit a Feature Request, a bug report or even correct a simple spelling mistake.
119
128
 
120
129
  The steps to contribute can be found in the [CONTRIBUTING.md](./CONTRIBUTING.md) file.
121
130
 
122
- ## πŸ“„ License
131
+ ## License
123
132
 
124
133
  [MIT](./LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-config-conventions",
3
- "version": "20.1.1",
3
+ "version": "20.1.3",
4
4
  "public": true,
5
5
  "description": "ESLint shareable config to enforce strict conventions and good code quality.",
6
6
  "author": "ThΓ©o LUDWIG <contact@theoludwig.fr>",
@@ -41,7 +41,7 @@
41
41
  "lint:editorconfig": "editorconfig-checker",
42
42
  "lint:eslint": "eslint . --max-warnings 0 --config eslint.config.mjs",
43
43
  "lint:prettier": "prettier . --check",
44
- "oxlint:migrate": "npx @oxlint/migrate",
44
+ "oxlint:migrate": "npx @oxlint/migrate@latest eslint.config.js --type-aware",
45
45
  "inspect": "eslint --inspect-config",
46
46
  "test": "node --test",
47
47
  "release": "semantic-release"
@@ -54,19 +54,39 @@
54
54
  "globals": "^16.0.0",
55
55
  "typescript-eslint": "^8.32.0"
56
56
  },
57
+ "peerDependenciesMeta": {
58
+ "eslint": {
59
+ "optional": true
60
+ },
61
+ "eslint-plugin-promise": {
62
+ "optional": true
63
+ },
64
+ "eslint-plugin-unicorn": {
65
+ "optional": true
66
+ },
67
+ "eslint-plugin-import-x": {
68
+ "optional": true
69
+ },
70
+ "globals": {
71
+ "optional": true
72
+ },
73
+ "typescript-eslint": {
74
+ "optional": true
75
+ }
76
+ },
57
77
  "devDependencies": {
58
- "@types/node": "24.1.0",
78
+ "@types/node": "24.3.0",
59
79
  "globals": "16.3.0",
60
80
  "editorconfig-checker": "6.1.0",
61
- "oxlint": "1.8.0",
62
- "@oxlint/migrate": "1.8.0",
63
- "eslint": "9.31.0",
81
+ "oxlint": "1.13.0",
82
+ "@oxlint/migrate": "1.13.0",
83
+ "eslint": "9.34.0",
64
84
  "eslint-plugin-promise": "7.2.1",
65
85
  "eslint-plugin-unicorn": "60.0.0",
66
86
  "eslint-plugin-import-x": "4.16.1",
67
- "typescript-eslint": "8.38.0",
87
+ "typescript-eslint": "8.41.0",
68
88
  "prettier": "3.6.2",
69
89
  "semantic-release": "24.2.7",
70
- "typescript": "5.8.3"
90
+ "typescript": "5.9.2"
71
91
  }
72
92
  }