This commit is contained in:
Manav Rathi
2024-06-03 14:45:11 +05:30
parent ff29bda5ac
commit c91b0e4d3e
3 changed files with 60 additions and 5 deletions

View File

@@ -1,3 +1,38 @@
/* eslint-env node */
module.exports = {
extends: ["@/build-config/eslintrc-vite"],
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:react/jsx-runtime",
],
plugins: ["@typescript-eslint", "react-refresh"],
parserOptions: { project: true },
parser: "@typescript-eslint/parser",
ignorePatterns: [".eslintrc.cjs", "vite.config.ts", "dist"],
settings: { react: { version: "18.2" } },
rules: {
/* Allow numbers to be used in template literals */
"@typescript-eslint/restrict-template-expressions": [
"error",
{
allowNumber: true,
},
],
/* Allow void expressions as the entire body of an arrow function */
"@typescript-eslint/no-confusing-void-expression": [
"error",
{
ignoreArrowShorthand: true,
},
],
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
};

View File

@@ -0,0 +1,8 @@
{
"tabWidth": 4,
"proseWrap": "always",
"plugins": [
"prettier-plugin-organize-imports",
"prettier-plugin-packagejson"
]
}

View File

@@ -6,7 +6,9 @@
"scripts": {
"build": "tsc && vite build",
"dev": "vite",
"preview": "vite preview"
"preview": "vite preview",
"lint": "yarn prettier --check --log-level warn . && yarn eslint && yarn tsc",
"lint-fix": "yarn prettier --write --log-level warn . && yarn eslint --fix && yarn tsc"
},
"dependencies": {
"react": "^18",
@@ -14,10 +16,20 @@
"zod": "^3"
},
"devDependencies": {
"@/build-config": "*",
"@types/react": "^18",
"@types/react-dom": "^18",
"@vitejs/plugin-react": "^4.2",
"vite": "^5.2"
}
"vite": "^5.2",
"eslint": "^8",
"prettier": "^3",
"typescript": "^5",
"@typescript-eslint/eslint-plugin": "^7",
"@typescript-eslint/parser": "^7",
"eslint-plugin-react": "^7.34",
"eslint-plugin-react-hooks": "^4.6",
"eslint-plugin-react-refresh": "^0.4.7",
"prettier-plugin-organize-imports": "^3.2",
"prettier-plugin-packagejson": "^2.5"
},
"packageManager": "yarn@1.22.21"
}