Skip to content

Instantly share code, notes, and snippets.

@favasconcelos
Last active May 31, 2020 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save favasconcelos/05635160a9dea27761ad865897e3e8eb to your computer and use it in GitHub Desktop.
Save favasconcelos/05635160a9dea27761ad865897e3e8eb to your computer and use it in GitHub Desktop.
Frontend project configs files.
Frontend configuration files
BROWSER=none
module.exports = {
extends: ['react-app', 'eslint:recommended', 'plugin:react/recommended'],
plugins: ['react-hooks'],
parser: 'babel-eslint',
rules: {
'no-invalid-this': 'error',
'object-curly-spacing': ['error', 'always'],
'linebreak-style': ['error', 'unix'],
'arrow-parens': ['error', 'as-needed'],
'space-before-function-paren': 'off',
'max-len': ['warn', { ignoreComments: true, ignoreStrings: true, code: 180, tabWidth: 4 }],
'no-duplicate-imports': ['error', { includeExports: true }],
'no-unused-vars': ['error', { vars: 'all', args: 'all', argsIgnorePattern: '^_', caughtErrors: 'all', caughtErrorsIgnorePattern: '^ignore' }],
// react
'react/no-deprecated': 'warn',
'react/jsx-uses-vars': 'error',
// react-hooks
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
env: {
node: true,
es6: true,
browser: true,
commonjs: true,
jest: true,
},
parserOptions: {
ecmaVersion: 2018,
},
};
{
"dataSource": "commits",
"prefix": "",
"includeMessages": "all",
"changelogFilename": "CHANGELOG.md"
}
{
"printWidth": 180,
"singleQuote": true,
"tabWidth": 2,
"useTabs": false,
"trailingComma": "all",
"bracketSpacing": true,
"semi": true,
"arrowParens": "avoid",
"jsxBracketSameLine": true,
"jsxSingleQuote": false
}
{
"devDependencies": {
"eslint-plugin-react-hooks": "1.5.0",
"husky": "1.3.1",
"lint-staged": "8.1.5",
"prettier": "1.16.4"
},
"scripts": {
// ...
"test": "react-scripts test --watchAll=false",
"lint": "eslint"
// ...
},
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"*.{js,json,css,md}": [
"prettier --write"
]
}
}
{
"extends": ["github>favasconcelos/renovate-config"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment