Skip to content

Commit

Permalink
feat: opt lint config
Browse files Browse the repository at this point in the history
  • Loading branch information
MatchaDog committed Aug 12, 2020
1 parent ed1e2e7 commit 8a269ee
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
extends: ["@commitlint/config-conventional"]
}
21 changes: 18 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
{
"plugins": ["react-hooks"],
"root": true,
"env": {
"es6": true,
"node": true
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"sourceType": "module"
},
"plugins": ["react-hooks", "@typescript-eslint"],
"rules": {
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-unused-vars": ["off"],
"@typescript-eslint/no-empty-interface": "warn",
"@typescript-eslint/ban-types": ["warn"],
"@typescript-eslint/no-explicit-any": ["off"],
"@typescript-eslint/no-empty-function": "warn"
},
"parser": "babel-eslint"
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"]
}
6 changes: 6 additions & 0 deletions .huskyrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -e $HUSKY_GIT_PARAMS"
}
}
3 changes: 3 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"src/**/*.{tsx,ts}": ["eslint --fix", "prettier --write"]
}
4 changes: 4 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
/hooooks_doc
/dist

.commitlintrc
.huskyrc
.lintstagedrc
.umirc.ts
.prettierrc
.eslintrc
Expand All @@ -11,6 +14,7 @@ webpack.config.js
package.json

yarn.lock
yarn-error.log

npm-debug.log*
yarn-debug.log*
Expand Down
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@
"semi": true,
"singleQuote": false,
"arrowParens": "always",
"jsxBracketSameLine": true
"jsxBracketSameLine": true,
"printWidth": 120
}
9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,17 @@
"react-dom": "^16.13.1"
},
"devDependencies": {
"eslint-plugin-react-hooks": "^3.0.0",
"@commitlint/cli": "^9.1.1",
"@commitlint/config-conventional": "^9.1.1",
"@typescript-eslint/eslint-plugin": "^3.9.0",
"@typescript-eslint/parser": "^3.9.0",
"eslint": "^7.6.0",
"eslint-plugin-react-hooks": "^4.0.8",
"gulp": "^4.0.2",
"gulp-cli": "^2.3.0",
"gulp-typescript": "^6.0.0-alpha.1",
"husky": "^4.2.5",
"lint-staged": "^10.2.11",
"ts-import-plugin": "^1.6.2",
"ts-loader": "^6.2.1",
"typescript": "^3.9.5",
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"compilerOptions": {
"baseUrl": ".",
"outDir": "build",
"declarationDir": "build",
"target": "ES2019",
"lib": ["es6", "dom"],
"module": "commonjs",
Expand All @@ -13,7 +12,7 @@
"strict": true,
"removeComments": true,
"allowSyntheticDefaultImports": true,
"declaration": true,
"declaration": false,
"paths": {
"@/*": ["src/*"]
}
Expand Down

0 comments on commit 8a269ee

Please sign in to comment.