Skip to content

Commit

Permalink
Added initial config for eslint, prettier, styled-components
Browse files Browse the repository at this point in the history
  • Loading branch information
Hernan Clich committed Jul 1, 2021
1 parent 25ba4a4 commit 0249bac
Show file tree
Hide file tree
Showing 16 changed files with 1,692 additions and 225 deletions.
4 changes: 4 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"presets": ["next/babel"],
"plugins": [["styled-components", { "ssr": true }]]
}
62 changes: 60 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,61 @@
{
"extends": ["next", "next/core-web-vitals"]
}
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module",
"ecmaFeatures": {
"jsx": true
}
},
"settings": {
"react": {
"version": "detect"
},
"import/resolver": {
"typescript": {
"project": "."
}
}
},
"env": {
"browser": true,
"es2020": true,
"node": true
},
"extends": [
"eslint:recommended",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:prettier/recommended"
],
"plugins": ["@typescript-eslint", "react", "simple-import-sort"],
"ignorePatterns": ["node_modules/", ".next/"],
"rules": {
// General
"indent": ["warn", 2],
"no-console": "warn",
"no-multi-spaces": "warn",
"strict": "off",

//React
"jsx-a11y/anchor-is-valid": [
"error",
{
"components": ["Link"],
"specialLink": ["hrefLeft", "hrefRight"],
"aspects": ["invalidHref", "preferButton"]
}
],
"react/react-in-jsx-scope": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-unused-vars": 0,
"@typescript-eslint/no-unused-vars": ["error", { "argsIgnorePattern": "^_" }],

// Prettier
"prettier/prettier": ["error", {}, { "usePrettierrc": true }]
}
}
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
next-i18next.config.js
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"jsxBracketSameLine": true,
"printWidth": 100,
"semi": true,
"singleQuote": true,
"trailingComma": "none" ,
"arrowParens": "always",
"tabWidth": 2
}
4 changes: 2 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
reactStrictMode: true,
}
reactStrictMode: true
};
Loading

0 comments on commit 0249bac

Please sign in to comment.