@nihalgonsalves/esconfig 0.13.5 → 0.14.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/.oxlintrc.json ADDED
@@ -0,0 +1,288 @@
1
+ {
2
+ "$schema": "./node_modules/oxlint/configuration_schema.json",
3
+ "categories": {
4
+ "correctness": "error",
5
+ "suspicious": "error"
6
+ },
7
+ "env": {
8
+ "builtin": true
9
+ },
10
+ "overrides": [
11
+ {
12
+ "files": ["**/*.config.*"],
13
+ "rules": {
14
+ "import/no-default-export": "off"
15
+ }
16
+ }
17
+ ],
18
+ "plugins": ["typescript", "import", "unicorn"],
19
+ "rules": {
20
+ // 2026-02-16 migration from eslint skipped 15 unsupported rules
21
+ // - import/no-extraneous-dependencies: [
22
+ // "error",
23
+ // {
24
+ // devDependencies: [
25
+ // "test/**",
26
+ // "tests/**",
27
+ // "spec/**",
28
+ // "**/__tests__/**",
29
+ // "**/__mocks__/**",
30
+ // "test.{js,jsx}",
31
+ // "test.{ts,tsx}",
32
+ // "test-*.{js,jsx}",
33
+ // "test-*.{ts,tsx}",
34
+ // "**/*{.,_}{test,spec}.{js,jsx}",
35
+ // "**/*{.,_}{test,spec}.{ts,tsx}",
36
+ // "**/*.config.{js,ts,cjs,mjs,cts,mts}",
37
+ // "**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)",
38
+ // ],
39
+ // optionalDependencies: false,
40
+ // },
41
+ // ],
42
+ // - no-octal
43
+ // - object-shorthand
44
+ // - typescript/dot-notation
45
+ // - typescript/method-signature-style
46
+ // - typescript/naming-convention
47
+ // - typescript/no-unnecessary-type-conversion
48
+ // - typescript/no-unnecessary-type-parameters
49
+ // - typescript/no-useless-default-assignment
50
+ // - typescript/prefer-find
51
+ // - typescript/prefer-regexp-exec
52
+ // - typescript/prefer-string-starts-ends-with
53
+ "arrow-body-style": "error",
54
+ "class-methods-use-this": "error",
55
+ "default-param-last": ["error"],
56
+ "for-direction": "error",
57
+ "func-style": ["error", "expression"],
58
+ "import/extensions": [
59
+ "error",
60
+ "ignorePackages",
61
+ {
62
+ "js": "never",
63
+ "jsx": "never",
64
+ "mjs": "never",
65
+ "ts": "never",
66
+ "tsx": "never"
67
+ }
68
+ ],
69
+ "import/no-default-export": ["error"],
70
+ "import/no-duplicates": [
71
+ "error",
72
+ {
73
+ "prefer-inline": true
74
+ }
75
+ ],
76
+ "no-array-constructor": "error",
77
+ "no-async-promise-executor": "error",
78
+ "no-case-declarations": "error",
79
+ "no-compare-neg-zero": "error",
80
+ "no-cond-assign": "error",
81
+ "no-constant-binary-expression": "error",
82
+ "no-constant-condition": "error",
83
+ "no-control-regex": "error",
84
+ "no-debugger": "error",
85
+ "no-delete-var": "error",
86
+ "no-dupe-else-if": "error",
87
+ "no-duplicate-case": "error",
88
+ "no-empty": "error",
89
+ "no-empty-character-class": "error",
90
+ "no-empty-function": "error",
91
+ "no-empty-pattern": "error",
92
+ "no-empty-static-block": "error",
93
+ "no-ex-assign": "error",
94
+ "no-extra-boolean-cast": "error",
95
+ "no-fallthrough": "error",
96
+ "no-global-assign": "error",
97
+ "no-invalid-regexp": "error",
98
+ "no-irregular-whitespace": "error",
99
+ "no-loop-func": ["error"],
100
+ "no-loss-of-precision": "error",
101
+ "no-misleading-character-class": "error",
102
+ "no-nonoctal-decimal-escape": "error",
103
+ "no-prototype-builtins": "error",
104
+ "no-regex-spaces": "error",
105
+ "no-self-assign": "error",
106
+ "no-shadow": ["error"],
107
+ "no-shadow-restricted-names": "error",
108
+ "no-sparse-arrays": "error",
109
+ "no-unsafe-finally": "error",
110
+ "no-unsafe-optional-chaining": "error",
111
+ "no-unused-expressions": [
112
+ "error",
113
+ {
114
+ "allowShortCircuit": false,
115
+ "allowTaggedTemplates": false,
116
+ "allowTernary": false,
117
+ "enforceForJSX": false
118
+ }
119
+ ],
120
+ "no-unused-labels": "error",
121
+ "no-unused-private-class-members": "error",
122
+ "no-unused-vars": [
123
+ "error",
124
+ {
125
+ "args": "after-used",
126
+ "argsIgnorePattern": "^_",
127
+ "ignoreRestSiblings": true,
128
+ "vars": "all"
129
+ }
130
+ ],
131
+ "no-use-before-define": [
132
+ "error",
133
+ {
134
+ "classes": true,
135
+ "functions": true,
136
+ "variables": true
137
+ }
138
+ ],
139
+ "no-useless-backreference": "error",
140
+ "no-useless-catch": "error",
141
+ "no-useless-constructor": "error",
142
+ "no-useless-escape": "error",
143
+ "no-useless-rename": "error",
144
+ "no-var": "error",
145
+ "prefer-const": "error",
146
+ "prefer-rest-params": "error",
147
+ "prefer-spread": "error",
148
+ "require-yield": "error",
149
+ "typescript/adjacent-overload-signatures": "error",
150
+ "typescript/array-type": "error",
151
+ "typescript/await-thenable": "error",
152
+ "typescript/ban-ts-comment": [
153
+ "error",
154
+ {
155
+ "ts-check": false,
156
+ "ts-expect-error": "allow-with-description",
157
+ "ts-ignore": true,
158
+ "ts-nocheck": true
159
+ }
160
+ ],
161
+ "typescript/ban-tslint-comment": "error",
162
+ "typescript/class-literal-property-style": "error",
163
+ "typescript/consistent-generic-constructors": "error",
164
+ "typescript/consistent-indexed-object-style": "error",
165
+ "typescript/consistent-type-assertions": [
166
+ "error",
167
+ {
168
+ "assertionStyle": "never"
169
+ }
170
+ ],
171
+ "typescript/consistent-type-definitions": ["error", "type"],
172
+ "typescript/consistent-type-imports": [
173
+ "error",
174
+ {
175
+ "fixStyle": "inline-type-imports"
176
+ }
177
+ ],
178
+ "typescript/no-array-delete": "error",
179
+ "typescript/no-base-to-string": "error",
180
+ "typescript/no-confusing-non-null-assertion": "error",
181
+ "typescript/no-confusing-void-expression": "error",
182
+ "typescript/no-deprecated": "error",
183
+ "typescript/no-duplicate-enum-values": "error",
184
+ "typescript/no-duplicate-type-constituents": "error",
185
+ "typescript/no-dynamic-delete": "error",
186
+ "typescript/no-empty-object-type": "error",
187
+ "typescript/no-explicit-any": "error",
188
+ "typescript/no-extra-non-null-assertion": "error",
189
+ "typescript/no-extraneous-class": "error",
190
+ "typescript/no-floating-promises": "error",
191
+ "typescript/no-for-in-array": "error",
192
+ "typescript/no-implied-eval": "error",
193
+ "typescript/no-import-type-side-effects": "error",
194
+ "typescript/no-inferrable-types": "error",
195
+ "typescript/no-invalid-void-type": "error",
196
+ "typescript/no-meaningless-void-operator": "error",
197
+ "typescript/no-misused-new": "error",
198
+ "typescript/no-misused-promises": "error",
199
+ "typescript/no-misused-spread": "error",
200
+ "typescript/no-mixed-enums": "error",
201
+ "typescript/no-namespace": "error",
202
+ "typescript/no-non-null-asserted-nullish-coalescing": "error",
203
+ "typescript/no-non-null-asserted-optional-chain": "error",
204
+ "typescript/no-non-null-assertion": "error",
205
+ "typescript/no-redundant-type-constituents": "error",
206
+ "typescript/no-require-imports": "error",
207
+ "typescript/no-this-alias": "error",
208
+ "typescript/no-unnecessary-boolean-literal-compare": "error",
209
+ "typescript/no-unnecessary-condition": "error",
210
+ "typescript/no-unnecessary-template-expression": "error",
211
+ "typescript/no-unnecessary-type-arguments": "error",
212
+ "typescript/no-unnecessary-type-assertion": "error",
213
+ "typescript/no-unnecessary-type-constraint": "error",
214
+ "typescript/no-unsafe-argument": "error",
215
+ "typescript/no-unsafe-assignment": "error",
216
+ "typescript/no-unsafe-call": "error",
217
+ "typescript/no-unsafe-declaration-merging": "error",
218
+ "typescript/no-unsafe-enum-comparison": "error",
219
+ "typescript/no-unsafe-function-type": "error",
220
+ "typescript/no-unsafe-member-access": "error",
221
+ "typescript/no-unsafe-return": "error",
222
+ "typescript/no-unsafe-unary-minus": "error",
223
+ "typescript/no-wrapper-object-types": "error",
224
+ "typescript/non-nullable-type-assertion-style": "error",
225
+ "typescript/only-throw-error": "error",
226
+ "typescript/prefer-as-const": "error",
227
+ "typescript/prefer-enum-initializers": "error",
228
+ "typescript/prefer-for-of": "error",
229
+ "typescript/prefer-function-type": "error",
230
+ "typescript/prefer-includes": "error",
231
+ "typescript/prefer-literal-enum-member": "error",
232
+ "typescript/prefer-namespace-keyword": "error",
233
+ "typescript/prefer-nullish-coalescing": [
234
+ "error",
235
+ {
236
+ "ignorePrimitives": {
237
+ "boolean": true,
238
+ "string": true
239
+ }
240
+ }
241
+ ],
242
+ "typescript/prefer-optional-chain": "error",
243
+ "typescript/prefer-promise-reject-errors": "error",
244
+ "typescript/prefer-reduce-type-parameter": "error",
245
+ "typescript/prefer-return-this-type": "error",
246
+ "typescript/promise-function-async": "error",
247
+ "typescript/related-getter-setter-pairs": "error",
248
+ "typescript/require-array-sort-compare": "error",
249
+ "typescript/restrict-plus-operands": [
250
+ "error",
251
+ {
252
+ "allowAny": false,
253
+ "allowBoolean": false,
254
+ "allowNullish": false,
255
+ "allowNumberAndString": false,
256
+ "allowRegExp": false
257
+ }
258
+ ],
259
+ "typescript/restrict-template-expressions": [
260
+ "error",
261
+ {
262
+ "allowNumber": true
263
+ }
264
+ ],
265
+ "typescript/return-await": ["error", "error-handling-correctness-only"],
266
+ "typescript/strict-boolean-expressions": [
267
+ "error",
268
+ {
269
+ "allowNullableBoolean": true,
270
+ "allowNullableString": true
271
+ }
272
+ ],
273
+ "typescript/switch-exhaustiveness-check": [
274
+ "error",
275
+ {
276
+ "allowDefaultCaseForExhaustiveSwitch": true,
277
+ "considerDefaultExhaustiveForUnions": false,
278
+ "requireDefaultForNonUnion": true
279
+ }
280
+ ],
281
+ "typescript/triple-slash-reference": "error",
282
+ "typescript/unbound-method": "error",
283
+ "typescript/unified-signatures": "error",
284
+ "typescript/use-unknown-in-catch-callback-variable": "error",
285
+ "use-isnan": "error",
286
+ "valid-typeof": "error"
287
+ }
288
+ }
package/README.md CHANGED
@@ -1,13 +1,15 @@
1
1
  # esconfig
2
2
 
3
- Shared ECMAScript Config (TS, Lint, Prettier)
3
+ Shared ECMAScript Config (TypeScript, oxlint, oxfmt, optional eslint)
4
4
 
5
5
  ## Usage
6
6
 
7
7
  1. Install
8
8
 
9
9
  ```sh
10
- yarn add -D @nihalgonsalves/esconfig typescript typescript-eslint eslint prettier
10
+ pnpm add -D @nihalgonsalves/esconfig typescript oxlint oxlint-tsgolint oxfmt
11
+ # optionally for react:
12
+ pnpm add -D eslint
11
13
  ```
12
14
 
13
15
  2. `tsconfig.json`
@@ -23,21 +25,17 @@ Shared ECMAScript Config (TS, Lint, Prettier)
23
25
  }
24
26
  ```
25
27
 
26
- 3. `eslint.config.js`
28
+ 3. copy [`.oxlintrc.json`](./.oxlintrc.json)
27
29
 
28
- ```js
29
- import tseslint from "typescript-eslint";
30
-
31
- import sharedConfig from "@nihalgonsalves/esconfig/eslint.config.shared";
30
+ 4. `.oxlintrc.json`
32
31
 
33
- export default tseslint.config(
34
- { ignores: [] },
35
- ...sharedConfig,
36
- // ... others
37
- );
32
+ ```json
33
+ {
34
+ "extends": ["node_modules/@nihalgonsalves/esconfig/.oxlintrc.json"]
35
+ }
38
36
  ```
39
37
 
40
- If you're using React:
38
+ 5. If you're using React, `eslint.config.js`:
41
39
 
42
40
  ```js
43
41
  import tseslint from "typescript-eslint";
@@ -51,17 +49,17 @@ Shared ECMAScript Config (TS, Lint, Prettier)
51
49
  );
52
50
  ```
53
51
 
54
- 4. `package.json`
52
+ 6. `package.json`
55
53
 
56
54
  ```json
57
55
  {
58
56
  "scripts": {
59
57
  "build": "tsc",
60
- "lint": "eslint ./src/",
61
- "format": "prettier . --write",
62
- "format:check": "prettier . --check"
58
+ "lint": "oxlint --type-aware && eslint ./src/",
59
+ "format": "oxfmt",
60
+ "format:check": "oxfmt --check"
63
61
  }
64
62
  }
65
63
  ```
66
64
 
67
- 5. Done! Don't forget to run `build`, `lint` and `format:check` in your CI workflow.
65
+ 7. Done! Don't forget to run `build`, `lint` and `format:check` in your CI workflow.
@@ -1,19 +1,15 @@
1
1
  import vitest from "@vitest/eslint-plugin";
2
- import { defineConfig } from "eslint/config";
3
2
  import prettierConfig from "eslint-config-prettier";
4
3
  import jestDom from "eslint-plugin-jest-dom";
5
4
  // @ts-expect-error no types
6
5
  import jsxA11y from "eslint-plugin-jsx-a11y";
7
6
  import react from "eslint-plugin-react";
8
- import reactCompiler from "eslint-plugin-react-compiler";
9
7
  import reactHooks from "eslint-plugin-react-hooks";
10
- import storybook from "eslint-plugin-storybook";
8
+ import { configs as storybookConfigs } from "eslint-plugin-storybook";
11
9
  import testingLibrary from "eslint-plugin-testing-library";
12
-
13
- import sharedConfig from "./eslint.config.shared.js";
10
+ import { defineConfig } from "eslint/config";
14
11
 
15
12
  export default defineConfig(
16
- ...sharedConfig,
17
13
  {
18
14
  ignores: [
19
15
  // https://github.com/storybookjs/eslint-plugin-storybook?tab=readme-ov-file#installation
@@ -21,9 +17,9 @@ export default defineConfig(
21
17
  ],
22
18
  },
23
19
  // @ts-expect-error wrong types
24
- react.configs.flat.recommended,
20
+ react.configs.flat["recommended-latest"],
25
21
  react.configs.flat["jsx-runtime"],
26
- reactCompiler.configs.recommended,
22
+ reactHooks.configs["recommended-latest"],
27
23
  {
28
24
  plugins: {
29
25
  "react-hooks": reactHooks,
@@ -42,8 +38,7 @@ export default defineConfig(
42
38
  },
43
39
  {
44
40
  name: "location",
45
- message:
46
- "useLocation from your router package, or access window.location",
41
+ message: "useLocation from your router package, or access window.location",
47
42
  },
48
43
  ],
49
44
  "no-restricted-imports": [
@@ -127,10 +122,7 @@ export default defineConfig(
127
122
  "react/no-multi-comp": "off",
128
123
  "react/no-set-state": "off",
129
124
  "react/prefer-es6-class": ["error", "always"],
130
- "react/prefer-stateless-function": [
131
- "error",
132
- { ignorePureComponents: true },
133
- ],
125
+ "react/prefer-stateless-function": ["error", { ignorePureComponents: true }],
134
126
  // TypeScript
135
127
  "react/prop-types": ["off"],
136
128
  "react/require-render-return": "error",
@@ -187,10 +179,7 @@ export default defineConfig(
187
179
  "react/jsx-first-prop-new-line": ["error", "multiline-multiprop"],
188
180
  "react/jsx-equals-spacing": ["error", "never"],
189
181
  "react/jsx-indent": ["error", 2],
190
- "react/jsx-filename-extension": [
191
- "error",
192
- { extensions: [".jsx", ".tsx"] },
193
- ],
182
+ "react/jsx-filename-extension": ["error", { extensions: [".jsx", ".tsx"] }],
194
183
  "react/require-optimization": ["off", { allowDecorators: [] }],
195
184
  "react/forbid-component-props": ["off", { forbid: [] }],
196
185
  "react/forbid-elements": ["off", { forbid: [] }],
@@ -204,16 +193,10 @@ export default defineConfig(
204
193
  "react/style-prop-object": "error",
205
194
  "react/no-array-index-key": "error",
206
195
  "react/void-dom-elements-no-children": "error",
207
- "react/default-props-match-prop-types": [
208
- "error",
209
- { allowRequiredDefaults: false },
210
- ],
196
+ "react/default-props-match-prop-types": ["error", { allowRequiredDefaults: false }],
211
197
  "react/no-redundant-should-component-update": "error",
212
198
  "react/no-unused-state": "error",
213
- "react/jsx-curly-brace-presence": [
214
- "error",
215
- { props: "never", children: "never" },
216
- ],
199
+ "react/jsx-curly-brace-presence": ["error", { props: "never", children: "never" }],
217
200
  "react/destructuring-assignment": ["error", "always"],
218
201
  "react/no-access-state-in-setstate": "error",
219
202
  "react/button-has-type": [
@@ -295,15 +278,7 @@ export default defineConfig(
295
278
  {
296
279
  labelAttributes: ["label"],
297
280
  controlComponents: [],
298
- ignoreElements: [
299
- "audio",
300
- "canvas",
301
- "embed",
302
- "input",
303
- "textarea",
304
- "tr",
305
- "video",
306
- ],
281
+ ignoreElements: ["audio", "canvas", "embed", "input", "textarea", "tr", "video"],
307
282
  ignoreRoles: [
308
283
  "grid",
309
284
  "listbox",
@@ -361,37 +336,14 @@ export default defineConfig(
361
336
  "jsx-a11y/no-noninteractive-element-interactions": [
362
337
  "error",
363
338
  {
364
- handlers: [
365
- "onClick",
366
- "onMouseDown",
367
- "onMouseUp",
368
- "onKeyPress",
369
- "onKeyDown",
370
- "onKeyUp",
371
- ],
339
+ handlers: ["onClick", "onMouseDown", "onMouseUp", "onKeyPress", "onKeyDown", "onKeyUp"],
372
340
  },
373
341
  ],
374
342
  "jsx-a11y/no-noninteractive-element-to-interactive-role": [
375
343
  "error",
376
344
  {
377
- ul: [
378
- "listbox",
379
- "menu",
380
- "menubar",
381
- "radiogroup",
382
- "tablist",
383
- "tree",
384
- "treegrid",
385
- ],
386
- ol: [
387
- "listbox",
388
- "menu",
389
- "menubar",
390
- "radiogroup",
391
- "tablist",
392
- "tree",
393
- "treegrid",
394
- ],
345
+ ul: ["listbox", "menu", "menubar", "radiogroup", "tablist", "tree", "treegrid"],
346
+ ol: ["listbox", "menu", "menubar", "radiogroup", "tablist", "tree", "treegrid"],
395
347
  li: ["menuitem", "option", "row", "tab", "treeitem"],
396
348
  table: ["grid"],
397
349
  td: ["gridcell"],
@@ -414,14 +366,7 @@ export default defineConfig(
414
366
  "jsx-a11y/no-static-element-interactions": [
415
367
  "error",
416
368
  {
417
- handlers: [
418
- "onClick",
419
- "onMouseDown",
420
- "onMouseUp",
421
- "onKeyPress",
422
- "onKeyDown",
423
- "onKeyUp",
424
- ],
369
+ handlers: ["onClick", "onMouseDown", "onMouseUp", "onKeyPress", "onKeyDown", "onKeyUp"],
425
370
  },
426
371
  ],
427
372
  "jsx-a11y/role-has-required-aria-props": "error",
@@ -430,9 +375,9 @@ export default defineConfig(
430
375
  "jsx-a11y/tabindex-no-positive": "error",
431
376
  },
432
377
  },
433
- ...storybook.configs["flat/recommended"],
434
- ...storybook.configs["flat/addon-interactions"],
435
- ...storybook.configs["flat/csf-strict"],
378
+ ...storybookConfigs["flat/recommended"],
379
+ ...storybookConfigs["flat/addon-interactions"],
380
+ ...storybookConfigs["flat/csf-strict"],
436
381
  {
437
382
  files: [
438
383
  "**/.storybook/**/*",
@@ -446,10 +391,7 @@ export default defineConfig(
446
391
  ],
447
392
  rules: {
448
393
  "vitest/consistent-test-filename": "error",
449
- "vitest/consistent-test-it": [
450
- "error",
451
- { fn: "it", withinDescribe: "it" },
452
- ],
394
+ "vitest/consistent-test-it": ["error", { fn: "it", withinDescribe: "it" }],
453
395
  "vitest/no-focused-tests": "error",
454
396
  "vitest/no-test-prefixes": "error",
455
397
  "vitest/padding-around-after-all-blocks": "error",
@@ -483,6 +425,6 @@ export default defineConfig(
483
425
  "import/no-default-export": "off",
484
426
  },
485
427
  },
486
- ...storybook.configs.recommended.overrides,
428
+ ...storybookConfigs.recommended.overrides,
487
429
  prettierConfig,
488
430
  );
package/package.json CHANGED
@@ -1,56 +1,57 @@
1
1
  {
2
2
  "name": "@nihalgonsalves/esconfig",
3
- "version": "0.13.5",
4
- "description": "Shared ECMAScript Config (TS, Lint, Prettier)",
5
- "main": "index.js",
3
+ "version": "0.14.0",
4
+ "description": "Shared ECMAScript Config (TypeScript, oxlint, oxfmt, eslint)",
5
+ "license": "MIT",
6
+ "author": "Nihal Gonsalves <nihal@nihalgonsalves.com>",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "git+ssh://git@github.com/nihalgonsalves/esconfig.git"
9
10
  },
10
- "author": "Nihal Gonsalves <nihal@nihalgonsalves.com>",
11
- "license": "MIT",
12
- "type": "module",
13
- "packageManager": "yarn@4.10.3+sha512.c38cafb5c7bb273f3926d04e55e1d8c9dfa7d9c3ea1f36a4868fa028b9e5f72298f0b7f401ad5eb921749eb012eb1c3bb74bf7503df3ee43fd600d14a018266f",
14
11
  "files": [
15
- "eslint.config.shared.js",
16
- "eslint.config.shared.d.ts",
12
+ ".oxlintrc.json",
13
+ ".oxfmt.json",
17
14
  "eslint.config.react-shared.js",
18
15
  "eslint.config.react-shared.d.ts",
19
16
  "tsconfig.shared.json"
20
17
  ],
21
- "scripts": {
22
- "typecheck": "tsc --noEmit",
23
- "lint": "eslint .",
24
- "format": "prettier . --write",
25
- "format:check": "prettier . --check"
18
+ "type": "module",
19
+ "main": "index.js",
20
+ "publishConfig": {
21
+ "provenance": true
26
22
  },
27
23
  "dependencies": {
28
- "@eslint/js": "^9.39.2",
29
- "@vitest/eslint-plugin": "^1.6.6",
24
+ "@vitest/eslint-plugin": "^1.6.9",
30
25
  "eslint-config-prettier": "^10.1.8",
31
- "eslint-plugin-import": "^2.32.0",
32
26
  "eslint-plugin-jest-dom": "^5.5.0",
33
27
  "eslint-plugin-jsx-a11y": "^6.10.2",
34
28
  "eslint-plugin-react": "^7.37.5",
35
- "eslint-plugin-react-compiler": "19.1.0-rc.2",
36
29
  "eslint-plugin-react-hooks": "^7.0.1",
37
- "eslint-plugin-storybook": "^10.2.3",
38
- "eslint-plugin-testing-library": "^7.15.4",
39
- "typescript-eslint": "^8.54.0"
30
+ "eslint-plugin-storybook": "^10.2.8",
31
+ "eslint-plugin-testing-library": "^7.15.4"
40
32
  },
41
33
  "devDependencies": {
42
34
  "@commitlint/cli": "^20.4.1",
43
35
  "@commitlint/config-conventional": "^20.4.1",
44
- "@types/node": "^22.19.7",
36
+ "@types/node": "^24.10.13",
45
37
  "eslint": "^9.39.2",
46
- "knip": "^5.82.1",
47
- "lefthook": "^2.0.16",
48
- "prettier": "^3.8.1",
38
+ "knip": "^5.83.1",
39
+ "lefthook": "^2.1.1",
40
+ "oxfmt": "^0.33.0",
41
+ "oxlint": "^1.48.0",
42
+ "oxlint-tsgolint": "^0.14.0",
49
43
  "typescript": "^5.9.3"
50
44
  },
51
45
  "peerDependencies": {
52
- "eslint": "^9.17.0",
53
- "typescript": "^5.5.4",
54
- "typescript-eslint": "^8.4.0"
46
+ "eslint": "^9.39.2",
47
+ "oxlint": "^1.48.0",
48
+ "oxlint-tsgolint": "^0.14.0",
49
+ "typescript": "^5.9.3"
50
+ },
51
+ "scripts": {
52
+ "typecheck": "tsc --noEmit",
53
+ "lint": "oxlint --type-aware . && knip",
54
+ "format": "oxfmt",
55
+ "format:check": "oxfmt --check"
55
56
  }
56
- }
57
+ }
@@ -1,5 +0,0 @@
1
- import type { defineConfig } from "eslint/config";
2
-
3
- declare const sharedConfig: ReturnType<typeof defineConfig>;
4
-
5
- export default sharedConfig;
@@ -1,227 +0,0 @@
1
- import js from "@eslint/js";
2
- import { defineConfig } from "eslint/config";
3
- import prettierConfig from "eslint-config-prettier";
4
- import importPlugin from "eslint-plugin-import";
5
- import tseslint from "typescript-eslint";
6
-
7
- export default defineConfig(
8
- js.configs.recommended,
9
- // @ts-expect-error nullability
10
- {
11
- // extract only the rules, because this config otherwise applies only to
12
- // TypeScript extensions, which causes problems with checkJs
13
- rules: tseslint.configs.eslintRecommended.rules,
14
- },
15
- ...tseslint.configs.strictTypeChecked,
16
- ...tseslint.configs.stylisticTypeChecked,
17
- {
18
- languageOptions: {
19
- parserOptions: {
20
- projectService: true,
21
- warnOnUnsupportedTypeScriptVersion: false,
22
- },
23
- },
24
- plugins: {
25
- import: importPlugin,
26
- },
27
- rules: {
28
- "@typescript-eslint/naming-convention": [
29
- "error",
30
- {
31
- selector: "variable",
32
- format: ["camelCase", "PascalCase", "UPPER_CASE"],
33
- },
34
- {
35
- selector: "function",
36
- format: ["camelCase", "PascalCase"],
37
- },
38
- {
39
- selector: "typeLike",
40
- format: ["PascalCase"],
41
- },
42
- ],
43
- "@typescript-eslint/class-methods-use-this": "error",
44
- "@typescript-eslint/default-param-last": ["error"],
45
- "@typescript-eslint/no-loop-func": ["error"],
46
- "@typescript-eslint/no-shadow": ["error"],
47
- "@typescript-eslint/no-unused-expressions": [
48
- "error",
49
- {
50
- allowShortCircuit: false,
51
- allowTernary: false,
52
- allowTaggedTemplates: false,
53
- enforceForJSX: false,
54
- },
55
- ],
56
- "@typescript-eslint/no-unused-vars": [
57
- "error",
58
- {
59
- vars: "all",
60
- args: "after-used",
61
- ignoreRestSiblings: true,
62
- argsIgnorePattern: "^_",
63
- },
64
- ],
65
- "@typescript-eslint/no-use-before-define": [
66
- "error",
67
- {
68
- functions: true,
69
- classes: true,
70
- variables: true,
71
- },
72
- ],
73
- "import/extensions": [
74
- "error",
75
- "ignorePackages",
76
- {
77
- js: "never",
78
- mjs: "never",
79
- jsx: "never",
80
- ts: "never",
81
- tsx: "never",
82
- },
83
- ],
84
- "import/no-extraneous-dependencies": [
85
- "error",
86
- {
87
- devDependencies: [
88
- "test/**",
89
- "tests/**",
90
- "spec/**",
91
- "**/__tests__/**",
92
- "**/__mocks__/**",
93
- "test.{js,jsx}",
94
- "test.{ts,tsx}",
95
- "test-*.{js,jsx}",
96
- "test-*.{ts,tsx}",
97
- "**/*{.,_}{test,spec}.{js,jsx}",
98
- "**/*{.,_}{test,spec}.{ts,tsx}",
99
- "**/*.config.{js,ts,cjs,mjs,cts,mts}",
100
- "**/*.stories.@(ts|tsx|js|jsx|mjs|cjs)",
101
- ],
102
- optionalDependencies: false,
103
- },
104
- ],
105
- "import/no-default-export": ["error"],
106
- "import/order": [
107
- "error",
108
- {
109
- pathGroups: [
110
- {
111
- pattern: "@nihalgonsalves/**",
112
- group: "internal",
113
- position: "after",
114
- },
115
- ],
116
- pathGroupsExcludedImportTypes: ["builtin"],
117
- groups: [
118
- "builtin",
119
- "external",
120
- "internal",
121
- "unknown",
122
- "parent",
123
- "sibling",
124
- "index",
125
- ],
126
- "newlines-between": "always",
127
- alphabetize: { order: "asc" },
128
- },
129
- ],
130
- "import/no-duplicates": ["error", { "prefer-inline": true }],
131
- "import/no-unresolved": "off",
132
- "func-style": ["error", "expression"],
133
- "arrow-body-style": "error",
134
- "object-shorthand": "error",
135
- "no-useless-rename": "error",
136
- "@typescript-eslint/consistent-type-imports": [
137
- "error",
138
- { fixStyle: "inline-type-imports" },
139
- ],
140
- "@typescript-eslint/consistent-type-exports": [
141
- "error",
142
- { fixMixedExportsWithInlineTypeSpecifier: true },
143
- ],
144
- "@typescript-eslint/consistent-type-definitions": ["error", "type"],
145
- "@typescript-eslint/ban-ts-comment": [
146
- "error",
147
- {
148
- "ts-expect-error": "allow-with-description",
149
- "ts-ignore": true,
150
- "ts-nocheck": true,
151
- "ts-check": false,
152
- },
153
- ],
154
- "@typescript-eslint/consistent-type-assertions": [
155
- "error",
156
- {
157
- assertionStyle: "never",
158
- },
159
- ],
160
- "@typescript-eslint/prefer-nullish-coalescing": [
161
- "error",
162
- { ignorePrimitives: { boolean: true, string: true } },
163
- ],
164
- "@typescript-eslint/strict-boolean-expressions": [
165
- "error",
166
- { allowNullableBoolean: true, allowNullableString: true },
167
- ],
168
- "@typescript-eslint/restrict-template-expressions": [
169
- "error",
170
- { allowNumber: true },
171
- ],
172
- "@typescript-eslint/promise-function-async": "error",
173
- "@typescript-eslint/method-signature-style": "error",
174
- "@typescript-eslint/no-import-type-side-effects": "error",
175
- "@typescript-eslint/require-array-sort-compare": "error",
176
- "@typescript-eslint/switch-exhaustiveness-check": [
177
- "error",
178
- {
179
- allowDefaultCaseForExhaustiveSwitch: true,
180
- requireDefaultForNonUnion: true,
181
- considerDefaultExhaustiveForUnions: false,
182
- },
183
- ],
184
- "@typescript-eslint/require-await": "off",
185
- "@typescript-eslint/prefer-enum-initializers": "error",
186
- "@typescript-eslint/consistent-return": "error",
187
- },
188
- settings: {
189
- "import/extensions": [
190
- ".cjs",
191
- ".mjs",
192
- ".js",
193
- ".jsx",
194
- ".cts",
195
- ".mts",
196
- ".ts",
197
- ".tsx",
198
- ],
199
- "import/external-module-folders": ["node_modules", "node_modules/@types"],
200
- "import/parsers": {
201
- "@typescript-eslint/parser": [".cts", ".mts", ".ts", ".tsx"],
202
- },
203
- "import/resolver": {
204
- node: {
205
- extensions: [
206
- ".cjs",
207
- ".mjs",
208
- ".js",
209
- ".jsx",
210
- ".cts",
211
- ".mts",
212
- ".ts",
213
- ".tsx",
214
- ],
215
- },
216
- },
217
- },
218
- },
219
- {
220
- files: ["**/*.config.*"],
221
- rules: {
222
- "import/no-default-export": "off",
223
- },
224
- },
225
-
226
- prettierConfig,
227
- );