@boehringer-ingelheim/eslint-config 9.5.0-typescript.1 → 9.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/configs/base.d.ts +3 -0
- package/dist/cjs/configs/base.d.ts.map +1 -0
- package/dist/cjs/configs/base.js +142 -0
- package/dist/cjs/configs/base.js.map +1 -0
- package/dist/cjs/configs/experimental-naming-convention.d.ts +3 -0
- package/dist/cjs/configs/experimental-naming-convention.d.ts.map +1 -0
- package/dist/cjs/configs/experimental-naming-convention.js +70 -0
- package/dist/cjs/configs/experimental-naming-convention.js.map +1 -0
- package/dist/cjs/configs/local.d.ts +3 -0
- package/dist/cjs/configs/local.d.ts.map +1 -0
- package/dist/cjs/configs/local.js +19 -0
- package/dist/cjs/configs/local.js.map +1 -0
- package/dist/cjs/configs/nextjs.d.ts +3 -0
- package/dist/cjs/configs/nextjs.d.ts.map +1 -0
- package/dist/cjs/configs/nextjs.js +127 -0
- package/dist/cjs/configs/nextjs.js.map +1 -0
- package/dist/cjs/configs/playwright.d.ts +3 -0
- package/dist/cjs/configs/playwright.d.ts.map +1 -0
- package/dist/cjs/configs/playwright.js +34 -0
- package/dist/cjs/configs/playwright.js.map +1 -0
- package/dist/cjs/configs/prettier-disable.d.ts +3 -0
- package/dist/cjs/configs/prettier-disable.d.ts.map +1 -0
- package/dist/cjs/configs/prettier-disable.js +15 -0
- package/dist/cjs/configs/prettier-disable.js.map +1 -0
- package/dist/cjs/configs/react.d.ts +3 -0
- package/dist/cjs/configs/react.d.ts.map +1 -0
- package/dist/cjs/configs/react.js +115 -0
- package/dist/cjs/configs/react.js.map +1 -0
- package/dist/cjs/configs/strict.d.ts +3 -0
- package/dist/cjs/configs/strict.d.ts.map +1 -0
- package/dist/cjs/configs/strict.js +29 -0
- package/dist/cjs/configs/strict.js.map +1 -0
- package/dist/cjs/lib/constants.d.ts +2 -0
- package/dist/cjs/lib/constants.d.ts.map +1 -0
- package/dist/cjs/lib/constants.js +5 -0
- package/dist/cjs/lib/constants.js.map +1 -0
- package/dist/cjs/lib/eslint-plugin-perfectionist.d.ts +30 -0
- package/dist/cjs/lib/eslint-plugin-perfectionist.d.ts.map +1 -0
- package/dist/cjs/lib/eslint-plugin-perfectionist.js +82 -0
- package/dist/cjs/lib/eslint-plugin-perfectionist.js.map +1 -0
- package/dist/cjs/lib/include-ignore-file.d.ts +10 -0
- package/dist/cjs/lib/include-ignore-file.d.ts.map +1 -0
- package/dist/cjs/lib/include-ignore-file.js +29 -0
- package/dist/cjs/lib/include-ignore-file.js.map +1 -0
- package/dist/cjs/lib/nextjs.utils.d.ts +11 -0
- package/dist/cjs/lib/nextjs.utils.d.ts.map +1 -0
- package/dist/cjs/lib/nextjs.utils.js +24 -0
- package/dist/cjs/lib/nextjs.utils.js.map +1 -0
- package/dist/cjs/main.d.ts +18 -0
- package/dist/cjs/main.d.ts.map +1 -0
- package/dist/cjs/main.js +33 -0
- package/dist/cjs/main.js.map +1 -0
- package/dist/esm/configs/base.d.ts +3 -0
- package/dist/esm/configs/base.d.ts.map +1 -0
- package/dist/esm/configs/base.js +137 -0
- package/dist/esm/configs/base.js.map +1 -0
- package/dist/esm/configs/experimental-naming-convention.d.ts +3 -0
- package/dist/esm/configs/experimental-naming-convention.d.ts.map +1 -0
- package/dist/esm/configs/experimental-naming-convention.js +68 -0
- package/dist/esm/configs/experimental-naming-convention.js.map +1 -0
- package/dist/esm/configs/local.d.ts +3 -0
- package/dist/esm/configs/local.d.ts.map +1 -0
- package/dist/esm/configs/local.js +14 -0
- package/dist/esm/configs/local.js.map +1 -0
- package/dist/esm/configs/nextjs.d.ts +3 -0
- package/dist/esm/configs/nextjs.d.ts.map +1 -0
- package/dist/esm/configs/nextjs.js +122 -0
- package/dist/esm/configs/nextjs.js.map +1 -0
- package/dist/esm/configs/playwright.d.ts +3 -0
- package/dist/esm/configs/playwright.d.ts.map +1 -0
- package/dist/esm/configs/playwright.js +29 -0
- package/dist/esm/configs/playwright.js.map +1 -0
- package/dist/esm/configs/prettier-disable.d.ts +3 -0
- package/dist/esm/configs/prettier-disable.d.ts.map +1 -0
- package/dist/esm/configs/prettier-disable.js +10 -0
- package/dist/esm/configs/prettier-disable.js.map +1 -0
- package/dist/esm/configs/react.d.ts +3 -0
- package/dist/esm/configs/react.d.ts.map +1 -0
- package/dist/esm/configs/react.js +110 -0
- package/dist/esm/configs/react.js.map +1 -0
- package/dist/esm/configs/strict.d.ts +3 -0
- package/dist/esm/configs/strict.d.ts.map +1 -0
- package/dist/esm/configs/strict.js +24 -0
- package/dist/esm/configs/strict.js.map +1 -0
- package/dist/esm/lib/constants.d.ts +2 -0
- package/dist/esm/lib/constants.d.ts.map +1 -0
- package/dist/esm/lib/constants.js +2 -0
- package/dist/esm/lib/constants.js.map +1 -0
- package/dist/esm/lib/eslint-plugin-perfectionist.d.ts +30 -0
- package/dist/esm/lib/eslint-plugin-perfectionist.d.ts.map +1 -0
- package/dist/esm/lib/eslint-plugin-perfectionist.js +79 -0
- package/dist/esm/lib/eslint-plugin-perfectionist.js.map +1 -0
- package/dist/esm/lib/include-ignore-file.d.ts +10 -0
- package/dist/esm/lib/include-ignore-file.d.ts.map +1 -0
- package/dist/esm/lib/include-ignore-file.js +22 -0
- package/dist/esm/lib/include-ignore-file.js.map +1 -0
- package/dist/esm/lib/nextjs.utils.d.ts +11 -0
- package/dist/esm/lib/nextjs.utils.d.ts.map +1 -0
- package/dist/esm/lib/nextjs.utils.js +21 -0
- package/dist/esm/lib/nextjs.utils.js.map +1 -0
- package/dist/esm/main.d.ts +18 -0
- package/dist/esm/main.d.ts.map +1 -0
- package/dist/esm/main.js +26 -0
- package/dist/esm/main.js.map +1 -0
- package/package.json +36 -29
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/configs/base.ts"],"names":[],"mappings":";AAcA,wBA+IE"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const js_1 = __importDefault(require("@eslint/js"));
|
|
7
|
+
const eslint_plugin_import_1 = __importDefault(require("eslint-plugin-import"));
|
|
8
|
+
const eslint_plugin_perfectionist_1 = __importDefault(require("eslint-plugin-perfectionist"));
|
|
9
|
+
const eslint_plugin_sonarjs_1 = require("eslint-plugin-sonarjs");
|
|
10
|
+
const config_1 = require("eslint/config");
|
|
11
|
+
const typescript_eslint_1 = __importDefault(require("typescript-eslint"));
|
|
12
|
+
const constants_js_1 = require("../lib/constants.js");
|
|
13
|
+
const eslint_plugin_perfectionist_js_1 = require("../lib/eslint-plugin-perfectionist.js");
|
|
14
|
+
exports.default = (0, config_1.defineConfig)(js_1.default.configs.recommended, typescript_eslint_1.default.configs.recommendedTypeChecked, typescript_eslint_1.default.configs.stylisticTypeChecked, eslint_plugin_import_1.default.flatConfigs.recommended, eslint_plugin_import_1.default.flatConfigs.typescript, eslint_plugin_perfectionist_1.default.configs['recommended-natural'], eslint_plugin_sonarjs_1.configs.recommended, {
|
|
15
|
+
languageOptions: {
|
|
16
|
+
parserOptions: {
|
|
17
|
+
// find the tsconfig.json nearest each source file
|
|
18
|
+
projectService: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
linterOptions: {
|
|
22
|
+
reportUnusedDisableDirectives: 'error',
|
|
23
|
+
},
|
|
24
|
+
rules: {
|
|
25
|
+
// @typescript-eslint: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules
|
|
26
|
+
'@typescript-eslint/adjacent-overload-signatures': 'off', // disabled due to conflict with eslint-plugin-perfectionist
|
|
27
|
+
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true }],
|
|
28
|
+
'@typescript-eslint/no-misused-promises': [
|
|
29
|
+
'error',
|
|
30
|
+
{
|
|
31
|
+
checksVoidReturn: false,
|
|
32
|
+
},
|
|
33
|
+
],
|
|
34
|
+
'@typescript-eslint/no-unused-vars': [
|
|
35
|
+
'error',
|
|
36
|
+
{
|
|
37
|
+
argsIgnorePattern: '^_',
|
|
38
|
+
caughtErrorsIgnorePattern: '^_',
|
|
39
|
+
varsIgnorePattern: '^_',
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
'@typescript-eslint/sort-type-constituents': 'off', // disabled due to conflict with eslint-plugin-perfectionist
|
|
43
|
+
// eslint: https://github.com/eslint/eslint/tree/main/lib/rules
|
|
44
|
+
'@typescript-eslint/dot-notation': ['error', { allowPattern: '^[a-z]+(_[a-z]+)+$' }],
|
|
45
|
+
'arrow-body-style': ['error', 'as-needed'],
|
|
46
|
+
camelcase: 'warn',
|
|
47
|
+
curly: 'error',
|
|
48
|
+
'default-case': 'error',
|
|
49
|
+
eqeqeq: 'error',
|
|
50
|
+
'logical-assignment-operators': ['error', 'never'],
|
|
51
|
+
'no-console': ['warn', { allow: ['warn', 'error'] }],
|
|
52
|
+
'no-else-return': ['error', { allowElseIf: false }],
|
|
53
|
+
'no-lonely-if': 'error',
|
|
54
|
+
'no-negated-condition': 'error',
|
|
55
|
+
'no-nested-ternary': 'error',
|
|
56
|
+
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
|
|
57
|
+
'no-unneeded-ternary': 'error',
|
|
58
|
+
'no-useless-concat': 'error',
|
|
59
|
+
'operator-assignment': ['error', 'never'],
|
|
60
|
+
'prefer-template': 'error',
|
|
61
|
+
'sort-imports': 'off', // disabled due to conflict with eslint-plugin-perfectionist
|
|
62
|
+
'sort-keys': 'off', // disabled due to conflict with eslint-plugin-perfectionist
|
|
63
|
+
// eslint-plugin-import: https://github.com/import-js/eslint-plugin-import/tree/main/docs/rules
|
|
64
|
+
'import/no-cycle': 'error',
|
|
65
|
+
/**
|
|
66
|
+
* The rule is disabled for now as it is not compatible with flat-configs, without adding an artifical `.eslintrc` file.
|
|
67
|
+
*
|
|
68
|
+
* @see: https://github.com/import-js/eslint-plugin-import/issues/3079#issuecomment-2557191925
|
|
69
|
+
* @todo Enable rule, as soon as fix is available: https://github.com/Boehringer-Ingelheim/eslint-config/blob/9f028ed43bb5db11082a2982f249ddfe7eaf5c13/configs/base.js#L77
|
|
70
|
+
*/
|
|
71
|
+
'import/no-unused-modules': 'off',
|
|
72
|
+
'import/order': 'off', // disabled due to conflict with eslint-plugin-perfectionist
|
|
73
|
+
'import/prefer-default-export': 'off',
|
|
74
|
+
// Deactivated as TypeScript provides the same checks as part of standard type checking: https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting
|
|
75
|
+
'import/default': 'off',
|
|
76
|
+
'import/named': 'off',
|
|
77
|
+
'import/namespace': 'off',
|
|
78
|
+
'import/no-named-as-default-member': 'off',
|
|
79
|
+
'import/no-unresolved': 'off',
|
|
80
|
+
// eslint-plugin-perfectionist: https://github.com/azat-io/eslint-plugin-perfectionist
|
|
81
|
+
'perfectionist/sort-classes': [
|
|
82
|
+
'error',
|
|
83
|
+
{
|
|
84
|
+
groups: eslint_plugin_perfectionist_js_1.SORT_CLASSES_GROUPS,
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
'perfectionist/sort-imports': [
|
|
88
|
+
'error',
|
|
89
|
+
{
|
|
90
|
+
groups: eslint_plugin_perfectionist_js_1.SORT_IMPORTS_GROUPS,
|
|
91
|
+
newlinesBetween: 0, // No newlines are allowed between groups
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
'perfectionist/sort-intersection-types': [
|
|
95
|
+
'error',
|
|
96
|
+
{
|
|
97
|
+
groups: eslint_plugin_perfectionist_js_1.SORT_INTERSECTION_TYPES_GROUPS,
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
'perfectionist/sort-named-imports': [
|
|
101
|
+
'error',
|
|
102
|
+
{
|
|
103
|
+
ignoreAlias: true,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
'perfectionist/sort-objects': [
|
|
107
|
+
'error',
|
|
108
|
+
{
|
|
109
|
+
partitionByComment: true,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
// eslint-plugin-sonarjs: https://github.com/SonarSource/SonarJS/blob/master/packages/analysis/src/jsts/rules/README.md
|
|
113
|
+
'sonarjs/deprecation': 'off', // disable rule in favor of @typescript-eslint/no-deprecated
|
|
114
|
+
'sonarjs/no-unused-vars': 'off', // disabled due to overlap with @typescript-eslint/no-unused-vars
|
|
115
|
+
'sonarjs/todo-tag': 'warn',
|
|
116
|
+
},
|
|
117
|
+
settings: {
|
|
118
|
+
'import/resolver': {
|
|
119
|
+
typescript: true,
|
|
120
|
+
},
|
|
121
|
+
perfectionist: {
|
|
122
|
+
...eslint_plugin_perfectionist_js_1.PERFECTIONIST_SETTINGS,
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
}, {
|
|
126
|
+
files: [
|
|
127
|
+
'**/*.d.ts', // TypeScript declaration files
|
|
128
|
+
...constants_js_1.TEST_FILE_GLOBS,
|
|
129
|
+
'./*.{js,cjs,mjs,ts,cts,mts}', // Mostly configuration files on root level
|
|
130
|
+
],
|
|
131
|
+
rules: {
|
|
132
|
+
'import/no-unused-modules': 'off',
|
|
133
|
+
},
|
|
134
|
+
}, {
|
|
135
|
+
files: [...constants_js_1.TEST_FILE_GLOBS],
|
|
136
|
+
rules: {
|
|
137
|
+
// eslint-plugin-sonarjs: https://github.com/SonarSource/SonarJS/blob/master/packages/analysis/src/jsts/rules/README.md
|
|
138
|
+
'sonarjs/no-duplicate-string': 'off',
|
|
139
|
+
'sonarjs/slow-regex': 'off',
|
|
140
|
+
},
|
|
141
|
+
});
|
|
142
|
+
//# sourceMappingURL=base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../src/configs/base.ts"],"names":[],"mappings":";;;;;AAAA,oDAAgC;AACh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zB;SACF;QAED,uHAAuH;QACvH,qBAAqB,EAAE,KAAK,EAAE,4DAA4D;QAC1F,wBAAwB,EAAE,KAAK,EAAE,iEAAiE;QAClG,kBAAkB,EAAE,MAAM;KAC3B;IACD,QAAQ,EAAE;QACR,iBAAiB,EAAE;YACjB,UAAU,EAAE,IAAI;SACjB;QACD,aAAa,EAAE;YACb,GAAG,uDAAsB;SAC1B;KACF;CACF,EACD;IACE,KAAK,EAAE;QACL,WAAW,EAAE,+BAA+B;QAC5C,GAAG,8BAAe;QAClB,6BAA6B,EAAE,2CAA2C;KAC3E;IACD,KAAK,EAAE;QACL,0BAA0B,EAAE,KAAK;KAClC;CACF,EACD;IACE,KAAK,EAAE,CAAC,GAAG,8BAAe,CAAC;IAC3B,KAAK,EAAE;QACL,uHAAuH;QACvH,6BAA6B,EAAE,KAAK;QACpC,oBAAoB,EAAE,KAAK;KAC5B;CACF,CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experimental-naming-convention.d.ts","sourceRoot":"","sources":["../../../src/configs/experimental-naming-convention.ts"],"names":[],"mappings":";AAEA,wBAiEG"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_1 = require("eslint/config");
|
|
4
|
+
exports.default = (0, config_1.defineConfig)({
|
|
5
|
+
rules: {
|
|
6
|
+
'@typescript-eslint/naming-convention': [
|
|
7
|
+
'error',
|
|
8
|
+
{
|
|
9
|
+
// Enforce that interface names do not start with an 'I'
|
|
10
|
+
custom: {
|
|
11
|
+
match: false,
|
|
12
|
+
regex: '^I[A-Z]',
|
|
13
|
+
},
|
|
14
|
+
format: ['StrictPascalCase'],
|
|
15
|
+
leadingUnderscore: 'forbid',
|
|
16
|
+
selector: 'interface',
|
|
17
|
+
trailingUnderscore: 'forbid',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
// Enforce that type alias names do not start with an 'T'
|
|
21
|
+
custom: {
|
|
22
|
+
match: false,
|
|
23
|
+
regex: '^T[A-Z]',
|
|
24
|
+
},
|
|
25
|
+
format: ['StrictPascalCase'],
|
|
26
|
+
leadingUnderscore: 'forbid',
|
|
27
|
+
selector: 'typeAlias',
|
|
28
|
+
trailingUnderscore: 'forbid',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
// Enforce that all top-level variables are in UPPER_CASE
|
|
32
|
+
format: ['UPPER_CASE'],
|
|
33
|
+
leadingUnderscore: 'forbid',
|
|
34
|
+
modifiers: ['global'],
|
|
35
|
+
selector: 'variable',
|
|
36
|
+
trailingUnderscore: 'forbid',
|
|
37
|
+
types: ['boolean', 'number', 'string'],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
// Enforce that all top-level array variables are in UPPER_CASE and are suffixed with a 'S' to indicate plural form
|
|
41
|
+
format: ['UPPER_CASE'],
|
|
42
|
+
leadingUnderscore: 'forbid',
|
|
43
|
+
modifiers: ['global'],
|
|
44
|
+
selector: 'variable',
|
|
45
|
+
suffix: ['S'],
|
|
46
|
+
trailingUnderscore: 'forbid',
|
|
47
|
+
types: ['array'],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
// Enforce that array variables are suffixed with a 's' to indicate plural form
|
|
51
|
+
format: ['strictCamelCase'],
|
|
52
|
+
leadingUnderscore: 'forbid',
|
|
53
|
+
selector: 'variable',
|
|
54
|
+
suffix: ['s'],
|
|
55
|
+
trailingUnderscore: 'forbid',
|
|
56
|
+
types: ['array'],
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
// Enforce that boolean variables are prefixed with an allowed verb
|
|
60
|
+
format: ['StrictPascalCase'],
|
|
61
|
+
leadingUnderscore: 'forbid',
|
|
62
|
+
prefix: ['is', 'has', 'should', 'can'],
|
|
63
|
+
selector: 'variable',
|
|
64
|
+
trailingUnderscore: 'forbid',
|
|
65
|
+
types: ['boolean'],
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
},
|
|
69
|
+
});
|
|
70
|
+
//# sourceMappingURL=experimental-naming-convention.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experimental-naming-convention.js","sourceRoot":"","sources":["../../../src/configs/experimental-naming-convention.ts"],"names":[],"mappings":";;AAAA,0CAA6C;AAE7C,kBAAe,IAAA,qBAAY,EAAC;IAC1B,KAAK,EAAE;QACL,sCAAsC,EAAE;YACtC,OAAO;YACP;gBACE,wDAAwD;gBACxD,MAAM,EAAE;oBACN,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,SAAS;iBACjB;gBACD,MAAM,EAAE,CAAC,kBAAkB,CAAC;gBAC5B,iBAAiB,EAAE,QAAQ;gBAC3B,QAAQ,EAAE,WAAW;gBACrB,kBAAkB,EAAE,QAAQ;aAC7B;YACD;gBACE,yDAAyD;gBACzD,MAAM,EAAE;oBACN,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,SAAS;iBACjB;gBACD,MAAM,EAAE,CAAC,kBAAkB,CAAC;gBAC5B,iBAAiB,EAAE,QAAQ;gBAC3B,QAAQ,EAAE,WAAW;gBACrB,kBAAkB,EAAE,QAAQ;aAC7B;YACD;gBACE,yDAAyD;gBACzD,MAAM,EAAE,CAAC,YAAY,CAAC;gBACtB,iBAAiB,EAAE,QAAQ;gBAC3B,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,QAAQ,EAAE,UAAU;gBACpB,kBAAkB,EAAE,QAAQ;gBAC5B,KAAK,EAAE,CAAC,SAAS,EAAE,QAAQ,EAAE,QAAQ,CAAC;aACvC;YACD;gBACE,mHAAmH;gBACnH,MAAM,EAAE,CAAC,YAAY,CAAC;gBACtB,iBAAiB,EAAE,QAAQ;gBAC3B,SAAS,EAAE,CAAC,QAAQ,CAAC;gBACrB,QAAQ,EAAE,UAAU;gBACpB,MAAM,EAAE,CAAC,GAAG,CAAC;gBACb,kBAAkB,EAAE,QAAQ;gBAC5B,KAAK,EAAE,CAAC,OAAO,CAAC;aACjB;YACD;gBACE,+EAA+E;gBAC/E,MAAM,EAAE,CAAC,iBAAiB,CAAC;gBAC3B,iBAAiB,EAAE,QAAQ;gBAC3B,QAAQ,EAAE,UAAU;gBACpB,MAAM,EAAE,CAAC,GAAG,CAAC;gBACb,kBAAkB,EAAE,QAAQ;gBAC5B,KAAK,EAAE,CAAC,OAAO,CAAC;aACjB;YACD;gBACE,mEAAmE;gBACnE,MAAM,EAAE,CAAC,kBAAkB,CAAC;gBAC5B,iBAAiB,EAAE,QAAQ;gBAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,CAAC;gBACtC,QAAQ,EAAE,UAAU;gBACpB,kBAAkB,EAAE,QAAQ;gBAC5B,KAAK,EAAE,CAAC,SAAS,CAAC;aACnB;SACF;KACF;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/configs/local.ts"],"names":[],"mappings":";AAGA,wBAYE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const config_1 = require("eslint/config");
|
|
7
|
+
const is_ci_1 = __importDefault(require("is-ci"));
|
|
8
|
+
exports.default = (0, config_1.defineConfig)(is_ci_1.default
|
|
9
|
+
? {}
|
|
10
|
+
: {
|
|
11
|
+
rules: {
|
|
12
|
+
// Only activate in CI, as suggested here: https://typescript-eslint.io/linting/troubleshooting/performance-troubleshooting#eslint-plugin-import
|
|
13
|
+
'import/no-cycle': 'off',
|
|
14
|
+
'import/no-deprecated': 'off',
|
|
15
|
+
'import/no-named-as-default': 'off',
|
|
16
|
+
'import/no-unused-modules': 'off',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
//# sourceMappingURL=local.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../src/configs/local.ts"],"names":[],"mappings":";;;;;AAAA,0CAA6C;AAC7C,kDAAyB;AAEzB,kBAAe,IAAA,qBAAY,EACzB,eAAI;IACF,CAAC,CAAC,EAAE;IACJ,CAAC,CAAC;QACE,KAAK,EAAE;YACL,gJAAgJ;YAChJ,iBAAiB,EAAE,KAAK;YACxB,sBAAsB,EAAE,KAAK;YAC7B,4BAA4B,EAAE,KAAK;YACnC,0BAA0B,EAAE,KAAK;SAClC;KACF,CACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs.d.ts","sourceRoot":"","sources":["../../../src/configs/nextjs.ts"],"names":[],"mappings":";AAKA,wBAkIE"}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const eslint_plugin_next_1 = __importDefault(require("@next/eslint-plugin-next"));
|
|
7
|
+
const config_1 = require("eslint/config");
|
|
8
|
+
const nextjs_utils_js_1 = require("../lib/nextjs.utils.js");
|
|
9
|
+
const react_js_1 = __importDefault(require("./react.js"));
|
|
10
|
+
exports.default = (0, config_1.defineConfig)(...react_js_1.default, {
|
|
11
|
+
plugins: {
|
|
12
|
+
'@next/next': eslint_plugin_next_1.default,
|
|
13
|
+
},
|
|
14
|
+
rules: {
|
|
15
|
+
...eslint_plugin_next_1.default.configs.recommended.rules,
|
|
16
|
+
...eslint_plugin_next_1.default.configs['core-web-vitals'].rules,
|
|
17
|
+
},
|
|
18
|
+
}, {
|
|
19
|
+
files: [`{app,src/app}/**/{${nextjs_utils_js_1.NEXTJS_ROUTING_FILES.join(',')}}.{ts,tsx}`],
|
|
20
|
+
rules: {
|
|
21
|
+
'import/no-unused-modules': ['off'],
|
|
22
|
+
// eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh
|
|
23
|
+
'react-refresh/only-export-components': [
|
|
24
|
+
'warn',
|
|
25
|
+
{
|
|
26
|
+
allowExportNames: [
|
|
27
|
+
/**
|
|
28
|
+
* Next.js allows exporting the following options in pages, layouts and route handlers
|
|
29
|
+
*
|
|
30
|
+
* @see https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
|
|
31
|
+
*/
|
|
32
|
+
'dynamic',
|
|
33
|
+
'dynamicParams',
|
|
34
|
+
'fetchCache',
|
|
35
|
+
'maxDuration',
|
|
36
|
+
'preferredRegion',
|
|
37
|
+
'revalidate',
|
|
38
|
+
'runtime',
|
|
39
|
+
/**
|
|
40
|
+
* Next.js allows exporting the following metadata options in layouts and pages
|
|
41
|
+
*
|
|
42
|
+
* @link https://nextjs.org/docs/app/api-reference/functions/generate-metadata
|
|
43
|
+
*/
|
|
44
|
+
'generateMetadata',
|
|
45
|
+
'metadata',
|
|
46
|
+
/**
|
|
47
|
+
* Next.js allows exporting the following static params functions in pages
|
|
48
|
+
*
|
|
49
|
+
* @link https://nextjs.org/docs/app/api-reference/functions/generate-static-params
|
|
50
|
+
*/
|
|
51
|
+
'generateStaticParams',
|
|
52
|
+
/**
|
|
53
|
+
* Next.js allows exporting the following viewport options in layouts and pages
|
|
54
|
+
*
|
|
55
|
+
* @link https://nextjs.org/docs/app/api-reference/functions/generate-viewport
|
|
56
|
+
*/
|
|
57
|
+
'generateViewport',
|
|
58
|
+
'viewport',
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
}, {
|
|
64
|
+
files: [`{instrumentation,src/instrumentation}.{ts,tsx}`],
|
|
65
|
+
rules: {
|
|
66
|
+
'import/no-unused-modules': ['off'],
|
|
67
|
+
// eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh
|
|
68
|
+
'react-refresh/only-export-components': [
|
|
69
|
+
'warn',
|
|
70
|
+
{
|
|
71
|
+
allowExportNames: [
|
|
72
|
+
/**
|
|
73
|
+
* Next.js allows exporting the following exports in instrumentation files
|
|
74
|
+
*
|
|
75
|
+
* @link https://nextjs.org/docs/app/guides/instrumentation#convention
|
|
76
|
+
*/
|
|
77
|
+
'register',
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
}, {
|
|
83
|
+
/**
|
|
84
|
+
* Next.js 'middleware' files are beeing deprecated in favor of the new proxy files with v16+
|
|
85
|
+
*
|
|
86
|
+
* @link https://nextjs.org/blog/next-16#proxyts-formerly-middlewarets
|
|
87
|
+
*/
|
|
88
|
+
files: [`{middleware,src/middleware}.{ts,tsx}`],
|
|
89
|
+
rules: {
|
|
90
|
+
'import/no-unused-modules': ['off'],
|
|
91
|
+
// eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh
|
|
92
|
+
'react-refresh/only-export-components': [
|
|
93
|
+
'warn',
|
|
94
|
+
{
|
|
95
|
+
allowExportNames: [
|
|
96
|
+
/**
|
|
97
|
+
* Next.js allows exporting the following config options in middleware
|
|
98
|
+
*
|
|
99
|
+
* @link https://nextjs.org/docs/app/api-reference/file-conventions/middleware#config-object-optional
|
|
100
|
+
*/
|
|
101
|
+
'config',
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
}, {
|
|
107
|
+
files: [`{proxy,src/proxy}.{ts,tsx}`],
|
|
108
|
+
rules: {
|
|
109
|
+
'import/no-unused-modules': ['off'],
|
|
110
|
+
// eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh
|
|
111
|
+
'react-refresh/only-export-components': [
|
|
112
|
+
'warn',
|
|
113
|
+
{
|
|
114
|
+
allowExportNames: [
|
|
115
|
+
/**
|
|
116
|
+
* Next.js allows exporting the following exports in proxy files
|
|
117
|
+
*
|
|
118
|
+
* @link https://nextjs.org/docs/app/api-reference/file-conventions/proxy#config-object-optional
|
|
119
|
+
*/
|
|
120
|
+
'config',
|
|
121
|
+
'proxy',
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
],
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
//# sourceMappingURL=nextjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nextjs.js","sourceRoot":"","sources":["../../../src/configs/nextjs.ts"],"names":[],"mappings":";;;;;AAAA,kFAAkD;AAClD,0CAA6C;AAC7C,4DAA8D;AAC9D,0DAA+B;AAE/B,kBAAe,IAAA,qBAAY,EACzB,GAAG,kBAAK,EACR;IACE,OAAO,EAAE;QACP,YAAY,EAAE,4BAAU;KACzB;IACD,KAAK,EAAE;QACL,GAAG,4BAAU,CAAC,OAAO,CAAC,WAAW,CAAC,KAAK;QACvC,GAAG,4BAAU,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,KAAK;KAC/C;CACF,EACD;IACE,KAAK,EAAE,CAAC,qBAAqB,sCAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC;IACxE,KAAK,EAAE;QACL,0BAA0B,EAAE,CAAC,KAAK,CAAC;QAEnC,0FAA0F;QAC1F,sCAAsC,EAAE;YACtC,MAAM;YACN;gBACE,gBAAgB,EAAE;oBAChB;;;;uBAIG;oBACH,SAAS;oBACT,eAAe;oBACf,YAAY;oBACZ,aAAa;oBACb,iBAAiB;oBACjB,YAAY;oBACZ,SAAS;oBAET;;;;uBAIG;oBACH,kBAAkB;oBAClB,UAAU;oBAEV;;;;uBAIG;oBACH,sBAAsB;oBAEtB;;;;uBAIG;oBACH,kBAAkB;oBAClB,UAAU;iBACX;aACF;SACF;KACF;CACF,EACD;IACE,KAAK,EAAE,CAAC,gDAAgD,CAAC;IACzD,KAAK,EAAE;QACL,0BAA0B,EAAE,CAAC,KAAK,CAAC;QAEnC,0FAA0F;QAC1F,sCAAsC,EAAE;YACtC,MAAM;YACN;gBACE,gBAAgB,EAAE;oBAChB;;;;uBAIG;oBACH,UAAU;iBACX;aACF;SACF;KACF;CACF,EACD;IACE;;;;OAIG;IACH,KAAK,EAAE,CAAC,sCAAsC,CAAC;IAC/C,KAAK,EAAE;QACL,0BAA0B,EAAE,CAAC,KAAK,CAAC;QAEnC,0FAA0F;QAC1F,sCAAsC,EAAE;YACtC,MAAM;YACN;gBACE,gBAAgB,EAAE;oBAChB;;;;uBAIG;oBACH,QAAQ;iBACT;aACF;SACF;KACF;CACF,EACD;IACE,KAAK,EAAE,CAAC,4BAA4B,CAAC;IACrC,KAAK,EAAE;QACL,0BAA0B,EAAE,CAAC,KAAK,CAAC;QAEnC,0FAA0F;QAC1F,sCAAsC,EAAE;YACtC,MAAM;YACN;gBACE,gBAAgB,EAAE;oBAChB;;;;uBAIG;oBACH,QAAQ;oBACR,OAAO;iBACR;aACF;SACF;KACF;CACF,CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.d.ts","sourceRoot":"","sources":["../../../src/configs/playwright.ts"],"names":[],"mappings":";AAWA,wBA0BG"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const eslint_plugin_playwright_1 = __importDefault(require("eslint-plugin-playwright"));
|
|
7
|
+
const config_1 = require("eslint/config");
|
|
8
|
+
const playwrightPlugin = eslint_plugin_playwright_1.default;
|
|
9
|
+
exports.default = (0, config_1.defineConfig)({
|
|
10
|
+
...playwrightPlugin.configs['flat/recommended'],
|
|
11
|
+
rules: {
|
|
12
|
+
/**
|
|
13
|
+
* At the moment, `eslint-plugin-playwright` does not fully support component testing with type information.
|
|
14
|
+
* https://github.com/playwright-community/eslint-plugin-playwright/issues/298
|
|
15
|
+
*
|
|
16
|
+
* The `mount` function is flagged as an error by the `@typescript-eslint/unbound-method` rule.
|
|
17
|
+
* But it is okay to use `mount` in this context for test files.
|
|
18
|
+
* https://typescript-eslint.io/rules/unbound-method/#when-not-to-use-it
|
|
19
|
+
*
|
|
20
|
+
* Hint: `eslint-plugin-jest` has already a customized version of this rule.
|
|
21
|
+
* https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md
|
|
22
|
+
*/
|
|
23
|
+
'@typescript-eslint/unbound-method': 'off',
|
|
24
|
+
// eslint-plugin-playwright: https://github.com/playwright-community/eslint-plugin-playwright
|
|
25
|
+
...playwrightPlugin.configs['flat/recommended'].rules,
|
|
26
|
+
'playwright/prefer-to-be': 'error',
|
|
27
|
+
'playwright/prefer-to-have-length': 'error',
|
|
28
|
+
'playwright/require-top-level-describe': 'error',
|
|
29
|
+
// eslint-plugin-sonarjs: https://github.com/SonarSource/SonarJS/blob/master/packages/analysis/src/jsts/rules/README.md
|
|
30
|
+
'sonarjs/no-duplicate-string': 'off',
|
|
31
|
+
'sonarjs/slow-regex': 'off',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=playwright.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../../../src/configs/playwright.ts"],"names":[],"mappings":";;;;;AAAA,wFAAkD;AAClD,0CAA6C;AAE7C,MAAM,gBAAgB,GAAG,kCAMxB,CAAC;AAEF,kBAAe,IAAA,qBAAY,EAAC;IAC1B,GAAG,gBAAgB,CAAC,OAAO,CAAC,kBAAkB,CAAC;IAC/C,KAAK,EAAE;QACL;;;;;;;;;;WAUG;QACH,mCAAmC,EAAE,KAAK;QAE1C,6FAA6F;QAC7F,GAAG,gBAAgB,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,KAAK;QACrD,yBAAyB,EAAE,OAAO;QAClC,kCAAkC,EAAE,OAAO;QAC3C,uCAAuC,EAAE,OAAO;QAEhD,uHAAuH;QACvH,6BAA6B,EAAE,KAAK;QACpC,oBAAoB,EAAE,KAAK;KAC5B;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier-disable.d.ts","sourceRoot":"","sources":["../../../src/configs/prettier-disable.ts"],"names":[],"mappings":";AAGA,wBAMG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const eslint_config_prettier_1 = __importDefault(require("eslint-config-prettier"));
|
|
7
|
+
const config_1 = require("eslint/config");
|
|
8
|
+
exports.default = (0, config_1.defineConfig)({
|
|
9
|
+
...eslint_config_prettier_1.default,
|
|
10
|
+
rules: {
|
|
11
|
+
...eslint_config_prettier_1.default.rules,
|
|
12
|
+
curly: 'error',
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
//# sourceMappingURL=prettier-disable.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prettier-disable.js","sourceRoot":"","sources":["../../../src/configs/prettier-disable.ts"],"names":[],"mappings":";;;;;AAAA,oFAA8C;AAC9C,0CAA6C;AAE7C,kBAAe,IAAA,qBAAY,EAAC;IAC1B,GAAG,gCAAQ;IACX,KAAK,EAAE;QACL,GAAG,gCAAQ,CAAC,KAAK;QACjB,KAAK,EAAE,OAAO;KACf;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.d.ts","sourceRoot":"","sources":["../../../src/configs/react.ts"],"names":[],"mappings":";AAyBA,wBA0GE"}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const eslint_plugin_jsx_a11y_1 = __importDefault(require("eslint-plugin-jsx-a11y"));
|
|
7
|
+
const eslint_plugin_react_1 = __importDefault(require("eslint-plugin-react"));
|
|
8
|
+
const eslint_plugin_react_hooks_1 = __importDefault(require("eslint-plugin-react-hooks"));
|
|
9
|
+
const eslint_plugin_react_refresh_1 = require("eslint-plugin-react-refresh");
|
|
10
|
+
const config_1 = require("eslint/config");
|
|
11
|
+
const globals_1 = __importDefault(require("globals"));
|
|
12
|
+
const eslint_plugin_perfectionist_js_1 = require("../lib/eslint-plugin-perfectionist.js");
|
|
13
|
+
const base_js_1 = __importDefault(require("./base.js"));
|
|
14
|
+
const reactRecommendedConfig = eslint_plugin_react_1.default.configs.flat['recommended'];
|
|
15
|
+
if (!reactRecommendedConfig) {
|
|
16
|
+
throw new Error('Expected to find the "flat/recommended" configuration in the eslint-plugin-react plugin, but it was not found.');
|
|
17
|
+
}
|
|
18
|
+
const reactJsxRuntimeConfig = eslint_plugin_react_1.default.configs.flat['jsx-runtime'];
|
|
19
|
+
if (!reactJsxRuntimeConfig) {
|
|
20
|
+
throw new Error('Expected to find the "flat/jsx-runtime" configuration in the eslint-plugin-react plugin, but it was not found.');
|
|
21
|
+
}
|
|
22
|
+
exports.default = (0, config_1.defineConfig)(...base_js_1.default, eslint_plugin_jsx_a11y_1.default.flatConfigs.recommended, reactRecommendedConfig, reactJsxRuntimeConfig, eslint_plugin_react_refresh_1.reactRefresh.configs.recommended(), {
|
|
23
|
+
languageOptions: {
|
|
24
|
+
globals: {
|
|
25
|
+
...globals_1.default.browser,
|
|
26
|
+
},
|
|
27
|
+
parserOptions: {
|
|
28
|
+
ecmaFeatures: {
|
|
29
|
+
jsx: true,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
plugins: {
|
|
34
|
+
'react-hooks': {
|
|
35
|
+
...eslint_plugin_react_hooks_1.default,
|
|
36
|
+
// the eslint-plugin-react-hooks package has some issues with the configs property as it offers the flat configs as a subproperty,
|
|
37
|
+
// which makes the config property type incompatible with the ESLint plugin definition.
|
|
38
|
+
// We just need the rules, so we can ignore the configs property.
|
|
39
|
+
configs: undefined,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
rules: {
|
|
43
|
+
// @typescript-eslint: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/docs/rules
|
|
44
|
+
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
|
|
45
|
+
'@typescript-eslint/no-restricted-types': [
|
|
46
|
+
'error',
|
|
47
|
+
{
|
|
48
|
+
types: {
|
|
49
|
+
'React.FC': {
|
|
50
|
+
message: 'Please use object type destructure declaration, see: https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components',
|
|
51
|
+
},
|
|
52
|
+
'React.FunctionalComponent': {
|
|
53
|
+
message: 'Please use object type destructure declaration, see: https://react-typescript-cheatsheet.netlify.app/docs/basic/getting-started/function_components',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
// eslint-plugin-react: https://github.com/jsx-eslint/eslint-plugin-react/tree/master/lib/rules
|
|
59
|
+
'react/jsx-pascal-case': 'error',
|
|
60
|
+
'react/jsx-sort-props': 'off', // disabled due to conflict with eslint-plugin-perfectionist
|
|
61
|
+
'react/sort-default-props': 'error',
|
|
62
|
+
// eslint-plugin-react-hooks: https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/README.md
|
|
63
|
+
'react-hooks/exhaustive-deps': 'error',
|
|
64
|
+
'react-hooks/rules-of-hooks': 'error',
|
|
65
|
+
// eslint-plugin-perfectionist: https://github.com/azat-io/eslint-plugin-perfectionist
|
|
66
|
+
'perfectionist/sort-imports': [
|
|
67
|
+
'error',
|
|
68
|
+
{
|
|
69
|
+
customGroups: [
|
|
70
|
+
{
|
|
71
|
+
elementNamePattern: ['^react$'],
|
|
72
|
+
groupName: 'react',
|
|
73
|
+
},
|
|
74
|
+
],
|
|
75
|
+
groups: ['react', ...eslint_plugin_perfectionist_js_1.SORT_IMPORTS_GROUPS],
|
|
76
|
+
newlinesBetween: 0, // No newlines are allowed between groups
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
'perfectionist/sort-jsx-props': [
|
|
80
|
+
'error',
|
|
81
|
+
{
|
|
82
|
+
customGroups: [
|
|
83
|
+
{
|
|
84
|
+
elementNamePattern: '^on.+',
|
|
85
|
+
groupName: 'callback',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
elementNamePattern: ['children', 'dangerouslySetInnerHTML', 'key', 'ref'], // Reserved props from: https://github.com/jsx-eslint/eslint-plugin-react/blob/master/lib/rules/jsx-sort-props.js#L41-L46
|
|
89
|
+
groupName: 'reservedProps',
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
groups: ['reservedProps', 'unknown', 'callback'],
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
// eslint-plugin-react-refresh: https://github.com/ArnaudBarre/eslint-plugin-react-refresh
|
|
96
|
+
'react-refresh/only-export-components': 'warn',
|
|
97
|
+
// Forbid enum declaration
|
|
98
|
+
'no-restricted-syntax': [
|
|
99
|
+
'error',
|
|
100
|
+
{
|
|
101
|
+
message: "Don't declare enums",
|
|
102
|
+
selector: 'TSEnumDeclaration',
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
settings: {
|
|
107
|
+
perfectionist: {
|
|
108
|
+
...eslint_plugin_perfectionist_js_1.PERFECTIONIST_SETTINGS,
|
|
109
|
+
},
|
|
110
|
+
react: {
|
|
111
|
+
version: 'detect',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
});
|
|
115
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/configs/react.ts"],"names":[],"mappings":";;;;;AAAA,oFAA6C;AAC7C,8EAAwC;AACxC,0FAAmD;AACnD,6EAA2D;AAC3D,0CAA6C;AAC7C,sDAA8B;AAC9B,0FAAoG;AACpG,wDAA6B;AAE7B,MAAM,sBAAsB,GAAG,6BAAK,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAEjE,IAAI,CAAC,sBAAsB,EAAE,CAAC;IAC5B,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;AACJ,CAAC;AAED,MAAM,qBAAqB,GAAG,6BAAK,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;AAEhE,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC3B,MAAM,IAAI,KAAK,CACb,gHAAgH,CACjH,CAAC;AACJ,CAAC;AAED,kBAAe,IAAA,qBAAY,EACzB,GAAG,iBAAI,EACP,gCAAO,CAAC,WAAW,CAAC,WAAW,EAC/B,sBAAsB,EACtB,qBAAqB,EACrB,0CAAY,CAAC,OAAO,CAAC,WAAW,EAAE,EAClC;IACE,eAAe,EAAE;QACf,OAAO,EAAE;YACP,GAAG,iBAAO,CAAC,OAAO;SACnB;QACD,aAAa,EAAE;YACb,YAAY,EAAE;gBACZ,GAAG,EAAE,IAAI;aACV;SACF;KACF;IACD,OAAO,EAAE;QACP,aAAa,EAAE;YACb,GAAG,mCAAU;YACb,kIAAkI;YAClI,uFAAuF;YACvF,iEAAiE;YACjE,OAAO,EAAE,SAAS;SACnB;KACF;IACD,KAAK,EAAE;QACL,yHAAyH;QACzH,gDAAgD,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;QACnE,wCAAwC,EAAE;YACxC,OAAO;YACP;gBACE,KAAK,EAAE;oBACL,UAAU,EAAE;wBACV,O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