-
Notifications
You must be signed in to change notification settings - Fork 4
/
svelte.cjs
58 lines (56 loc) · 1.44 KB
/
svelte.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
'use strict';
const baseConfig = require('./base.cjs');
module.exports = {
...baseConfig,
extends: [
...baseConfig.extends,
'plugin:tailwindcss/recommended',
'plugin:svelte/recommended',
'plugin:svelte/prettier',
],
settings: {
tailwindcss: {
callees: ['classnames', 'cx'],
classRegex: '^(?:class|cx)$',
},
},
parserOptions: {
...baseConfig.parserOptions,
extraFileExtensions: ['.svelte'],
},
overrides: [
...baseConfig.overrides,
{
files: ['*.svelte'],
parser: 'svelte-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
},
rules: {
// Allows us to set option props to `undefined` by default
'no-undef-init': 'off',
},
},
// Rules for tests
{
files: ['**/__tests__/**', '**/*.test.ts', '**/*.spec.ts'],
extends: ['plugin:jest-dom/recommended', 'plugin:testing-library/dom'],
rules: {
'testing-library/await-async-events': [
'error',
{ eventModule: ['fireEvent', 'userEvent'] },
],
'testing-library/no-await-sync-events': 'off',
'testing-library/no-node-access': [
'error',
{ allowContainerFirstChild: true },
],
'testing-library/prefer-explicit-assert': [
'error',
{ assertion: 'toBeInTheDocument' },
],
'testing-library/prefer-user-event': 'error',
},
},
],
};