File size: 3,605 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
119
120
121
122
123
124
125
126
127
128
{
  "extends": ["plugin:@nx/react", "../../.eslintrc.json"],
  "ignorePatterns": ["!**/*"],
  "overrides": [
    {
      "files": ["*.ts", "*.tsx"],
      "extends": [
        "plugin:tailwindcss/recommended",
        "plugin:@tanstack/eslint-plugin-query/recommended"
      ],
      "parserOptions": {
        "projectService": "./apps/client/tsconfig.json"
      },
      "settings": {
        "tailwindcss": {
          "callees": ["cn", "clsx", "cva"],
          "config": "tailwind.config.js",
          "whitelist": ["ph", "ph\\-.*", "si", "si\\-.*"]
        }
      },
      "plugins": ["lingui"],
      "rules": {
        // eslint
        "@typescript-eslint/no-require-imports": "off",

        // react
        "react/no-unescaped-entities": "off",
        "react/jsx-sort-props": [
          "error",
          {
            "reservedFirst": true,
            "callbacksLast": true,
            "shorthandFirst": true,
            "noSortAlphabetically": true
          }
        ],

        // react-hooks
        "react-hooks/exhaustive-deps": "off",

        // lingui
        "lingui/no-unlocalized-strings": [
          2,
          {
            "ignore": [
              // Ignore strings which are a single "word" (no spaces)
              // and doesn't start with an uppercase letter
              "^(?![A-Z])\\S+$",
              // Ignore UPPERCASE literals
              // Example: const test = "FOO"
              "^[A-Z0-9_-]+$"
            ],
            "ignoreNames": [
              // Ignore matching className (case-insensitive)
              { "regex": { "pattern": "className", "flags": "i" } },
              // Ignore UPPERCASE names
              // Example: test.FOO = "ola!"
              { "regex": { "pattern": "^[A-Z0-9_-]+$" } },
              "id",
              "src",
              "srcSet",
              "styleName",
              "placeholder",
              "alt",
              "type",
              "width",
              "height",
              "displayName",
              "Authorization"
            ],
            "ignoreFunctions": [
              "cn",
              "cva",
              "track",
              "Error",
              "console.*",
              "*headers.set",
              "*.addEventListener",
              "*.removeEventListener",
              "*.postMessage",
              "*.getElementById",
              "*.dispatch",
              "*.commit",
              "*.includes",
              "*.indexOf",
              "*.endsWith",
              "*.startsWith",
              "require"
            ],
            // Following settings require typed linting https://typescript-eslint.io/getting-started/typed-linting/
            "useTsTypes": true,
            "ignoreMethodsOnTypes": [
              // Ignore specified methods on Map and Set types
              "Map.get",
              "Map.has",
              "Set.has"
            ]
          }
        ],
        "lingui/t-call-in-function": 2,
        "lingui/no-single-variables-to-translate": 2,
        "lingui/no-expression-in-message": 2,
        "lingui/no-single-tag-to-translate": 2,
        "lingui/no-trans-inside-trans": 2,
        "lingui/text-restrictions": [
          2,
          {
            "rules": [
              {
                "patterns": ["''", "\"", "’", "“"],
                "message": "This string contains forbidden characters"
              }
            ]
          }
        ]
      }
    },
    {
      "files": ["*.ts", "*.tsx"],
      "rules": {}
    },
    {
      "files": ["*.js", "*.jsx"],
      "rules": {}
    }
  ]
}