forked from PaloAltoNetworks/docusaurus-openapi-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
101 lines (99 loc) · 2.71 KB
/
.eslintrc.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
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
/* ============================================================================
* Copyright (c) Palo Alto Networks
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
* ========================================================================== */
const tsExtensions = [".ts", ".tsx", ".d.ts"];
const allExtensions = [...tsExtensions, ".js", ".jsx"];
module.exports = {
ignorePatterns: ["demo/**", "packages/docusaurus-template-*/**"],
root: true,
extends: [
"react-app",
"plugin:jest/recommended",
"plugin:jest/style",
"plugin:testing-library/react",
"plugin:jest-dom/recommended",
],
plugins: ["import", "header"],
rules: {
"header/header": [
"warn",
"block",
[
" ============================================================================",
" * Copyright (c) Palo Alto Networks",
" *",
" * This source code is licensed under the MIT license found in the",
" * LICENSE file in the root directory of this source tree.",
" * ========================================================================== ",
],
2,
],
"import/newline-after-import": ["warn", { count: 1 }],
"import/no-extraneous-dependencies": [
"warn",
{
devDependencies: false,
optionalDependencies: false,
peerDependencies: true,
bundledDependencies: true,
},
],
"import/order": [
"warn",
{
alphabetize: {
order: "asc",
caseInsensitive: true,
},
"newlines-between": "always",
groups: [
"builtin",
"external",
"internal",
["parent", "sibling", "index"],
"object",
],
pathGroups: [
{
pattern: "react?(-dom)",
group: "external",
position: "before",
},
],
pathGroupsExcludedImportTypes: ["builtin"],
},
],
},
overrides: [
{
files: ["**/scripts/**", "cypress/**", "**/*.test.ts"],
rules: {
"import/no-extraneous-dependencies": [
"warn",
{
packageDir: [__dirname, "."],
devDependencies: true,
optionalDependencies: false,
peerDependencies: true,
bundledDependencies: true,
},
],
},
},
],
settings: {
"import/extensions": allExtensions,
"import/external-module-folders": ["node_modules", "node_modules/@types"],
"import/parsers": {
"@typescript-eslint/parser": tsExtensions,
},
"import/resolver": {
node: {
extensions: allExtensions,
},
},
},
};