1 | /* eslint sort-keys: ["error", "asc"], quote-props: ["error", "consistent"] */
|
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 | // In test scenarios this kind of module pattern is more usual
|
23 | "import/no-unassigned-import": "off",
|
24 | // Long tests are not necessarily a problem, but there is a certain limit
|
25 | "max-lines": "off",
|
26 | // mocha blocks are nested all the way down
|
27 | "max-nested-callbacks": "off",
|
28 | // Can increase the readability of a test if simple mocking functions are in one line
|
29 | "max-statements-per-line": ["warn", { max: 2 }],
|
30 | // Allows empty catch blocks in try clauses
|
31 | "no-empty": "off",
|
32 | // If you want to test for thrown errors in a constructor function, it's common to ignore the result
|
33 | // @see https://github.com/peerigon/clockodo/pull/1#discussion_r180795825
|
34 | "no-new": "off",
|
35 | "quotes": ["warn", "double", {
|
36 | ...options["quotes"],
|
37 | // Allow Jest inline snapshots
|
38 | allowTemplateLiterals: true,
|
39 | }],
|
40 | // Storybook stories export a default config object which gets used by their pipeline
|
41 | "import/no-anonymous-default-export": "off"
|
42 | }
|
43 | };
|