Skip to content

Commit

Permalink
Merge pull request #192 from panntod/development
Browse files Browse the repository at this point in the history
Eslint rule and Refactor format file
  • Loading branch information
ahsanzizan authored Jun 5, 2024
2 parents d77faf7 + 35ff325 commit b92af02
Show file tree
Hide file tree
Showing 120 changed files with 1,339 additions and 491 deletions.
137 changes: 135 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,143 @@
{
"extends": ["next", "next/core-web-vitals", "eslint:recommended"],
"root": true,
"env": {
"browser": true,
"es2021": true,
"node": true
},
"globals": {
"React": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"react",
"jsx-a11y",
"@typescript-eslint",
"import",
"react-hooks",
"prettier"
],
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jsx-a11y/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:react-hooks/recommended",
"next",
"next/core-web-vitals",
"plugin:prettier/recommended"
],
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"node": {
"extensions": [".ts", ".tsx"]
}
}
},
"overrides": [
{
"files": [
"./src/pages/**/*.{js,ts,jsx,tsx,mdx}",
"./src/_components/**/*.{js,ts,jsx,tsx,mdx}",
"./src/app/**/*.{js,ts,jsx,tsx,mdx}"
],
"rules": {
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
["parent", "sibling"],
"index",
"object",
"type"
],
"pathGroups": [
{
"pattern": "./**/**\\.css",
"group": "type",
"position": "after"
}
],
"pathGroupsExcludedImportTypes": ["builtin"],
"alphabetize": {
"order": "asc",
"caseInsensitive": true
},
"newlines-between": "always",
"warnOnUnassignedImports": true
}
]
}
}
],
"rules": {
"prettier/prettier": "error",
"react/react-in-jsx-scope": "off",
"import/order": [
"error",
{
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type"
],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
}
],
"jsx-a11y/anchor-is-valid": [
"error",
{
"aspects": ["invalidHref", "preferButton"]
}
],
"@typescript-eslint/explicit-function-return-type": [
"off",
{
"allowExpressions": true,
"allowTypedFunctionExpressions": true
}
],
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/no-unused-vars": [
"warn",
{
"argsIgnorePattern": "^_"
}
],
"jsx-a11y/click-events-have-key-events": "off",
"jsx-a11y/no-noninteractive-element-interactions": "off",
"jsx-a11y/no-static-element-interactions": "off",
"no-unused-vars": "off",
"no-unused-expressions": "warn"
"no-unused-expressions": "warn",
"quotes": [
"error",
"double",
{
"avoidEscape": true
}
],
"comma-dangle": ["error", "always-multiline"]
}
}
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npm run lint && npm run prettier
npm run lint:fix && npm run prettier
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.next
node_modules
package.json
package.json
package-lock.json
5 changes: 4 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"tabWidth": 2,
"semi": true,
"singleQuote": false
"singleQuote": false,
"trailingComma": "all",
"printWidth": 80,
"endOfLine": "lf"
}
7 changes: 7 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"recommendations": [
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode"
]
}
9 changes: 9 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"css.validate": false,
"scss.validate": false
}
Loading

0 comments on commit b92af02

Please sign in to comment.