Skip to content

Commit 261c47e

Browse files
committed
chore: update development dependencies
- update eslint, testing-library and husky configurations - Removed .eslintignore and .eslintrc.js - Updated husky scripts: _/husky.sh, commit-msg, pre-commit - Added eslint.config.mjs - Updated package.json and yarn.lock - Modified src/index.spec.tsx
1 parent ea71a3b commit 261c47e

16 files changed

+3688
-3949
lines changed

.eslintignore

-1
This file was deleted.

.eslintrc.js

-38
This file was deleted.

.husky/_/husky.sh

+6-33
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,9 @@
1-
#!/usr/bin/env sh
2-
if [ -z "$husky_skip_init" ]; then
3-
debug () {
4-
if [ "$HUSKY_DEBUG" = "1" ]; then
5-
echo "husky (debug) - $1"
6-
fi
7-
}
8-
9-
readonly hook_name="$(basename -- "$0")"
10-
debug "starting $hook_name..."
11-
12-
if [ "$HUSKY" = "0" ]; then
13-
debug "HUSKY env variable is set to 0, skipping hook"
14-
exit 0
15-
fi
1+
echo "husky - DEPRECATED
162
17-
if [ -f ~/.huskyrc ]; then
18-
debug "sourcing ~/.huskyrc"
19-
. ~/.huskyrc
20-
fi
3+
Please remove the following two lines from $0:
214
22-
readonly husky_skip_init=1
23-
export husky_skip_init
24-
sh -e "$0" "$@"
25-
exitCode="$?"
26-
27-
if [ $exitCode != 0 ]; then
28-
echo "husky - $hook_name hook exited with code $exitCode (error)"
29-
fi
30-
31-
if [ $exitCode = 127 ]; then
32-
echo "husky - command not found in PATH=$PATH"
33-
fi
5+
#!/usr/bin/env sh
6+
. \"\$(dirname -- \"\$0\")/_/husky.sh\"
347
35-
exit $exitCode
36-
fi
8+
They WILL FAIL in v10.0.0
9+
"

.husky/commit-msg

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
yarn commitlint --edit $1

.husky/pre-commit

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
./node_modules/.bin/lint-staged

dist/index.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,5 @@ export interface EdiTextProps {
194194
*/
195195
renderValue?: (value: any) => any;
196196
}
197-
declare function EdiText(props: EdiTextProps): JSX.Element;
197+
declare function EdiText(props: EdiTextProps): React.JSX.Element;
198198
export default EdiText;

dist/index.es.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.es.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

+13-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.min.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import react from 'eslint-plugin-react';
2+
import typescriptEslint from '@typescript-eslint/eslint-plugin';
3+
import prettier from 'eslint-plugin-prettier';
4+
import reactHooks from 'eslint-plugin-react-hooks';
5+
import { fixupPluginRules } from '@eslint/compat';
6+
import globals from 'globals';
7+
import tsParser from '@typescript-eslint/parser';
8+
import path from 'node:path';
9+
import { fileURLToPath } from 'node:url';
10+
import js from '@eslint/js';
11+
import { FlatCompat } from '@eslint/eslintrc';
12+
13+
const __filename = fileURLToPath(import.meta.url);
14+
const __dirname = path.dirname(__filename);
15+
const compat = new FlatCompat({
16+
baseDirectory: __dirname,
17+
recommendedConfig: js.configs.recommended,
18+
allConfig: js.configs.all,
19+
});
20+
21+
export default [
22+
{
23+
ignores: ['**/dist'],
24+
},
25+
...compat.extends(
26+
'plugin:react/recommended',
27+
'prettier',
28+
'plugin:prettier/recommended',
29+
'plugin:@typescript-eslint/eslint-recommended'
30+
),
31+
{
32+
plugins: {
33+
react,
34+
'@typescript-eslint': typescriptEslint,
35+
prettier,
36+
'react-hooks': fixupPluginRules(reactHooks),
37+
},
38+
39+
languageOptions: {
40+
globals: {
41+
...globals.browser,
42+
Atomics: 'readonly',
43+
SharedArrayBuffer: 'readonly',
44+
},
45+
46+
parser: tsParser,
47+
ecmaVersion: 2018,
48+
sourceType: 'module',
49+
50+
parserOptions: {
51+
ecmaFeatures: {
52+
jsx: true,
53+
},
54+
},
55+
},
56+
57+
rules: {
58+
'prettier/prettier': 'error',
59+
'@typescript-eslint/explicit-function-return-type': 'off',
60+
'@typescript-eslint/no-unused-vars': 'off',
61+
'no-unused-vars': 'off',
62+
'no-use-before-define': 'off',
63+
'@typescript-eslint/no-use-before-define': ['off'],
64+
'react-hooks/rules-of-hooks': 'error',
65+
'react-hooks/exhaustive-deps': 'warn',
66+
'react/react-in-jsx-scope': 'off',
67+
'react/no-unescaped-entities': 'off',
68+
},
69+
},
70+
];
71+

package.json

+44-39
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"test:watch": "jest --coverage --watch",
3232
"test:ci": "cross-env CI=1 jest",
3333
"build:example": "cd example && yarn install && yarn run build && cp _redirects build/",
34-
"prepare": "husky install"
34+
"prepare": "husky"
3535
},
3636
"peerDependencies": {
3737
"react": ">=16"
@@ -43,50 +43,55 @@
4343
]
4444
},
4545
"devDependencies": {
46-
"@commitlint/cli": "^17.5.0",
47-
"@commitlint/config-conventional": "^17.4.4",
48-
"@rollup/plugin-commonjs": "^24.0.1",
49-
"@rollup/plugin-json": "^6.0.0",
50-
"@rollup/plugin-node-resolve": "^15.0.1",
51-
"@rollup/plugin-terser": "^0.4.0",
52-
"@testing-library/jest-dom": "^5.16.5",
53-
"@testing-library/react": "^14.0.0",
54-
"@types/jest": "^29.5.0",
55-
"@types/node": "^18.15.9",
56-
"@types/react": "^18.0.29",
57-
"@types/react-dom": "^18.0.11",
58-
"@typescript-eslint/eslint-plugin": "^5.56.0",
59-
"@typescript-eslint/parser": "^5.56.0",
46+
"@commitlint/cli": "^19.6.1",
47+
"@commitlint/config-conventional": "^19.6.0",
48+
"@eslint/compat": "^1.2.4",
49+
"@eslint/eslintrc": "^3.2.0",
50+
"@eslint/js": "^9.17.0",
51+
"@rollup/plugin-commonjs": "^28.0.2",
52+
"@rollup/plugin-json": "^6.1.0",
53+
"@rollup/plugin-node-resolve": "^16.0.0",
54+
"@rollup/plugin-terser": "^0.4.4",
55+
"@testing-library/dom": "^10.4.0",
56+
"@testing-library/jest-dom": "^6.6.3",
57+
"@testing-library/react": "^16.1.0",
58+
"@testing-library/user-event": "^14.5.2",
59+
"@types/jest": "^29.5.14",
60+
"@types/node": "^22.10.2",
61+
"@types/react": "^19.0.2",
62+
"@types/react-dom": "^19.0.2",
63+
"@typescript-eslint/eslint-plugin": "^8.18.2",
64+
"@typescript-eslint/parser": "^8.18.2",
6065
"codecov": "^3.8.3",
6166
"cross-env": "^7.0.3",
62-
"eslint": "^8.36.0",
63-
"eslint-config-prettier": "^8.8.0",
64-
"eslint-config-standard": "^17.0.0",
65-
"eslint-plugin-import": "^2.27.5",
66-
"eslint-plugin-n": "^15.6.1",
67-
"eslint-plugin-prettier": "^4.2.1",
68-
"eslint-plugin-promise": "^6.1.1",
69-
"eslint-plugin-react": "^7.32.2",
70-
"eslint-plugin-react-hooks": "^4.6.0",
71-
"husky": "^8.0.3",
67+
"eslint": "^9.17.0",
68+
"eslint-config-prettier": "^9.1.0",
69+
"eslint-plugin-import": "^2.31.0",
70+
"eslint-plugin-n": "^17.15.1",
71+
"eslint-plugin-prettier": "^5.2.1",
72+
"eslint-plugin-promise": "^7.2.1",
73+
"eslint-plugin-react": "^7.37.3",
74+
"eslint-plugin-react-hooks": "^5.1.0",
75+
"globals": "^15.14.0",
76+
"husky": "^9.1.7",
7277
"identity-obj-proxy": "^3.0.0",
73-
"jest": "^29.5.0",
74-
"jest-environment-jsdom": "^29.5.0",
75-
"lint-staged": "^13.2.0",
76-
"postcss": "^8.4.21",
77-
"prettier": "^2.8.7",
78-
"react": "^18.2.0",
79-
"react-dom": "^18.2.0",
80-
"rollup": "^3.20.2",
81-
"rollup-plugin-delete": "^2.0.0",
78+
"jest": "^29.7.0",
79+
"jest-environment-jsdom": "^29.7.0",
80+
"lint-staged": "^15.3.0",
81+
"postcss": "^8.4.49",
82+
"prettier": "^3.4.2",
83+
"react": "^19.0.0",
84+
"react-dom": "^19.0.0",
85+
"rollup": "^4.29.1",
86+
"rollup-plugin-delete": "^2.1.0",
8287
"rollup-plugin-peer-deps-external": "^2.2.4",
8388
"rollup-plugin-postcss": "^4.0.2",
8489
"rollup-plugin-sourcemaps": "^0.6.3",
85-
"rollup-plugin-typescript2": "^0.34.1",
86-
"ts-jest": "^29.0.5",
87-
"tslib": "^2.5.0",
88-
"typescript": "^5.0.2",
89-
"typescript-plugin-css-modules": "^5.0.0"
90+
"rollup-plugin-typescript2": "^0.36.0",
91+
"ts-jest": "^29.2.5",
92+
"tslib": "^2.8.1",
93+
"typescript": "^5.7.2",
94+
"typescript-plugin-css-modules": "^5.1.0"
9095
},
9196
"dependencies": {}
9297
}

0 commit comments

Comments
 (0)