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-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"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
|
2018-02-28 11:45:30 +00:00
|
|
|
// Swap the no-unused-expressions rule with a more chai-friendly one
|
|
|
|
"no-unused-expressions": 0,
|
|
|
|
"chai-friendly/no-unused-expressions": "error"
|
2019-08-07 14:04:04 +00:00
|
|
|
},
|
|
|
|
"overrides": [
|
|
|
|
{
|
|
|
|
"files": ["**/test/*/src/**/*.js"],
|
|
|
|
"rules": {
|
|
|
|
// 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",
|
|
|
|
"mocha/no-mocha-arrows": "error",
|
|
|
|
|
|
|
|
// chai-specific rules
|
|
|
|
"chai-expect/missing-assertion": "error",
|
|
|
|
"chai-expect/terminating-properties": "error",
|
|
|
|
|
|
|
|
// prefer-arrow-callback applies to all callbacks, not just ones in mocha tests.
|
|
|
|
// we don't enforce this at the top-level - just in tests to manage `this` scope
|
|
|
|
// based on mocha's context mechanism
|
|
|
|
"mocha/prefer-arrow-callback": "error"
|
|
|
|
}
|
2019-08-09 09:39:26 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
// don't allow console.log in backend code
|
|
|
|
"files": ["**/app/*/src/**/*.js"],
|
|
|
|
"rules": {
|
|
|
|
"no-console": "error"
|
|
|
|
}
|
2019-08-07 14:04:04 +00:00
|
|
|
}
|
|
|
|
]
|
2018-03-02 16:06:48 +00:00
|
|
|
}
|