-
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.
Merge pull request #38 from bento-platform/lint/prettier-eslint
lint: update eslint, add + run prettier, add commitlint
- Loading branch information
Showing
18 changed files
with
2,584 additions
and
1,145 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
{ | ||
"tabWidth": 4, | ||
"printWidth": 120 | ||
} |
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 +1,25 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] }; | ||
export default { | ||
extends: ["@commitlint/config-conventional"], | ||
rules: { | ||
"type-enum": [ | ||
2, | ||
"always", | ||
[ | ||
// default set: | ||
"build", | ||
"chore", | ||
"ci", | ||
"docs", | ||
"feat", | ||
"fix", | ||
"perf", | ||
"refactor", | ||
"revert", | ||
"style", | ||
"test", | ||
// bento added: | ||
"lint", | ||
], | ||
], | ||
}, | ||
}; |
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,46 @@ | ||
import globals from "globals"; | ||
import js from "@eslint/js"; | ||
|
||
// Parser | ||
import tsParser from "@typescript-eslint/parser"; | ||
|
||
// Plugins | ||
import tsEsLint from "typescript-eslint"; | ||
import react from "eslint-plugin-react"; | ||
import reactHooksEsLint from "eslint-plugin-react-hooks"; | ||
import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended"; | ||
import prettier from "eslint-plugin-prettier"; | ||
|
||
export default [ | ||
js.configs.recommended, | ||
...tsEsLint.configs.recommended, | ||
react.configs.flat.recommended, | ||
react.configs.flat["jsx-runtime"], | ||
eslintPluginPrettierRecommended, | ||
{ | ||
languageOptions: { | ||
ecmaVersion: "latest", | ||
sourceType: "module", | ||
globals: { ...globals.browser, ...globals.es2021 }, | ||
parser: tsParser, | ||
}, | ||
files: ["src/**/*.ts", "src/**/*.tsx", "src/**/*.js", "src/**/*.jsx"], | ||
plugins: { | ||
react, | ||
"react-hooks": reactHooksEsLint, | ||
prettier, | ||
}, | ||
|
||
settings: { | ||
react: { | ||
version: "detect", | ||
}, | ||
}, | ||
rules: { | ||
"prettier/prettier": "error", | ||
"react/prop-types": "off", | ||
semi: [2, "always"], | ||
...reactHooksEsLint.configs.recommended.rules, | ||
}, | ||
}, | ||
]; |
Oops, something went wrong.