-
Notifications
You must be signed in to change notification settings - Fork 901
/
Copy patheslint.config.mjs
38 lines (37 loc) · 1.12 KB
/
eslint.config.mjs
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
// @ts-check
import * as react from '@chance/eslint/react';
import * as js from '@chance/eslint';
import * as typescript from '@chance/eslint/typescript';
import { globals } from '@chance/eslint/globals';
import storybook from 'eslint-plugin-storybook';
import pluginCypress from 'eslint-plugin-cypress/flat';
/** @type {import("eslint").Linter.Config[]} */
export default [
{ ...js.getConfig({ ...globals.node, ...globals.browser }) },
typescript.config,
{
...react.config,
rules: {
...react.rules,
'react/jsx-pascal-case': ['warn', { allowNamespace: true }],
// TODO: enable this and fix all the errors
'react/display-name': 'off',
'prefer-const': ['warn', { destructuring: 'all' }],
'jsx-a11y/label-has-associated-control': [
'warn',
{
controlComponents: ['Checkbox'],
depth: 3,
},
],
},
},
...storybook.configs['flat/recommended'],
{ ...pluginCypress.configs.recommended, files: ['cypress/**/*.cy.ts'] },
{
ignores: ['dist/**', '.next/**'],
rules: {
'prefer-const': ['warn', { destructuring: 'all' }],
},
},
];