-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
config: configure lint and pre-commit hooks
- Loading branch information
1 parent
2a1bf31
commit 038c559
Showing
25 changed files
with
2,244 additions
and
821 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,54 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
"extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended", "prettier"], | ||
"rules": { | ||
"react/display-name": "off", | ||
"@next/next/no-img-element": "off", | ||
"react/no-unescaped-entities": "off", | ||
"import/no-anonymous-default-export": "off", | ||
"@typescript-eslint/no-unused-vars": "error", | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"@typescript-eslint/no-explicit-any": "off", | ||
"@typescript-eslint/no-non-null-assertion": "off", | ||
"@typescript-eslint/explicit-function-return-type": "error", | ||
"comma-dangle": ["error", "always-multiline"], | ||
|
||
// add new line above return | ||
"newline-before-return": "error", | ||
// add new line below import | ||
"import/newline-after-import": [ | ||
"error", | ||
{ | ||
"count": 1 | ||
} | ||
], | ||
"@typescript-eslint/ban-types": [ | ||
"error", | ||
{ | ||
"extendDefaults": true, | ||
"types": { | ||
"{}": false | ||
} | ||
} | ||
] | ||
}, | ||
"plugins": ["import"], | ||
"settings": { | ||
"import/parsers": { | ||
"@typescript-eslint/parser": [".ts", ".tsx"] | ||
}, | ||
"import/resolver": { | ||
"typescript": { | ||
"alwaysTryTypes": true, | ||
"project": ["./tsconfig.json"] | ||
} | ||
} | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": ["src/iconify-bundle/*"], | ||
"rules": { | ||
"@typescript-eslint/no-var-requires": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
echo '🔍 Preparing to commit: Running code analysis and build process...' | ||
|
||
# Check code formatting using Prettier | ||
pnpm check-format || | ||
( | ||
echo '🔴 Prettier Check Failed: Your code styling does not meet the standards. | ||
Please run "pnpm format", add the changes, and then reattempt the commit.'; | ||
false; | ||
) | ||
|
||
# Check code quality using ESLint | ||
pnpm check-lint || | ||
( | ||
echo '🔴 ESLint Check Failed: Your code contains quality issues that need to be addressed. | ||
Review the listed problems, make the necessary changes, and try committing again.' | ||
false; | ||
) | ||
|
||
# Validate TypeScript type correctness | ||
pnpm check-types || | ||
( | ||
echo '🔴 Type Check Failed: There are issues with the TypeScript type correctness. | ||
Please resolve the indicated problems before proceeding.' | ||
false; | ||
) | ||
|
||
# If all checks pass, proceed to build | ||
echo '📦 Building the project...' | ||
|
||
pnpm build || | ||
( | ||
echo '🔴 Build Failed: The project failed to build properly. | ||
Examine the error messages above for insights into the issues.' | ||
false; | ||
) | ||
|
||
# If all checks and build pass, proceed to commit | ||
echo '✅ All checks passed. Committing changes...' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
module.exports = { | ||
arrowParens: 'avoid', | ||
bracketSpacing: true, | ||
htmlWhitespaceSensitivity: 'css', | ||
insertPragma: false, | ||
bracketSameLine: false, | ||
jsxSingleQuote: true, | ||
printWidth: 100, | ||
proseWrap: 'preserve', | ||
quoteProps: 'as-needed', | ||
requirePragma: false, | ||
semi: true, | ||
singleQuote: true, | ||
tabWidth: 2, | ||
trailingComma: 'all', | ||
useTabs: false, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
export { default as ActiveColorBox } from "./active"; | ||
export { default as InactiveColorBox } from "./disabled"; | ||
export { default as ActiveColorBox } from './active'; | ||
export { default as InactiveColorBox } from './disabled'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.