-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbrowser.js
More file actions
118 lines (117 loc) · 3.09 KB
/
Copy pathbrowser.js
File metadata and controls
118 lines (117 loc) · 3.09 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
import { fixupConfigRules } from '@eslint/compat';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import eslintConfigPrettier from 'eslint-config-prettier';
import tseslint from 'typescript-eslint';
import globals from 'globals';
import { compat } from './compat.js';
import { baseRules, tsConfigs } from './base.js';
export default [
...fixupConfigRules(compat.extends('airbnb', 'plugin:import/typescript')),
...baseRules,
{
name: 'availity/browser',
plugins: {
'react-hooks': reactHooksPlugin,
'@typescript-eslint': tseslint.plugin,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
sourceType: 'module',
ecmaVersion: 'latest',
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.es2025,
},
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
},
'import/resolver': {
node: {
extensions: ['.mjs', '.js', '.ts', '.tsx', '.d.ts', '.json', '.jsx'],
},
typescript: {
alwaysTryTypes: true,
},
},
'import/extensions': ['.js', '.ts', '.tsx', '.mjs', '.jsx'],
react: {
version: 'detect',
},
},
rules: {
'arrow-body-style': ['warn', 'as-needed'],
'unicorn/prefer-module': 'error',
'unicorn/prefer-query-selector': 'off',
'unicorn/prefer-dom-node-remove': 'off',
'unicorn/prefer-dom-node-append': 'off',
'react/sort-comp': 'off',
camelcase: 'off',
'react/jsx-filename-extension': ['warn', { extensions: ['.js', '.jsx', '.tsx'] }],
'react/require-default-props': 'off',
'jsx-a11y/label-has-associated-control': [
'error',
{
required: {
some: ['nesting', 'id'],
},
},
],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/jsx-props-no-spreading': 'off',
'react/forbid-prop-types': [
'error',
{
forbid: ['any'],
},
],
'react/react-in-jsx-scope': 'off',
'react/jsx-uses-react': 'off',
'jsx-a11y/anchor-is-valid': [
'error',
{
components: ['Link'],
specialLink: ['to'],
},
],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
mjs: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
'import/prefer-default-export': 'off',
'react/function-component-definition': [
'error',
{
namedComponents: ['function-declaration', 'arrow-function'],
},
],
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': 'warn',
},
},
// TypeScript recommended rules
...tsConfigs,
// Disable prop-types rule in .tsx files
{
name: 'availity/tsx-overrides',
files: ['**/*.tsx'],
rules: {
'react/prop-types': 'off',
},
},
eslintConfigPrettier,
];