Skip to content

Commit

Permalink
:add: Added Eslint and Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
mluizvitor committed May 6, 2022
1 parent 266a5e3 commit 933ce50
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 0 deletions.
59 changes: 59 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"prettier"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "@typescript-eslint"],
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"quotes": ["error", "single"],
"jsx-quotes": ["error", "prefer-single"],
"semi": ["error", "always"],
"react/react-in-jsx-scope": "off",
"react/jsx-max-props-per-line": [
1,
{ "maximum": { "single": 1, "multi": 1 } }
],

"no-case-declarations": "off",
"function-paren-newline": ["error", "multiline-arguments"],
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
"react/self-closing-comp": [
"error",
{
"component": true,
"html": true
}
],
"no-multiple-empty-lines": "error",
"react/jsx-curly-brace-presence": [
1,
{ "children": "always", "props": "never", "propElementValues": "always" }
],
"comma-dangle": [
"error",
{
"arrays": "never",
"objects": "always-multiline",
"imports": "never",
"exports": "never",
"functions": "never"
}
]
}
}
10 changes: 10 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@
"@babel/core": "^7.12.9",
"@types/react": "~17.0.21",
"@types/react-native": "~0.64.12",
"@typescript-eslint/eslint-plugin": "^5.22.0",
"@typescript-eslint/parser": "^5.22.0",
"eslint": "^8.14.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.29.4",
"eslint-plugin-react-hooks": "^4.5.0",
"prettier": "^2.6.2",
"typescript": "~4.3.5"
},
"private": true
Expand Down
3 changes: 3 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const singleQuote = false;
export const trailingComma = 'all';
export const allowParens = 'avoid';

0 comments on commit 933ce50

Please sign in to comment.