Skip to content

Commit 615b1bc

Browse files
committed
chore: update eslint and prettier
1 parent 558c2ef commit 615b1bc

File tree

4 files changed

+172
-203
lines changed

4 files changed

+172
-203
lines changed

.eslintrc.js

+26-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,36 @@
11
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
jest: true,
7+
},
28
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
3-
extends: [
4-
'plugin:@typescript-eslint/recommended',
5-
'plugin:prettier/recommended',
6-
'plugin:react/recommended',
7-
],
89
parserOptions: {
9-
ecmaVersion: 2018,
10+
ecmaVersion: 'latest',
1011
sourceType: 'module',
1112
ecmaFeatures: {
1213
jsx: true,
1314
},
1415
},
16+
extends: [
17+
'eslint:recommended',
18+
'plugin:@typescript-eslint/recommended',
19+
'plugin:react/recommended',
20+
'plugin:react-hooks/recommended',
21+
'prettier',
22+
],
23+
overrides: [
24+
{
25+
env: {
26+
node: true,
27+
},
28+
files: ['commitlint.config.js', '.eslintrc.js'],
29+
parserOptions: {
30+
sourceType: 'script',
31+
},
32+
},
33+
],
1534
rules: {
1635
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
1736
},
@@ -20,7 +39,5 @@ module.exports = {
2039
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
2140
},
2241
},
23-
env: {
24-
jest: true,
25-
},
42+
ignorePatterns: ['dist'],
2643
};

package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"test": "LANG=en_GB jest",
1717
"test-ci": "LANG=en_GB.UTF-8 cross-env NODE_ICU_DATA=node_modules/full-icu jest",
1818
"typecheck": "tsc && tsc --project tsconfig.test.json",
19-
"lint": "eslint src --max-warnings=0",
19+
"lint": "eslint ./ --max-warnings=0",
2020
"gh-predeploy": "parcel build src/examples/index.html --dist-dir demo/examples --public-url ./",
2121
"gh-deploy": "yarn gh-predeploy && gh-pages -d demo/examples",
2222
"ci": "yarn && yarn build",
@@ -65,18 +65,19 @@
6565
"@typescript-eslint/parser": "^6.16.0",
6666
"codecov": "^3.8.3",
6767
"cross-env": "^7.0.3",
68-
"eslint": "^7.27.0",
69-
"eslint-config-prettier": "^8.3.0",
70-
"eslint-plugin-prettier": "^3.4.0",
71-
"eslint-plugin-react": "^7.23.2",
68+
"eslint": "^8.56.0",
69+
"eslint-config-prettier": "^9.1.0",
70+
"eslint-plugin-prettier": "^5.1.2",
71+
"eslint-plugin-react": "^7.33.2",
72+
"eslint-plugin-react-hooks": "^4.6.0",
7273
"full-icu": "^1.3.4",
7374
"gh-pages": "^3.1.0",
7475
"husky": "^6.0.0",
7576
"jest": "^29.7.0",
7677
"jest-environment-jsdom": "^29.7.0",
7778
"lint-staged": "^11.0.0",
7879
"parcel": "^2.0.0-rc.0",
79-
"prettier": "^2.3.0",
80+
"prettier": "^3.1.1",
8081
"process": "^0.11.10",
8182
"react": "^17.0.2",
8283
"react-dom": "17.0.2",

src/components/utils/escapeRegExp.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
* See: https://stackoverflow.com/questions/17885855/use-dynamic-variable-string-as-regex-pattern-in-javascript
55
*/
66
export const escapeRegExp = (stringToGoIntoTheRegex: string): string => {
7-
return stringToGoIntoTheRegex.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
7+
return stringToGoIntoTheRegex.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
88
};

0 commit comments

Comments
 (0)