This repository has been archived by the owner on Aug 14, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 25
Feat(root): Apply Eslint and Integrate with Prettier #135
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
37a0aee
#115: setup code format on pre-commmit hook with husky and lint-staged
lqt93 b4e45d5
#115: create husky config
lqt93 007a83e
#119: setup eslint
lqt93 73ae8a1
Refactor(all): Adapt ESLint to current code
d20be3d
Merge remote-tracking branch 'upstream/main' into apply-eslint
af0ff97
Refactor(all): Apply ESLint and Prettier
a69e9f5
Merge remote-tracking branch 'upstream/main' into apply-eslint
2b3e183
Refactor(all): Format workflow file
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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,20 @@ | ||
{ | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:react/recommended", | ||
// prettier should be the last of extends to override other configs | ||
// more info: https://github.com/prettier/eslint-config-prettier | ||
"prettier" | ||
], | ||
"parserOptions": { | ||
"project": "./tsconfig.json" | ||
}, | ||
"rules": { | ||
"no-console": "warn" | ||
} | ||
} |
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,4 +1,4 @@ | ||
node_modules | ||
dist | ||
.DS_Store | ||
.idea | ||
.idea |
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 @@ | ||
_ |
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,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
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,21 @@ | ||
{ | ||
"name": "@moai/root", | ||
"scripts": { | ||
"lint": "eslint --ext .ts,.tsx,.js --ignore-path .gitignore .", | ||
"lint:fix": "eslint --fix --ext .ts,.tsx,.js --ignore-path .gitignore ." | ||
}, | ||
"lint-staged": { | ||
"*.{ts,tsx,js,css,json}": "prettier --write" | ||
}, | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "4.21.0", | ||
"@typescript-eslint/parser": "4.21.0", | ||
"eslint": "7.23.0", | ||
"eslint-config-prettier": "^8.1.0", | ||
"eslint-plugin-react": "7.23.2", | ||
"husky": "6.0.0", | ||
"lint-staged": "10.5.4", | ||
"prettier": "2.2.1", | ||
"typescript": "4.2.3" | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small note, for libraries that use universal config (i.e. "rc", "json", "js"), we prefer JS (because it has comment) or JSON (because vscode auto has schema for them). The "rc" one is quite limited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh wait I'm wrong! VSCode recognize .rc file!