-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.json
82 lines (79 loc) · 2.15 KB
/
.eslintrc.json
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
{
"extends": [
"next/core-web-vitals",
"plugin:import/recommended",
"plugin:import/typescript" /** the following line do the trick */,
"prettier"
],
"plugins": ["check-file", "import", "prettier"],
"settings": {
"import/resolver": {
"node": true,
"typescript": true
}
},
"rules": {
// check-file (checks the foldername and filename)
"check-file/filename-blocklist": [
"error",
{
"**/*.spec.{ts,tsx}": "[file-folder]/[file-name].test.{ts,tsx}"
}
],
"check-file/folder-match-with-fex": [
"error",
{
"*.test.{ts,tsx}": "src/**/",
"*.styled.{ts,tsx}": "src/**/"
}
],
"check-file/folder-naming-convention": [
"error",
{
"src/!(app|edge)/**/": "KEBAB_CASE",
"src/app/**/": "NEXT_JS_APP_ROUTER_CASE",
"src/edge/**/": "CAMEL_CASE"
}
],
"check-file/filename-naming-convention": [
"error",
{
"src/!(edge)/**/*.{ts,tsx}": "KEBAB_CASE",
"src/edge/!(scenes|widgets)/**/*.ts": "CAMEL_CASE",
"src/edge/(scenes|widgets)/**/*.config.ts": "PASCAL_CASE"
},
{ "ignoreMiddleExtensions": true }
],
// import rules
"import/no-cycle": "error",
"import/no-unresolved": "error",
"import/no-default-export": "error",
// react
"react/prop-types": "off",
// prettier
"prettier/prettier": "warn"
},
"overrides": [
{
"files": [
// allows `default` export for:
// 1. `Next.js` config file and specific files in the "App Router" folder
"next.config.mjs",
"src/app/**/{layout,template,page,loading,error,global-error,not-found}.tsx",
// 2. `Edge Config` specific files in the "edge" folder
"src/edge/widgetDefaults.ts",
"src/edge/{scenes,widgets}/**/*.config.ts"
],
"rules": {
"import/no-default-export": "off"
}
},
{
// allows named import as default: "import styled from 'styled-components'" because of error with `next.js`
"files": ["src/**/*.styled.{ts,tsx}"],
"rules": {
"import/no-named-as-default": "off"
}
}
]
}