-
Notifications
You must be signed in to change notification settings - Fork 676
Expand file tree
/
Copy path.eslintrc.js
More file actions
81 lines (79 loc) · 2.66 KB
/
.eslintrc.js
File metadata and controls
81 lines (79 loc) · 2.66 KB
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
module.exports = {
parser: "@typescript-eslint/parser", // Specifies the ESLint parser
parserOptions: {
ecmaVersion: 2020, // Allows for the parsing of modern ECMAScript features
sourceType: "module", // Allows for the use of imports
},
extends: [
// Uses the recommended rules from the @typescript-eslint/eslint-plugin
"plugin:@typescript-eslint/recommended",
],
plugins: ["@typescript-eslint", "simple-import-sort", "eslint-plugin-sort-export-all", "eslint-plugin-tsdoc", "n"],
rules: {
/** Turn off strict enforcement */
"@typescript-eslint/ban-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"prefer-rest-params": "off",
"@typescript-eslint/no-non-null-assertion": "off",
/** Warnings */
"@typescript-eslint/no-namespace": "warn",
"tsdoc/syntax": "warn",
/** Errors */
"simple-import-sort/imports": "error",
"sort-export-all/sort-export-all": "error",
"@typescript-eslint/consistent-type-imports": "error",
"n/prefer-node-protocol": "error",
},
ignorePatterns: [
"packages/nested-clients/src/submodules/**/protocols/*.ts",
"packages/nested-clients/src/submodules/**/models/*.ts",
],
overrides: [
{
files: [
"lib/*/src/**/*.ts",
"clients/*/src/**/*.ts",
"packages/*/src/**/*.ts",
"packages-internal/*/src/**/*.ts",
"private/*/src/**/*.ts",
],
excludedFiles: [
"lib/*/src/**/*.spec.ts",
"clients/*/src/**/*.spec.ts",
"packages/*/src/**/*.spec.ts",
"packages-internal/*/src/**/*.spec.ts",
"private/*/src/**/*.spec.ts",
],
rules: {
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["*src*", "*dist-*", "!*csrc*"],
message:
"Imports must not contain the src folder in their path. Either import from the official package name, or you are already in the src folder and the relative path will not contain src.",
},
{
group: ["@aws-sdk/core", "!@aws-sdk/core/"],
message: "Import from a specific submodule like @aws-sdk/core/submodule instead.",
},
],
},
],
},
},
{
files: ["**/*.js"],
rules: {
"tsdoc/syntax": "off",
"n/prefer-node-protocol": "error",
},
},
],
};