Skip to content

Commit c4c6a6c

Browse files
authored
feat(deps): Update dependencies 2025.01.09 (#35)
* feat(deps): Update dependencies 2024.12.01 * Update all 2024.12.23 * Update all 2025.01.09
1 parent b4e3f9a commit c4c6a6c

27 files changed

+6528
-5205
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: ubuntu-latest
1616
strategy:
1717
matrix:
18-
nodejs: [18, 19, 20, 21, 22]
18+
nodejs: [18, 19, 20, 21, 22.6,]
1919

2020
steps:
2121
- uses: actions/checkout@v4

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
with:
2626
node-version-file: .nvmrc
2727
cache: yarn
28-
- uses: github/codeql-action/init@v2
28+
- uses: github/codeql-action/init@v3
2929
with:
3030
languages: javascript-typescript
31-
- uses: github/codeql-action/analyze@v2
31+
- uses: github/codeql-action/analyze@v3
3232
with:
3333
category: /language:javascript-typescript

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.3.0
1+
22.6.0

.yarn/releases/yarn-4.3.1.cjs

Lines changed: 0 additions & 894 deletions
This file was deleted.

.yarn/releases/yarn-4.6.0.cjs

Lines changed: 934 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ plugins:
99
path: .yarn/plugins/@yarnpkg/plugin-engines.cjs
1010
spec: "https://raw.githubusercontent.com/devoto13/yarn-plugin-engines/main/bundles/%40yarnpkg/plugin-engines.js"
1111

12-
yarnPath: .yarn/releases/yarn-4.3.1.cjs
12+
yarnPath: .yarn/releases/yarn-4.6.0.cjs

README.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,20 @@ But what if you don't want to use Jest as your testing framework? What if you do
2222

2323
## Table of contents
2424

25-
- [Features](#features)
26-
- [Requirements](#requirements)
27-
- [Install](#install)
28-
- [Usage](#usage)
29-
- [With Vitest](#with-vitest)
30-
- [With Mocha](#with-mocha)
31-
- [Mocking native methods](#mocking-native-methods)
32-
- [Contributing](#contributing)
33-
- [License](#license)
25+
- [React Native Testing Mocks](#react-native-testing-mocks)
26+
- [Motivation](#motivation)
27+
- [Table of contents](#table-of-contents)
28+
- [Features](#features)
29+
- [Requirements](#requirements)
30+
- [Install](#install)
31+
- [Usage](#usage)
32+
- [With Vitest](#with-vitest)
33+
- [With Mocha](#with-mocha)
34+
- [Mocking native methods](#mocking-native-methods)
35+
- [Contributing](#contributing)
36+
- [Something's missing?](#somethings-missing)
37+
- [Contributions](#contributions)
38+
- [License](#license)
3439

3540
### Features
3641

@@ -45,10 +50,12 @@ But what if you don't want to use Jest as your testing framework? What if you do
4550

4651
## Requirements
4752

48-
- **Node.js:** >=18
53+
- **Node.js:** >=18 <=22.6
4954
- **react:** >=18.2.0
5055
- **react-native:** ">=0.73.2
5156

57+
> **NOTE:** Node.js [enabled the `--experimental-detect-module` flag](https://github.com/nodejs/node/releases/tag/v22.7.0) on v22.7.0 by default. This raises an issue when transforming Flow code with Babel, so we're not supporting v22.7+ until the flag remains experimental and all issues are resolved.
58+
5259
## Install
5360

5461
With NPM:

eslint.config.mjs renamed to eslint.config.js

Lines changed: 38 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,30 @@
11
// @ts-check
2-
import path from "path";
3-
import { fileURLToPath } from "url";
4-
5-
import { fixupPluginRules } from "@eslint/compat";
6-
import { FlatCompat } from "@eslint/eslintrc";
72
import eslintJs from "@eslint/js";
83
import stylistic from "@stylistic/eslint-plugin";
9-
import etc from "eslint-plugin-etc";
4+
import * as importPlugin from "eslint-plugin-import";
105
import jsdoc from "eslint-plugin-jsdoc";
11-
import reactJsxRuntime from "eslint-plugin-react/configs/jsx-runtime.js";
12-
import reactRecommended from "eslint-plugin-react/configs/recommended.js";
6+
import perfectionist from "eslint-plugin-perfectionist";
7+
import reactPlugin from "eslint-plugin-react";
138
import sonarjs from "eslint-plugin-sonarjs";
149
import globals from "globals";
1510
import eslintTs from "typescript-eslint";
1611

1712
const project = "./tsconfig.json";
18-
const filename = fileURLToPath(import.meta.url);
19-
const dirname = path.dirname(filename);
20-
const compat = new FlatCompat({
21-
baseDirectory: dirname,
22-
recommendedConfig: eslintJs.configs.recommended,
23-
});
2413

2514
/**
26-
* @param {string} name the pugin name
27-
* @param {string} alias the plugin alias
28-
* @returns {import("eslint").ESLint.Plugin}
15+
* @param {object} config the plugin config
16+
* @returns {import("typescript-eslint").ConfigWithExtends}
2917
*/
30-
function legacyPlugin(name, alias = name) {
31-
const plugin = compat.plugins(name)[0]?.plugins?.[alias];
32-
33-
if (!plugin) {
34-
throw new Error(`Unable to resolve plugin ${name} and/or alias ${alias}`);
35-
}
36-
37-
return fixupPluginRules(plugin);
18+
function fixConfigTypes(config) {
19+
return config;
3820
}
3921

4022
export default eslintTs.config(
4123
eslintJs.configs.recommended,
4224
...eslintTs.configs.recommendedTypeChecked,
43-
...compat.extends("plugin:import/typescript"),
44-
reactRecommended,
45-
reactJsxRuntime,
25+
fixConfigTypes(importPlugin.flatConfigs?.typescript),
26+
fixConfigTypes(reactPlugin.configs.flat?.recommended),
27+
fixConfigTypes(reactPlugin.configs.flat?.["jsx-runtime"]),
4628
sonarjs.configs.recommended,
4729
stylistic.configs.customize({
4830
braceStyle: "1tbs",
@@ -63,7 +45,7 @@ export default eslintTs.config(
6345
globals: { ...globals.browser, ...globals.node },
6446
parserOptions: {
6547
ecmaFeatures: { jsx: true },
66-
ecmaVersion: 2024,
48+
ecmaVersion: 2023,
6749
jsxPragma: null,
6850
project,
6951
tsconfigRootDir: import.meta.dirname,
@@ -74,13 +56,12 @@ export default eslintTs.config(
7456
reportUnusedDisableDirectives: "error",
7557
},
7658
plugins: {
77-
deprecation: legacyPlugin("eslint-plugin-deprecation", "deprecation"),
78-
etc: fixupPluginRules(etc),
79-
"extra-rules": legacyPlugin("eslint-plugin-extra-rules", "extra-rules"),
80-
import: legacyPlugin("eslint-plugin-import", "import"),
59+
import: importPlugin,
8160
jsdoc,
61+
perfectionist,
8262
},
8363
settings: {
64+
"import/ignore": ["react-native"], // https://github.com/facebook/react-native/issues/28549
8465
"import/resolver": {
8566
typescript: {
8667
alwaysTryTypes: true,
@@ -95,7 +76,6 @@ export default eslintTs.config(
9576
{
9677
rules: {
9778
"@stylistic/arrow-parens": ["error", "as-needed"],
98-
"@stylistic/indent": "off",
9979
"@stylistic/indent-binary-ops": "off",
10080
"@stylistic/jsx-curly-brace-presence": ["error", { children: "always" }],
10181
"@stylistic/jsx-curly-newline": "off",
@@ -117,6 +97,7 @@ export default eslintTs.config(
11797
"@stylistic/no-mixed-spaces-and-tabs": "error",
11898
"@stylistic/no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
11999
"@stylistic/object-curly-spacing": ["error", "always"],
100+
"@stylistic/object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
120101
"@stylistic/padded-blocks": ["error", "never", { allowSingleLineBlocks: false }],
121102
"@stylistic/quote-props": ["error", "as-needed"],
122103
"@stylistic/quotes": ["error", "double", {
@@ -125,7 +106,6 @@ export default eslintTs.config(
125106
}],
126107
"@stylistic/space-before-function-paren": ["error", { anonymous: "never", named: "never" }],
127108
"@stylistic/switch-colon-spacing": "error",
128-
"@typescript-eslint/ban-types": "error",
129109
"@typescript-eslint/consistent-type-assertions": "error",
130110
"@typescript-eslint/consistent-type-exports": "error",
131111
"@typescript-eslint/consistent-type-imports": ["error", { fixStyle: "inline-type-imports" }],
@@ -187,14 +167,11 @@ export default eslintTs.config(
187167
camelcase: "error",
188168
"constructor-super": "error",
189169
curly: "error",
190-
"deprecation/deprecation": "error",
191170
eqeqeq: "error",
192-
"etc/no-assign-mutated-array": "error",
193-
"etc/no-implicit-any-catch": "error",
194-
"etc/no-internal": "error",
195-
"etc/throw-error": "error",
196-
"extra-rules/no-commented-out-code": "error",
197171
"func-style": ["error", "declaration", { allowArrowFunctions: true }],
172+
"import/default": "off",
173+
"import/named": "off",
174+
"import/namespace": "off",
198175
"import/newline-after-import": "error",
199176
"import/no-absolute-path": "error",
200177
"import/no-cycle": ["error", {
@@ -204,7 +181,8 @@ export default eslintTs.config(
204181
}],
205182
"import/no-duplicates": ["error", { "prefer-inline": true }],
206183
"import/no-import-module-exports": "error",
207-
"import/no-namespace": "error",
184+
"import/no-named-as-default-member": "off",
185+
"import/no-namespace": ["error", { ignore: ["eslint-plugin-import"] }],
208186
"import/no-relative-packages": "error",
209187
"import/no-unresolved": "error",
210188
"import/no-useless-path-segments": "error",
@@ -247,6 +225,11 @@ export default eslintTs.config(
247225
"no-var": "error",
248226
"object-shorthand": "error",
249227
"one-var": ["error", "never"],
228+
"perfectionist/sort-interfaces": ["error", { ignoreCase: false, type: "natural" }],
229+
"perfectionist/sort-intersection-types": ["error", { ignoreCase: false, type: "natural" }],
230+
"perfectionist/sort-object-types": ["error", { ignoreCase: false, type: "natural" }],
231+
"perfectionist/sort-objects": ["error", { ignoreCase: false, type: "natural" }],
232+
"perfectionist/sort-union-types": ["error", { ignoreCase: false, type: "natural" }],
250233
"prefer-const": "error",
251234
radix: "error",
252235
"react/display-name": "off",
@@ -256,10 +239,17 @@ export default eslintTs.config(
256239
"react/jsx-no-literals": "error",
257240
"react/prop-types": "off",
258241
"sonarjs/cognitive-complexity": "off",
242+
"sonarjs/different-types-comparison": "off",
243+
"sonarjs/function-return-type": "off",
259244
"sonarjs/no-duplicate-string": "off",
260-
"sonarjs/no-inverted-boolean-check": "error",
245+
"sonarjs/no-empty-function": "off",
246+
"sonarjs/no-extend-native": "off",
247+
"sonarjs/no-nested-functions": "off",
248+
"sonarjs/no-selector-parameter": "off",
249+
"sonarjs/no-unused-expressions": "off",
250+
"sonarjs/public-static-readonly": "off",
251+
"sonarjs/sonar-prefer-read-only-props": "off",
261252
"sort-imports": ["error", { ignoreDeclarationSort: true }],
262-
"sort-keys": "error",
263253
},
264254
},
265255
{
@@ -273,11 +263,6 @@ export default eslintTs.config(
273263
rules: {
274264
...eslintTs.configs.disableTypeChecked.rules,
275265
"@typescript-eslint/explicit-function-return-type": "off",
276-
"deprecation/deprecation": "off",
277-
"etc/no-assign-mutated-array": "off",
278-
"etc/no-implicit-any-catch": "off",
279-
"etc/no-internal": "off",
280-
"etc/throw-error": "off",
281266
},
282267
},
283268
{
@@ -290,8 +275,11 @@ export default eslintTs.config(
290275
files: ["**/*.test.ts?(x)"],
291276
rules: {
292277
"@typescript-eslint/no-non-null-assertion": "off",
278+
"@typescript-eslint/prefer-promise-reject-errors": "off",
293279
"@typescript-eslint/restrict-template-expressions": "off",
294-
"etc/throw-error": "off",
280+
"sonarjs/assertions-in-tests": "off",
281+
"sonarjs/no-empty-test-file": "off",
282+
"sonarjs/no-nested-functions": "off",
295283
},
296284
},
297285
);

0 commit comments

Comments
 (0)