docbrown/app/javascript/.eslintrc.js
Hoang Vo 293ba5231b Fix eslint issues in app/javascript/listings (#4253)
* Fix some eslint and a11y issues

* Add a11y fixed to snapshot

* Fix missing whitespace that cause test fail

* Fix code duplicate

* Config eslint to allows the label as a sibling

* Use 'error' instead of 2 in eslintrc

* Correct propTypes in SingleListing

* Add missing id prop for select

* Add space between two functions

* onKeyPress only register Enter

* Allow space key also to activate action

* Use a common function for three event handlers
2019-10-14 14:23:20 -04:00

42 lines
863 B
JavaScript

module.exports = {
parser: 'babel-eslint',
extends: ['airbnb', 'prettier', 'plugin:jsx-a11y/recommended'],
parserOptions: {
ecmaVersion: 2017,
},
settings: {
react: {
pragma: 'h',
},
},
env: {
jest: true,
browser: true,
},
plugins: ['import', 'jsx-a11y'],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
devDependencies: ['**/*.test.js', '**/*.test.jsx', '**/*.stories.jsx'],
},
],
'import/prefer-default-export': 'off',
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'jsx-a11y/label-has-associated-control': [
'error',
{
required: {
some: ['nesting', 'id'],
},
},
],
},
globals: {
InstantClick: false,
filterXSS: false,
Pusher: false,
algoliasearch: false,
ga: false,
},
};