Skip to content

Commit 2920e69

Browse files
committed
🔧 (.pre-commit-config.yaml): Add [email protected] as a dependency and enable autofix for pretty-format-json hook
🔧 (.eslintrc.json): Update eslint configuration to include additional plugins, parser, parserOptions, and env settings
1 parent da927d5 commit 2920e69

File tree

3 files changed

+108
-1
lines changed

3 files changed

+108
-1
lines changed

‎.eslintrc.json

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:react/recommended",
5+
"plugin:prettier/recommended"
6+
],
7+
"plugins": [
8+
"react",
9+
"import-helpers",
10+
"prettier"
11+
],
12+
"parser": "@typescript-eslint/parser",
13+
"parserOptions": {
14+
"project": [
15+
"./tsconfig.node.json",
16+
"./tsconfig.json"
17+
],
18+
"extraFileExtensions:": [
19+
".mdx"
20+
],
21+
"extensions:": [
22+
".mdx"
23+
]
24+
},
25+
"env": {
26+
"browser": true,
27+
"es2021": true
28+
},
29+
"settings": {
30+
"react": {
31+
"version": "detect"
32+
}
33+
},
34+
"rules": {
35+
"no-console": "warn",
36+
"no-self-assign": "warn",
37+
"no-self-compare": "warn",
38+
"complexity": [
39+
"error",
40+
{
41+
"max": 15
42+
}
43+
],
44+
"indent": [
45+
"error",
46+
2,
47+
{
48+
"SwitchCase": 1
49+
}
50+
],
51+
"no-dupe-keys": "error",
52+
"no-invalid-regexp": "error",
53+
"no-undef": "error",
54+
"no-return-assign": "error",
55+
"no-redeclare": "error",
56+
"no-empty": "error",
57+
"no-await-in-loop": "error",
58+
"react/react-in-jsx-scope": 0,
59+
"node/exports-style": [
60+
"error",
61+
"module.exports"
62+
],
63+
"node/file-extension-in-import": [
64+
"error",
65+
"always"
66+
],
67+
"node/prefer-global/buffer": [
68+
"error",
69+
"always"
70+
],
71+
"node/prefer-global/console": [
72+
"error",
73+
"always"
74+
],
75+
"node/prefer-global/process": [
76+
"error",
77+
"always"
78+
],
79+
"node/prefer-global/url-search-params": [
80+
"error",
81+
"always"
82+
],
83+
"node/prefer-global/url": [
84+
"error",
85+
"always"
86+
],
87+
"node/prefer-promises/dns": "error",
88+
"node/prefer-promises/fs": "error"
89+
}
90+
}

‎.pre-commit-config.yaml

+18-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,29 @@ repos:
66
- id: eslint
77
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
88
types: [file]
9+
args: ["--fix", "--no-warn-ignored"]
910
additional_dependencies:
11+
1012
- eslint-plugin-prettier
1113
- eslint-config-prettier
1214
- prettier
1315
- eslint-plugin-react@latest
14-
- typescript-eslint
16+
- repo: https://github.com/pre-commit/pre-commit-hooks
17+
rev: v4.1.0
18+
hooks:
19+
- id: check-case-conflict
20+
- id: end-of-file-fixer
21+
- id: mixed-line-ending
22+
args:
23+
- --fix=lf
24+
- id: trailing-whitespace
25+
- id: pretty-format-json
26+
exclude: ^tsconfig.*.json
27+
args:
28+
- --autofix
29+
- --indent=4
30+
- --no-sort-keys
31+
- id: check-merge-conflict
1532
- repo: https://github.com/astral-sh/ruff-pre-commit
1633
# Ruff version.
1734
rev: v0.4.2

‎eslint.config.js

Whitespace-only changes.

0 commit comments

Comments
 (0)