2018-02-22 19:25:26 +00:00
|
|
|
{
|
2018-10-30 10:03:05 +00:00
|
|
|
"extends": [
|
|
|
|
"standard",
|
|
|
|
"standard-react",
|
2018-11-05 10:06:39 +00:00
|
|
|
"prettier",
|
|
|
|
"prettier/react",
|
|
|
|
"prettier/standard",
|
2018-10-30 10:03:05 +00:00
|
|
|
"plugin:jsx-a11y/recommended"
|
|
|
|
],
|
2018-02-28 11:45:30 +00:00
|
|
|
"plugins": [
|
2018-10-30 10:03:05 +00:00
|
|
|
"jsx-a11y",
|
|
|
|
"mocha",
|
2018-02-28 11:45:30 +00:00
|
|
|
"chai-expect",
|
|
|
|
"chai-friendly"
|
|
|
|
],
|
2018-02-27 11:19:40 +00:00
|
|
|
"env": {
|
2019-03-07 15:29:59 +00:00
|
|
|
"browser": true,
|
2018-02-27 11:19:40 +00:00
|
|
|
"mocha": true
|
|
|
|
},
|
|
|
|
"globals": {
|
2018-11-13 10:34:27 +00:00
|
|
|
"expect": true,
|
|
|
|
"define": true,
|
|
|
|
"$": true,
|
|
|
|
"angular": true,
|
|
|
|
// Injected in layout.pug
|
2019-01-30 13:50:04 +00:00
|
|
|
"user_id": true,
|
|
|
|
"ace": true
|
2018-02-28 11:45:30 +00:00
|
|
|
},
|
2018-10-30 10:03:05 +00:00
|
|
|
"settings": {
|
2019-01-17 09:52:07 +00:00
|
|
|
// Tell eslint-plugin-react to detect which version of React we are using
|
2018-10-30 10:03:05 +00:00
|
|
|
"react": {
|
2019-01-17 09:52:07 +00:00
|
|
|
"version": "detect"
|
2018-10-30 10:03:05 +00:00
|
|
|
}
|
|
|
|
},
|
2018-02-28 11:45:30 +00:00
|
|
|
"rules": {
|
2018-03-02 10:05:30 +00:00
|
|
|
"max-len": ["error", {
|
2018-10-30 10:03:05 +00:00
|
|
|
"ignoreUrls": true,
|
2018-11-05 10:06:39 +00:00
|
|
|
// Ignore long describe/it test blocks, long import/require statements
|
|
|
|
"ignorePattern": "(^\\s*(it|describe)\\s*\\(['\"]|^import\\s*.*\\s*from\\s*['\"]|^.*\\s*=\\s*require\\(['\"])"
|
2018-03-02 10:05:30 +00:00
|
|
|
}],
|
2018-02-28 12:15:24 +00:00
|
|
|
|
2018-11-05 10:06:39 +00:00
|
|
|
// Fix conflict between prettier & standard by overriding to prefer
|
|
|
|
// double quotes
|
|
|
|
"jsx-quotes": ["error", "prefer-double"],
|
|
|
|
|
2018-10-30 10:03:05 +00:00
|
|
|
// Override weird behaviour of jsx-a11y label-has-for (says labels must be
|
|
|
|
// nested *and* have for/id attributes)
|
|
|
|
"jsx-a11y/label-has-for": [
|
|
|
|
"error",
|
|
|
|
{
|
|
|
|
"required": {
|
|
|
|
"some": [
|
|
|
|
"nesting",
|
|
|
|
"id"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
|
|
|
|
// Add some mocha specific rules
|
|
|
|
"mocha/handle-done-callback": "error",
|
|
|
|
"mocha/no-exclusive-tests": "error",
|
|
|
|
"mocha/no-global-tests": "error",
|
|
|
|
"mocha/no-identical-title": "error",
|
|
|
|
"mocha/no-nested-tests": "error",
|
|
|
|
"mocha/no-pending-tests": "error",
|
|
|
|
"mocha/no-skipped-tests": "error",
|
|
|
|
|
2018-02-28 11:45:30 +00:00
|
|
|
// Add some chai specific rules
|
|
|
|
"chai-expect/missing-assertion": "error",
|
|
|
|
"chai-expect/terminating-properties": "error",
|
|
|
|
// Swap the no-unused-expressions rule with a more chai-friendly one
|
|
|
|
"no-unused-expressions": 0,
|
|
|
|
"chai-friendly/no-unused-expressions": "error"
|
2018-02-27 11:19:40 +00:00
|
|
|
}
|
2018-03-02 16:06:48 +00:00
|
|
|
}
|