Skip to content

Commit e85fc7e

Browse files
committed
feat: add ESLint & Prettier configuration
1 parent 3377d28 commit e85fc7e

File tree

4 files changed

+94
-1
lines changed

4 files changed

+94
-1
lines changed

.eslintrc.cjs

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
es2021: true,
6+
node: true,
7+
},
8+
extends: [
9+
"eslint:recommended",
10+
"plugin:react/recommended",
11+
"plugin:react/jsx-runtime",
12+
"plugin:@typescript-eslint/recommended",
13+
"prettier",
14+
],
15+
parser: "@typescript-eslint/parser",
16+
parserOptions: {
17+
ecmaFeatures: {
18+
jsx: true,
19+
},
20+
ecmaVersion: "latest",
21+
sourceType: "module",
22+
},
23+
plugins: ["react", "@typescript-eslint", "prettier"],
24+
settings: {
25+
react: {
26+
version: "detect",
27+
},
28+
},
29+
rules: {
30+
"prettier/prettier": "error",
31+
"react/react-in-jsx-scope": "off",
32+
"react/prop-types": "off",
33+
"react/no-unknown-property": "off",
34+
"react/display-name": "off",
35+
"@typescript-eslint/no-unused-vars": "off",
36+
"@typescript-eslint/no-explicit-any": "off",
37+
"@typescript-eslint/no-var-requires": "off",
38+
"@typescript-eslint/no-require-imports": "off",
39+
"@typescript-eslint/ban-ts-comment": "off",
40+
"@typescript-eslint/no-empty-object-type": "off",
41+
"no-console": "off",
42+
"no-undef": "off",
43+
"no-useless-escape": "off",
44+
"no-prototype-builtins": "off",
45+
"no-constant-condition": "off",
46+
"no-misleading-character-class": "off",
47+
"react/no-unescaped-entities": "off",
48+
},
49+
ignorePatterns: [
50+
"node_modules/",
51+
"build/",
52+
".docusaurus/",
53+
".cache-loader/",
54+
"tmp/",
55+
"static/",
56+
"*.config.js",
57+
"babel.config.js",
58+
],
59+
};

.prettierignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Documentation
2+
docs/**/*.md
3+
docs/**/*.mdx
4+
blog/**/*.md
5+
blog/**/*.mdx
6+
*.md
7+
*.mdx
8+
9+
# Build outputs
10+
node_modules/
11+
build/
12+
.docusaurus/
13+
.cache-loader/
14+
tmp/
15+
16+
# Package files
17+
package-lock.json

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"singleQuote": false,
3+
"semi": true,
4+
"tabWidth": 2,
5+
"printWidth": 80
6+
}

package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,11 @@
1313
"serve": "docusaurus serve",
1414
"write-translations": "docusaurus write-translations",
1515
"write-heading-ids": "docusaurus write-heading-ids",
16-
"typecheck": "tsc"
16+
"typecheck": "tsc",
17+
"lint": "eslint . --ext .ts,.tsx,.js,.jsx",
18+
"lint:fix": "eslint . --ext .ts,.tsx,.js,.jsx --fix",
19+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css}\"",
20+
"format:check": "prettier --check ."
1721
},
1822
"dependencies": {
1923
"@docusaurus/core": "^3.9.1",
@@ -65,8 +69,15 @@
6569
"@types/canvas-confetti": "^1.9.0",
6670
"@types/react": "^19.1.9",
6771
"@types/react-dom": "^19.1.7",
72+
"@typescript-eslint/eslint-plugin": "^8.45.0",
73+
"@typescript-eslint/parser": "^8.45.0",
6874
"autoprefixer": "^10.4.21",
75+
"eslint": "^8.57.1",
76+
"eslint-config-prettier": "^10.1.8",
77+
"eslint-plugin-prettier": "^5.5.4",
78+
"eslint-plugin-react": "^7.37.5",
6979
"postcss": "^8.5.3",
80+
"prettier": "^3.6.2",
7081
"tailwindcss": "^4.1.4",
7182
"typescript": "~5.3"
7283
},

0 commit comments

Comments
 (0)