🔧 (.pre-commit-config.yaml): Add eslint@9.1.1 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
This commit is contained in:
parent
da927d56c1
commit
2920e69593
3 changed files with 108 additions and 1 deletions
90
.eslintrc.json
Normal file
90
.eslintrc.json
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"eslint:recommended",
|
||||||
|
"plugin:react/recommended",
|
||||||
|
"plugin:prettier/recommended"
|
||||||
|
],
|
||||||
|
"plugins": [
|
||||||
|
"react",
|
||||||
|
"import-helpers",
|
||||||
|
"prettier"
|
||||||
|
],
|
||||||
|
"parser": "@typescript-eslint/parser",
|
||||||
|
"parserOptions": {
|
||||||
|
"project": [
|
||||||
|
"./tsconfig.node.json",
|
||||||
|
"./tsconfig.json"
|
||||||
|
],
|
||||||
|
"extraFileExtensions:": [
|
||||||
|
".mdx"
|
||||||
|
],
|
||||||
|
"extensions:": [
|
||||||
|
".mdx"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"browser": true,
|
||||||
|
"es2021": true
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"react": {
|
||||||
|
"version": "detect"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"no-console": "warn",
|
||||||
|
"no-self-assign": "warn",
|
||||||
|
"no-self-compare": "warn",
|
||||||
|
"complexity": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"max": 15
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"indent": [
|
||||||
|
"error",
|
||||||
|
2,
|
||||||
|
{
|
||||||
|
"SwitchCase": 1
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"no-dupe-keys": "error",
|
||||||
|
"no-invalid-regexp": "error",
|
||||||
|
"no-undef": "error",
|
||||||
|
"no-return-assign": "error",
|
||||||
|
"no-redeclare": "error",
|
||||||
|
"no-empty": "error",
|
||||||
|
"no-await-in-loop": "error",
|
||||||
|
"react/react-in-jsx-scope": 0,
|
||||||
|
"node/exports-style": [
|
||||||
|
"error",
|
||||||
|
"module.exports"
|
||||||
|
],
|
||||||
|
"node/file-extension-in-import": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"node/prefer-global/buffer": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"node/prefer-global/console": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"node/prefer-global/process": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"node/prefer-global/url-search-params": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"node/prefer-global/url": [
|
||||||
|
"error",
|
||||||
|
"always"
|
||||||
|
],
|
||||||
|
"node/prefer-promises/dns": "error",
|
||||||
|
"node/prefer-promises/fs": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -6,12 +6,29 @@ repos:
|
||||||
- id: eslint
|
- id: eslint
|
||||||
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
|
files: \.[jt]sx?$ # *.js, *.jsx, *.ts and *.tsx
|
||||||
types: [file]
|
types: [file]
|
||||||
|
args: ["--fix", "--no-warn-ignored"]
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
|
- eslint@9.1.1
|
||||||
- eslint-plugin-prettier
|
- eslint-plugin-prettier
|
||||||
- eslint-config-prettier
|
- eslint-config-prettier
|
||||||
- prettier
|
- prettier
|
||||||
- eslint-plugin-react@latest
|
- eslint-plugin-react@latest
|
||||||
- typescript-eslint
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.1.0
|
||||||
|
hooks:
|
||||||
|
- id: check-case-conflict
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: mixed-line-ending
|
||||||
|
args:
|
||||||
|
- --fix=lf
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: pretty-format-json
|
||||||
|
exclude: ^tsconfig.*.json
|
||||||
|
args:
|
||||||
|
- --autofix
|
||||||
|
- --indent=4
|
||||||
|
- --no-sort-keys
|
||||||
|
- id: check-merge-conflict
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
# Ruff version.
|
# Ruff version.
|
||||||
rev: v0.4.2
|
rev: v0.4.2
|
||||||
|
|
|
||||||
0
eslint.config.js
Normal file
0
eslint.config.js
Normal file
Loading…
Add table
Add a link
Reference in a new issue