-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
.eslintrc.json
45 lines (45 loc) · 1.97 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
{
"extends": ["opencollective"],
"parser": "@babel/eslint-parser",
"parserOptions": { "babelOptions": { "configFile": "./.babelrc" } },
"env": {
"jest": true
},
"plugins": ["graphql", "simple-import-sort"],
"rules": {
"no-console": "warn",
"graphql/template-strings": [
"error",
{ "env": "apollo", "projectName": "opencollective" },
{ "env": "apollo", "tagName": "gqlV2", "projectName": "opencollectiveV2" }
],
"graphql/named-operations": ["error"],
"graphql/capitalized-type-name": ["error"],
"graphql/no-deprecated-fields": ["warn"],
// simple-import-sort
"simple-import-sort/imports": [
"error",
{
"groups": [
// Side effect imports.
["^\\u0000"],
// Node.js builtins. You could also generate this regex if you use a `.js` config.
// For example: `^(${require("module").builtinModules.join("|")})(/|$)`
[
"^(_http_agent|_http_client|_http_common|_http_incoming|_http_outgoing|_http_server|_stream_duplex|_stream_passthrough|_stream_readable|_stream_transform|_stream_wrap|_stream_writable|_tls_common|_tls_wrap|assert|async_hooks|buffer|child_process|cluster|console|constants|crypto|dgram|dns|domain|events|fs|http|http2|https|inspector|module|net|os|path|perf_hooks|process|punycode|querystring|readline|repl|stream|string_decoder|sys|timers|tls|trace_events|tty|url|util|v8|vm|worker_threads|zlib)(/|$)"
],
// Packages.
// Things that start with a letter (or digit or underscore), or `@` followed by a letter.
["^@?\\w"],
// Absolute imports and other imports such as Vue-style `@/foo`.
// Anything that does not start with a dot.
["^[^.]"],
// Parent imports. Put `..` last.
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
// Other relative imports. Put same-folder imports and `.` last.
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"]
]
}
]
}
}