Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #575: Change ESlint configuration to accept React #578

Merged
merged 1 commit into from Jan 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 15 additions & 8 deletions .eslintrc.js
@@ -1,16 +1,22 @@
module.exports = {
extends: ['airbnb-base', 'prettier', 'plugin:promise/recommended'],
plugins: ['prettier', 'promise'],
extends: ['airbnb-base', 'prettier', 'plugin:promise/recommended', 'plugin:react/recommended'],

plugins: ['prettier', 'promise', 'react'],

env: {
jest: true,
browser: true,
jquery: true,
node: true,
es2017: true,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
rules: {
'prettier/prettier': ['error'],

/**
* Disallow the use of console
* https://eslint.org/docs/rules/no-console
Expand All @@ -27,13 +33,11 @@ module.exports = {
* https://eslint.org/docs/rules/no-return-await
*/
'no-return-await': ['error'],

/**
* Disallow using an async function as a Promise executor
* https://eslint.org/docs/rules/no-async-promise-executor
*/
'no-async-promise-executor': ['error'],

/**
* Disallow await inside of loops
* https://eslint.org/docs/rules/no-await-in-loop
Expand All @@ -58,18 +62,15 @@ module.exports = {
* https://eslint.org/docs/rules/func-names
*/
'func-names': 'off',

/**
* Disallow enforcement of consistent linebreak style
* https://eslint.org/docs/rules/func-names
*/
'linebreak-style': 'off',

/**
* The following are eslint rules from the promise-plugin
* https://github.com/xjamundx/eslint-plugin-promise
*/

/**
* Prefer wait to then() for reading Promise values
*/
Expand All @@ -79,5 +80,11 @@ module.exports = {
* Prefer async/await to the callback pattern
*/
'promise/prefer-await-to-callbacks': 'warn',

'react/jsx-uses-react': 'error',

'react/jsx-uses-vars': 'error',

'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
},
};
2 changes: 2 additions & 0 deletions package.json
Expand Up @@ -77,6 +77,7 @@
"passport-saml": "1.2.0",
"pino": "5.13.6",
"pino-pretty": "3.4.0",
"react": "16.12.0",
"reading-level": "0.0.7",
"sanitize-html": "1.20.1",
"sentiment": "5.0.2",
Expand All @@ -93,6 +94,7 @@
"eslint-plugin-import": "2.18.2",
"eslint-plugin-prettier": "3.1.1",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-react": "7.18.0",
"hint": "6.0.0",
"husky": "3.1.0",
"jest": "24.9.0",
Expand Down