eslint
config for VAS projects based on react-app
and standard
If using create-react-app
:
- Add as
devDependency
yarn add --dev @vas-dev/eslint-config
- Add to
package.json
"eslintConfig": { "extends": "@vas-dev" },
If not using create-react-app
:
- Add dependencies
yarn add --dev eslint babel-eslint eslint-config-react-app eslint-plugin-flowtype eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react eslint-plugin-react-hooks
- Add to
package.json
"eslintConfig": { "extends": "@vas-dev" },
"no-console": "error",
"object-curly-spacing": ["error", "always"],
"react-hooks/rules-of-hooks": "error",
"prefer-promise-reject-errors": "off",
"jest/consistent-test-it": ["error", { "fn": "it" }],
"jest/no-empty-title": "error",
"jest/no-truthy-falsy": "error",
"jest/no-test-return-statement": "error",
"jest/no-test-callback": "error",
"jest/prefer-to-be-null": "error",
"jest/prefer-to-be-undefined": "error",
"jest/prefer-to-have-length": "error",
"jest/prefer-to-contain": "error",
"jest-formatting/padding-before-test-blocks": "error",
"jest-formatting/padding-before-describe-blocks": "error"