Skip to content

Commit

Permalink
Set up ESLint and Prettier (#12)
Browse files Browse the repository at this point in the history
* Set up Prettier

* Set up ESLint

* Create .editorconfig

* Create pre-commit hook

* chore: add eslint rules link
  • Loading branch information
araujogui authored Jun 10, 2024
1 parent 7290e52 commit fc6f737
Show file tree
Hide file tree
Showing 7 changed files with 1,817 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 80
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx,mjs}": ["eslint --fix", "prettier --write"],
"*.{json,yml}": ["prettier --write"]
}
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"jsxSingleQuote": false,
"trailingComma": "es5",
"bracketSpacing": true,
"bracketSameLine": false,
"arrowParens": "avoid"
}
10 changes: 10 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pluginJs from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
import globals from 'globals';

export default [
{ languageOptions: { globals: globals.browser } },
// Visit https://eslint.org/docs/latest/rules to learn more about these rules
pluginJs.configs.recommended,
eslintConfigPrettier,
];
Loading

0 comments on commit fc6f737

Please sign in to comment.