-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy patheslint.config.js
More file actions
104 lines (97 loc) · 2.99 KB
/
Copy patheslint.config.js
File metadata and controls
104 lines (97 loc) · 2.99 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import react from 'eslint-plugin-react';
import reactHooks from 'eslint-plugin-react-hooks';
import jsxA11y from 'eslint-plugin-jsx-a11y';
import testingLibrary from 'eslint-plugin-testing-library';
import jestDom from 'eslint-plugin-jest-dom';
import prettierConfig from 'eslint-config-prettier';
export default [
{
files: ['**/*.ts', '**/*.tsx', '**/*.js', '**/*.jsx'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: tsParser,
globals: {
...globals.node,
...globals.browser,
...globals.jest, // Jest global declarations
shopify: 'readonly',
},
},
plugins: {
'@typescript-eslint': tsPlugin,
react,
'react-hooks': reactHooks,
'jsx-a11y': jsxA11y,
'testing-library': testingLibrary,
'jest-dom': jestDom,
},
rules: {
// Recommended rule presets:
...tsPlugin.configs.recommended.rules,
...react.configs.recommended.rules,
...jsxA11y.configs.recommended.rules,
...reactHooks.configs.recommended.rules,
...testingLibrary.configs.react.rules,
...jestDom.configs.recommended.rules, // Jest-dom recommended rules
// eslint core
'no-empty-function': 'off',
// jest-dom customizations
'jest-dom/prefer-to-have-value': 'warn',
// react
'react/react-in-jsx-scope': 'off',
'react/no-unknown-property': 'warn',
'react/prop-types': 'warn',
'react/display-name': 'warn',
// @typescript-eslint
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'warn',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-wrapper-object-types': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/ban-ts-comment': 'warn',
'@typescript-eslint/no-unsafe-function-type': 'warn',
// jsx-a11y
'jsx-a11y/label-has-associated-control': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-autofocus': 'warn',
// testing-library
'testing-library/no-node-access': 'warn',
'testing-library/await-async-events': 'warn',
'testing-library/prefer-presence-queries': 'warn',
'testing-library/no-dom-import': 'warn',
'testing-library/no-await-sync-events': [
'error',
{
eventModules: ['fire-event'],
},
],
},
settings: {
react: {
version: 'detect',
},
jest: {
version: 'latest',
},
},
},
prettierConfig,
{
ignores: [
'node_modules/',
'build/',
'public/build/',
'shopify-app-remix/',
'*.yml',
'.shopify/',
'types/*.generated.d.ts',
'extensions/*/dist/',
'extensions/*/types/*.generated.d.ts',
],
},
];