1 | /* eslint sort-keys: ["error", "asc"] */
|
2 | /* eslint-disable sort-keys */
|
3 |
|
4 | const options = require("./options.js");
|
5 |
|
6 | module.exports = {
|
7 | env: {
|
8 | mocha: true,
|
9 | jest: true,
|
10 | },
|
11 | globals: {
|
12 | cy: true,
|
13 | Cypress: true,
|
14 | assert: true,
|
15 | },
|
16 | rules: {
|
17 | /* eslint-enable sort-keys */
|
18 | // chai uses these as assertions
|
19 | "@babel/no-unused-expressions": "off",
|
20 | // In order to make mocks more condensed, single line blocks are allowed in tests
|
21 | "brace-style": ["warn", "1tbs", { allowSingleLine: true }],
|
22 | // Storybook stories export a default config object which gets used by their pipeline
|
23 | "import/no-anonymous-default-export": "off",
|
24 | // In test scenarios this kind of module pattern is more usual
|
25 | "import/no-unassigned-import": "off",
|
26 | // Long tests are not necessarily a problem, but there is a certain limit
|
27 | "max-lines": "off",
|
28 | // mocha blocks are nested all the way down
|
29 | "max-nested-callbacks": "off",
|
30 | // Can increase the readability of a test if simple mocking functions are in one line
|
31 | "max-statements-per-line": ["warn", { max: 2 }],
|
32 | // Allows empty catch blocks in try clauses
|
33 | "no-empty": "off",
|
34 | // If you want to test for thrown errors in a constructor function, it's common to ignore the result
|
35 | // @see https://github.com/peerigon/clockodo/pull/1#discussion_r180795825
|
36 | "no-new": "off",
|
37 | quotes: [
|
38 | "warn",
|
39 | "double",
|
40 | {
|
41 | ...options["quotes"],
|
42 | // Allow Jest inline snapshots
|
43 | allowTemplateLiterals: true,
|
44 | },
|
45 | ],
|
46 | },
|
47 | };
|