Skip to content

Commit

Permalink
chore: enhance ESLint and Prettier configurations for consistent code…
Browse files Browse the repository at this point in the history
… style and add linting scripts
  • Loading branch information
wiirhan authored and ourai committed Jan 14, 2025
1 parent a0a32ad commit 18c8b4c
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,33 @@
{
"extends": [
"next/core-web-vitals" // Use next/core-web-vitals for best Next.js defaults
],
"extends": ["next/core-web-vitals"],
"rules": {
"unused-imports/no-unused-imports": "error",
"no-empty-function": "off", // Only if absolutely necessary
"no-empty-function": "error",
"object-shorthand": ["error", "always"],
"quotes": ["error", "single"],
"no-unused-vars": "warn", // Use "warn" instead of turning off completely
"no-unused-vars": "error",
"semi": ["warn", "always"],
"indent": ["error", 2],
"comma-dangle": ["warn", "always-multiline"],
"prefer-const": "error",
"arrow-parens": ["error", "as-needed"],
"eol-last": ["error", "always"],
"react/display-name": "off",
"react/no-unknown-property": "off",
"react/prop-types": "off"
"react/no-unknown-property": "off",
"react/prop-types": "off",
"jsx-quotes": ["error", "prefer-double"],
"react/self-closing-comp": [
"error",
{
"component": true,
"html": true
}
]
},
"plugins": ["unused-imports"],
"settings": {
"react": {
"version": "detect" // Automatically detect React version
"version": "detect"
}
}
}
}
10 changes: 10 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"singleQuote": true,
"trailingComma": "all",
"semi": true,
"tabWidth": 2,
"printWidth": 120,
"bracketSpacing": true,
"arrowParens": "avoid",
"endOfLine": "lf"
}
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
"analyze:browser": "cross-env BUNDLE_ANALYZE=browser next build",
"license": "node .knosys/scripts license add",
"doc": "node .knosys/scripts site",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint:fix": "eslint . --ext .js,.jsx,.ts,.tsx --fix",
"prepare": "husky"
},
"dependencies": {
Expand Down

0 comments on commit 18c8b4c

Please sign in to comment.