-
Notifications
You must be signed in to change notification settings - Fork 0
/
legacy.js
75 lines (75 loc) · 2.23 KB
/
legacy.js
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
module.exports = {
root: true,
plugins: ["react", "react-hooks", "jsx-a11y"],
env: {
browser: true,
},
ignorePatterns: ["babel.config.js"],
extends: [
"@open-turo/eslint-config-typescript/legacy",
"plugin:react/recommended",
"plugin:react-hooks/recommended",
"plugin:jsx-a11y/recommended",
],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
rules: {
"jsx-a11y/anchor-is-valid": [
"warn",
{
specialLink: ["to"],
},
],
"n/no-unpublished-import": [
"error",
{
allowModules: [
"@jest/globals",
"@testing-library/dom",
"@testing-library/react",
"@testing-library/user-event",
"nock",
],
},
],
// don't force .jsx extension
"react/jsx-filename-extension": "off",
// In TS you must use the Fragment syntax instead of the shorthand
"react/jsx-fragments": "off",
// This allows props to be spread in JSX
"react/jsx-props-no-spreading": "off",
// ensure props are alphabetical
"react/jsx-sort-props": "error",
// We don't need default props on TS components
"react/require-default-props": "off",
"react/sort-prop-types": "error",
// State initialization can be in the constructor or via class fields
"react/state-in-constructor": "off",
// This allows static properties to be placed within the class declaration
"react/static-property-placement": "off",
/**
* Rules that significantly impact performance time of eslint, and are not
* necessarily relevant for react applications.
*/
"sonarjs/aws-apigateway-public-api": "off",
"sonarjs/aws-ec2-rds-dms-public": "off",
"sonarjs/aws-iam-all-privileges": "off",
"sonarjs/aws-iam-privilege-escalation": "off",
"sonarjs/aws-iam-public-access": "off",
"sonarjs/aws-restricted-ip-admin-access": "off",
// Already covered with react/no-array-index-key
"sonarjs/no-array-index-key": "off",
// Already covered with react/no-unknown-property
"sonarjs/no-unknown-property": "off",
"sonarjs/jsx-no-useless-fragment": "off",
"sonarjs/no-unstable-nested-components": "off",
},
settings: {
react: {
version: "detect",
},
},
};