@agilebot/eslint-config 0.3.9 → 0.3.11
Sign up to get free protection for your applications and to get access to all the features.
- package/LICENSE +9 -9
- package/LICENSE.tpl +8 -8
- package/README.md +15 -15
- package/bin/eslint-agilebot +2 -2
- package/dist/cli.js +16 -25
- package/dist/index.d.ts +4 -2
- package/dist/index.js +136 -128
- package/package.json +18 -18
package/LICENSE
CHANGED
@@ -1,9 +1,9 @@
|
|
1
|
-
The MIT License (MIT)
|
2
|
-
|
3
|
-
Copyright (c) 2024 Agilebot, Inc.
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
-
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
-
|
9
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2024 Agilebot, Inc.
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/LICENSE.tpl
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
/**
|
2
|
-
* @license %(name)s v%(version)s
|
3
|
-
*
|
4
|
-
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
|
-
*
|
6
|
-
* This source code is licensed under the MIT license found in the
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
8
|
-
*/
|
1
|
+
/**
|
2
|
+
* @license %(name)s v%(version)s
|
3
|
+
*
|
4
|
+
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
|
+
*
|
6
|
+
* This source code is licensed under the MIT license found in the
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
8
|
+
*/
|
package/README.md
CHANGED
@@ -1,15 +1,15 @@
|
|
1
|
-
# @agilebot/eslint-config
|
2
|
-
|
3
|
-
### Usage
|
4
|
-
|
5
|
-
```bash
|
6
|
-
npm install --save-dev eslint \
|
7
|
-
@agilebot/eslint-config
|
8
|
-
```
|
9
|
-
|
10
|
-
```js
|
11
|
-
// .eslintrc.js
|
12
|
-
const { agilebot } = require('@agilebot/eslint-config');
|
13
|
-
|
14
|
-
module.exports = agilebot(__dirname);
|
15
|
-
```
|
1
|
+
# @agilebot/eslint-config
|
2
|
+
|
3
|
+
### Usage
|
4
|
+
|
5
|
+
```bash
|
6
|
+
npm install --save-dev eslint \
|
7
|
+
@agilebot/eslint-config
|
8
|
+
```
|
9
|
+
|
10
|
+
```js
|
11
|
+
// .eslintrc.js
|
12
|
+
const { agilebot } = require('@agilebot/eslint-config');
|
13
|
+
|
14
|
+
module.exports = agilebot(__dirname);
|
15
|
+
```
|
package/bin/eslint-agilebot
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
#!/usr/bin/env node
|
2
|
-
require('../dist/cli').cli();
|
1
|
+
#!/usr/bin/env node
|
2
|
+
require('../dist/cli').cli();
|
package/dist/cli.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
/**
|
2
|
-
* @license @agilebot/eslint-config v0.3.
|
3
|
-
*
|
4
|
-
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
|
-
*
|
6
|
-
* This source code is licensed under the MIT license found in the
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
8
|
-
*/
|
1
|
+
/**
|
2
|
+
* @license @agilebot/eslint-config v0.3.11
|
3
|
+
*
|
4
|
+
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
|
+
*
|
6
|
+
* This source code is licensed under the MIT license found in the
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
8
|
+
*/
|
9
9
|
|
10
10
|
"use strict";
|
11
11
|
var __create = Object.create;
|
@@ -48,21 +48,12 @@ var import_node_fs = __toESM(require("fs"));
|
|
48
48
|
var import_node_path = __toESM(require("path"));
|
49
49
|
var import_eslint_utils = require("@agilebot/eslint-utils");
|
50
50
|
|
51
|
-
// src/
|
52
|
-
var
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
".cjs",
|
58
|
-
".mjs",
|
59
|
-
".cts",
|
60
|
-
".mts",
|
61
|
-
".vue"
|
62
|
-
];
|
63
|
-
|
64
|
-
// src/cli/constants.ts
|
65
|
-
var isEslint = /^\.eslint.*/;
|
51
|
+
// src/constants.ts
|
52
|
+
var JS_EXTS = [".js", ".jsx", ".cjs", ".cjsx", ".mjs", ".mjsx"];
|
53
|
+
var TS_EXTS = [".ts", ".tsx", ".cts", ".ctsx", ".mts", ".mtsx"];
|
54
|
+
var VUE_EXTS = [".vue"];
|
55
|
+
var DEFAULT_EXTS = [...JS_EXTS, ...TS_EXTS, ...VUE_EXTS];
|
56
|
+
var IS_ESLINT = /^\.eslint.*/;
|
66
57
|
|
67
58
|
// src/cli/index.ts
|
68
59
|
function cli() {
|
@@ -87,7 +78,7 @@ function cli() {
|
|
87
78
|
process.argv.splice(2, 0, "--fix");
|
88
79
|
}
|
89
80
|
if (!has.ext) {
|
90
|
-
process.argv.splice(2, 0, "--ext",
|
81
|
+
process.argv.splice(2, 0, "--ext", DEFAULT_EXTS.join(","));
|
91
82
|
}
|
92
83
|
if (has.progress && !(0, import_eslint_utils.isCI)()) {
|
93
84
|
process.argv.splice(
|
@@ -108,7 +99,7 @@ function cli() {
|
|
108
99
|
throw err;
|
109
100
|
}
|
110
101
|
has.config = has.config || files.some((file) => {
|
111
|
-
return
|
102
|
+
return IS_ESLINT.test(file);
|
112
103
|
});
|
113
104
|
if (!has.config) {
|
114
105
|
throw new Error("No ESLint configuration file found");
|
package/dist/index.d.ts
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
import { Linter } from 'eslint';
|
2
2
|
|
3
|
+
type ESLintConfig = Linter.LegacyConfig;
|
4
|
+
|
3
5
|
interface FactoryOptions {
|
4
6
|
/**
|
5
7
|
* ESLint configuration
|
6
8
|
* @default undefined
|
7
9
|
*/
|
8
|
-
config?: Pick<
|
10
|
+
config?: Pick<ESLintConfig, 'rules' | 'settings'>;
|
9
11
|
/**
|
10
12
|
* List of development dependencies
|
11
13
|
* @default undefined
|
@@ -45,7 +47,7 @@ interface FactoryOptions {
|
|
45
47
|
* Flag indicating whether to enable GoDaddy configurations
|
46
48
|
* @default undefined
|
47
49
|
*/
|
48
|
-
godaddy?: boolean;
|
50
|
+
godaddy?: boolean | 'typescript';
|
49
51
|
/**
|
50
52
|
* Flag indicating whether to enable JSDoc configurations
|
51
53
|
* @default true
|
package/dist/index.js
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
/**
|
2
|
-
* @license @agilebot/eslint-config v0.3.
|
3
|
-
*
|
4
|
-
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
|
-
*
|
6
|
-
* This source code is licensed under the MIT license found in the
|
7
|
-
* LICENSE file in the root directory of this source tree.
|
8
|
-
*/
|
1
|
+
/**
|
2
|
+
* @license @agilebot/eslint-config v0.3.11
|
3
|
+
*
|
4
|
+
* Copyright (c) Agilebot, Inc. and its affiliates.
|
5
|
+
*
|
6
|
+
* This source code is licensed under the MIT license found in the
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
8
|
+
*/
|
9
9
|
|
10
10
|
"use strict";
|
11
11
|
var __create = Object.create;
|
@@ -59,16 +59,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
59
59
|
));
|
60
60
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
61
61
|
|
62
|
-
// ../../node_modules/.pnpm/tsup@8.
|
62
|
+
// ../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js
|
63
63
|
var init_cjs_shims = __esm({
|
64
|
-
"../../node_modules/.pnpm/tsup@8.
|
64
|
+
"../../node_modules/.pnpm/tsup@8.2.4_jiti@1.21.6_postcss@8.4.40_typescript@5.4.5_yaml@2.5.0/node_modules/tsup/assets/cjs_shims.js"() {
|
65
65
|
"use strict";
|
66
66
|
}
|
67
67
|
});
|
68
68
|
|
69
|
-
// ../../node_modules/.pnpm/eslint-config-love@47.0.0_@typescript-eslint+eslint-plugin@7.
|
69
|
+
// ../../node_modules/.pnpm/eslint-config-love@47.0.0_@typescript-eslint+eslint-plugin@7.16.0_@typescript-eslint+parser@7_dbttxvpwn6s6gyqfajsab2uz5m/node_modules/eslint-config-love/lib/index.js
|
70
70
|
var require_lib = __commonJS({
|
71
|
-
"../../node_modules/.pnpm/eslint-config-love@47.0.0_@typescript-eslint+eslint-plugin@7.
|
71
|
+
"../../node_modules/.pnpm/eslint-config-love@47.0.0_@typescript-eslint+eslint-plugin@7.16.0_@typescript-eslint+parser@7_dbttxvpwn6s6gyqfajsab2uz5m/node_modules/eslint-config-love/lib/index.js"(exports2, module2) {
|
72
72
|
"use strict";
|
73
73
|
init_cjs_shims();
|
74
74
|
var eslint_1 = require("eslint");
|
@@ -520,9 +520,10 @@ function standard() {
|
|
520
520
|
standardRules[key] = value;
|
521
521
|
}
|
522
522
|
});
|
523
|
+
const disabled = standardDisabled();
|
523
524
|
return {
|
524
525
|
plugins: ["@typescript-eslint", "import-x", "n", "promise"],
|
525
|
-
rules: __spreadProps(__spreadValues({}, standardRules), {
|
526
|
+
rules: __spreadValues(__spreadProps(__spreadValues({}, standardRules), {
|
526
527
|
"no-alert": "error",
|
527
528
|
// 找出TODO注释,以便后期修复
|
528
529
|
"no-warning-comments": [
|
@@ -545,8 +546,13 @@ function standard() {
|
|
545
546
|
"promise/valid-params": "error",
|
546
547
|
"promise/no-multiple-resolved": "error",
|
547
548
|
"promise/no-return-in-finally": "error",
|
548
|
-
"promise/prefer-await-to-then": "warn"
|
549
|
-
|
549
|
+
"promise/prefer-await-to-then": "warn"
|
550
|
+
}), disabled.rules)
|
551
|
+
};
|
552
|
+
}
|
553
|
+
function standardDisabled() {
|
554
|
+
return {
|
555
|
+
rules: {
|
550
556
|
"@typescript-eslint/no-confusing-void-expression": "off",
|
551
557
|
"@typescript-eslint/space-before-function-paren": "off",
|
552
558
|
"@typescript-eslint/unbound-method": "off",
|
@@ -557,9 +563,8 @@ function standard() {
|
|
557
563
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
558
564
|
"@typescript-eslint/explicit-function-return-type": "off",
|
559
565
|
"@typescript-eslint/restrict-template-expressions": "off",
|
560
|
-
"@typescript-eslint/explicit-member-accessibility": "off",
|
561
566
|
"@typescript-eslint/no-unsafe-argument": "off"
|
562
|
-
}
|
567
|
+
}
|
563
568
|
};
|
564
569
|
}
|
565
570
|
|
@@ -604,28 +609,18 @@ function ts() {
|
|
604
609
|
],
|
605
610
|
// 优先使用interface而不是type
|
606
611
|
"@typescript-eslint/consistent-type-definitions": "error",
|
607
|
-
// The `@typescript-eslint/naming-convention` rule allows `leadingUnderscore` and `trailingUnderscore` settings.
|
608
|
-
// However, the existing `no-underscore-dangle` rule already takes care of this.
|
609
612
|
"@typescript-eslint/naming-convention": [
|
610
613
|
"error",
|
611
|
-
//
|
614
|
+
// variable规则在@agilebot/var-naming中定义
|
612
615
|
{
|
613
|
-
selector: "
|
614
|
-
format: ["camelCase", "PascalCase"
|
615
|
-
filter: {
|
616
|
-
regex: "^(__dirname|__filename)$",
|
617
|
-
match: false
|
618
|
-
}
|
616
|
+
selector: "function",
|
617
|
+
format: ["camelCase", "PascalCase"]
|
619
618
|
},
|
620
|
-
// Allow camelCase functions (23.2), and PascalCase functions (23.8)
|
621
619
|
{
|
622
|
-
selector: "
|
620
|
+
selector: "variable",
|
621
|
+
types: ["function"],
|
623
622
|
format: ["camelCase", "PascalCase"]
|
624
623
|
},
|
625
|
-
// Airbnb recommends PascalCase for classes (23.3),
|
626
|
-
// and although Airbnb does not make TypeScript recommendations,
|
627
|
-
// we are assuming this rule would similarly apply to anything "type like",
|
628
|
-
// including interfaces, type aliases, and enums
|
629
624
|
{
|
630
625
|
selector: "typeLike",
|
631
626
|
format: ["PascalCase"]
|
@@ -637,12 +632,21 @@ function ts() {
|
|
637
632
|
},
|
638
633
|
{
|
639
634
|
selector: "method",
|
640
|
-
format: ["camelCase"
|
635
|
+
format: ["camelCase"]
|
636
|
+
},
|
637
|
+
{
|
638
|
+
selector: "classProperty",
|
639
|
+
format: ["camelCase", "UPPER_CASE", "PascalCase"],
|
640
|
+
leadingUnderscore: "allow"
|
641
641
|
},
|
642
642
|
{
|
643
643
|
selector: "typeProperty",
|
644
644
|
format: ["camelCase"]
|
645
645
|
},
|
646
|
+
{
|
647
|
+
selector: "enum",
|
648
|
+
format: ["PascalCase"]
|
649
|
+
},
|
646
650
|
{
|
647
651
|
selector: "enumMember",
|
648
652
|
format: ["PascalCase", "UPPER_CASE"]
|
@@ -666,6 +670,32 @@ function ts() {
|
|
666
670
|
}
|
667
671
|
};
|
668
672
|
}
|
673
|
+
function tsOnly() {
|
674
|
+
return {
|
675
|
+
rules: {
|
676
|
+
"@typescript-eslint/explicit-member-accessibility": "error"
|
677
|
+
}
|
678
|
+
};
|
679
|
+
}
|
680
|
+
function jsOnly() {
|
681
|
+
return {
|
682
|
+
rules: {
|
683
|
+
"@typescript-eslint/no-var-requires": "off"
|
684
|
+
}
|
685
|
+
};
|
686
|
+
}
|
687
|
+
function dts() {
|
688
|
+
return {
|
689
|
+
rules: {
|
690
|
+
// .d.ts中支持导入ts文件中的类型
|
691
|
+
"@typescript-eslint/consistent-type-imports": "off",
|
692
|
+
// .d.ts中忽略属性命名规则
|
693
|
+
"@typescript-eslint/naming-convention": "off",
|
694
|
+
// .d.ts中忽略三斜线引用
|
695
|
+
"@typescript-eslint/triple-slash-reference": "off"
|
696
|
+
}
|
697
|
+
};
|
698
|
+
}
|
669
699
|
|
670
700
|
// src/configs/imports.ts
|
671
701
|
init_cjs_shims();
|
@@ -1055,12 +1085,6 @@ function agilebot(opts) {
|
|
1055
1085
|
}
|
1056
1086
|
}
|
1057
1087
|
}
|
1058
|
-
],
|
1059
|
-
"@agilebot/func-naming": [
|
1060
|
-
"error",
|
1061
|
-
{
|
1062
|
-
format: "camelCase"
|
1063
|
-
}
|
1064
1088
|
]
|
1065
1089
|
},
|
1066
1090
|
settings: {
|
@@ -1123,27 +1147,21 @@ function godaddy() {
|
|
1123
1147
|
};
|
1124
1148
|
}
|
1125
1149
|
|
1126
|
-
// src/
|
1150
|
+
// src/constants.ts
|
1127
1151
|
init_cjs_shims();
|
1128
|
-
var
|
1129
|
-
|
1130
|
-
|
1131
|
-
|
1132
|
-
|
1133
|
-
".cjs",
|
1134
|
-
".mjs",
|
1135
|
-
".cts",
|
1136
|
-
".mts",
|
1137
|
-
".vue"
|
1138
|
-
];
|
1139
|
-
var jsExtensions = [".js", ".jsx", ".cjs", ".mjs"];
|
1140
|
-
var tsExtensions = [".ts", ".tsx", ".cts", ".mts"];
|
1141
|
-
var dtsExtensions = [".d.ts", ".d.cts", ".d.mts"];
|
1152
|
+
var JS_EXTS = [".js", ".jsx", ".cjs", ".cjsx", ".mjs", ".mjsx"];
|
1153
|
+
var TS_EXTS = [".ts", ".tsx", ".cts", ".ctsx", ".mts", ".mtsx"];
|
1154
|
+
var DTS_EXTS = [".d.ts", ".d.cts", ".d.mts"];
|
1155
|
+
var VUE_EXTS = [".vue"];
|
1156
|
+
var DEFAULT_EXTS = [...JS_EXTS, ...TS_EXTS, ...VUE_EXTS];
|
1142
1157
|
|
1143
1158
|
// src/factory/index.ts
|
1144
1159
|
function factory(root, options) {
|
1145
1160
|
var _a, _b, _c, _d, _e;
|
1146
1161
|
import_node_assert.default.ok(root, "root option is required");
|
1162
|
+
const tsconfigFiles = (0, import_eslint_utils3.findTsconfigFiles)(root, {
|
1163
|
+
absolute: true
|
1164
|
+
});
|
1147
1165
|
const defaultOptions = {
|
1148
1166
|
jsdoc: true,
|
1149
1167
|
prettier: true,
|
@@ -1173,8 +1191,11 @@ function factory(root, options) {
|
|
1173
1191
|
}) : {},
|
1174
1192
|
options.prettier ? prettier() : {}
|
1175
1193
|
];
|
1194
|
+
let config;
|
1176
1195
|
if (options == null ? void 0 : options.godaddy) {
|
1177
|
-
|
1196
|
+
config = __spreadValues({
|
1197
|
+
parser: options.godaddy === "typescript" ? "@typescript-eslint/parser" : void 0
|
1198
|
+
}, (0, import_eslint_utils3.mergeESLintConfig)(
|
1178
1199
|
godaddy(),
|
1179
1200
|
(options == null ? void 0 : options.jsdoc) ? jsdoc({
|
1180
1201
|
ts: false
|
@@ -1184,82 +1205,69 @@ function factory(root, options) {
|
|
1184
1205
|
ts: false
|
1185
1206
|
}) : {},
|
1186
1207
|
(_b = options == null ? void 0 : options.config) != null ? _b : {}
|
1187
|
-
);
|
1188
|
-
}
|
1189
|
-
|
1190
|
-
|
1191
|
-
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1200
|
-
|
1201
|
-
|
1202
|
-
},
|
1203
|
-
sourceType: options.module ? "module" : void 0,
|
1204
|
-
extraFileExtensions: !(options == null ? void 0 : options.vue) ? void 0 : [".vue"]
|
1205
|
-
}
|
1206
|
-
}, (0, import_eslint_utils3.mergeESLintConfig)(
|
1207
|
-
env(),
|
1208
|
-
standard(),
|
1209
|
-
// standard必须在ts之前
|
1210
|
-
ts(),
|
1211
|
-
(options == null ? void 0 : options.react) ? react({ version: options.react }) : {},
|
1212
|
-
(options == null ? void 0 : options.vue) ? vue({
|
1213
|
-
version: options.vue
|
1214
|
-
}) : {},
|
1215
|
-
(options == null ? void 0 : options.jsdoc) ? jsdoc({
|
1216
|
-
ts: true
|
1217
|
-
}) : {},
|
1218
|
-
(options == null ? void 0 : options.lodash) ? lodash() : {},
|
1219
|
-
deprecation(),
|
1220
|
-
(options == null ? void 0 : options.cspell) ? cspell({
|
1221
|
-
words: (_c = options == null ? void 0 : options.cspellWords) != null ? _c : []
|
1222
|
-
}) : {},
|
1223
|
-
...commonConfigs,
|
1224
|
-
agilebot({
|
1225
|
-
root,
|
1226
|
-
monorepoScope: options == null ? void 0 : options.monorepoScope
|
1227
|
-
}),
|
1228
|
-
(_d = options == null ? void 0 : options.config) != null ? _d : {}
|
1229
|
-
)),
|
1230
|
-
__spreadValues({
|
1231
|
-
files: jsExtensions.map((ext) => `*${ext}`)
|
1232
|
-
}, (0, import_eslint_utils3.mergeESLintConfig)(
|
1233
|
-
{
|
1234
|
-
rules: {
|
1235
|
-
"@typescript-eslint/no-var-requires": "off"
|
1208
|
+
));
|
1209
|
+
} else {
|
1210
|
+
config = {
|
1211
|
+
overrides: [
|
1212
|
+
__spreadValues({
|
1213
|
+
files: DEFAULT_EXTS.map((ext) => `*${ext}`),
|
1214
|
+
parser: !(options == null ? void 0 : options.vue) ? "@typescript-eslint/parser" : "vue-eslint-parser",
|
1215
|
+
parserOptions: {
|
1216
|
+
parser: "@typescript-eslint/parser",
|
1217
|
+
tsconfigRootDir: root,
|
1218
|
+
ecmaFeatures: {
|
1219
|
+
jsx: true
|
1220
|
+
},
|
1221
|
+
sourceType: options.module ? "module" : void 0,
|
1222
|
+
extraFileExtensions: !(options == null ? void 0 : options.vue) ? void 0 : [".vue"]
|
1236
1223
|
}
|
1237
|
-
},
|
1238
|
-
|
1239
|
-
|
1240
|
-
|
1241
|
-
|
1242
|
-
|
1243
|
-
|
1244
|
-
|
1245
|
-
|
1246
|
-
|
1247
|
-
|
1248
|
-
|
1249
|
-
|
1250
|
-
|
1251
|
-
|
1252
|
-
|
1253
|
-
|
1254
|
-
|
1255
|
-
|
1256
|
-
|
1257
|
-
|
1258
|
-
|
1259
|
-
|
1260
|
-
|
1224
|
+
}, (0, import_eslint_utils3.mergeESLintConfig)(
|
1225
|
+
env(),
|
1226
|
+
standard(),
|
1227
|
+
// standard必须在ts之前
|
1228
|
+
ts(),
|
1229
|
+
(options == null ? void 0 : options.react) ? react({ version: options.react }) : {},
|
1230
|
+
(options == null ? void 0 : options.vue) ? vue({
|
1231
|
+
version: options.vue
|
1232
|
+
}) : {},
|
1233
|
+
(options == null ? void 0 : options.jsdoc) ? jsdoc({
|
1234
|
+
ts: true
|
1235
|
+
}) : {},
|
1236
|
+
(options == null ? void 0 : options.lodash) ? lodash() : {},
|
1237
|
+
deprecation(),
|
1238
|
+
(options == null ? void 0 : options.cspell) ? cspell({
|
1239
|
+
words: (_c = options == null ? void 0 : options.cspellWords) != null ? _c : []
|
1240
|
+
}) : {},
|
1241
|
+
...commonConfigs,
|
1242
|
+
agilebot({
|
1243
|
+
root,
|
1244
|
+
monorepoScope: options == null ? void 0 : options.monorepoScope
|
1245
|
+
}),
|
1246
|
+
(_d = options == null ? void 0 : options.config) != null ? _d : {}
|
1247
|
+
)),
|
1248
|
+
__spreadValues({
|
1249
|
+
files: JS_EXTS.map((ext) => `*${ext}`)
|
1250
|
+
}, (0, import_eslint_utils3.mergeESLintConfig)(
|
1251
|
+
jsOnly(),
|
1252
|
+
(options == null ? void 0 : options.jsdoc) ? jsdoc({
|
1253
|
+
ts: false
|
1254
|
+
}) : {}
|
1255
|
+
)),
|
1256
|
+
__spreadValues({
|
1257
|
+
files: TS_EXTS.map((ext) => `*${ext}`)
|
1258
|
+
}, tsOnly()),
|
1259
|
+
__spreadValues({
|
1260
|
+
files: DTS_EXTS.map((ext) => `*${ext}`)
|
1261
|
+
}, dts())
|
1262
|
+
]
|
1263
|
+
};
|
1264
|
+
}
|
1261
1265
|
if ((_e = config.overrides) == null ? void 0 : _e[0].parserOptions) {
|
1262
1266
|
config.overrides[0].parserOptions.project = tsconfigFiles.length > 0 ? tsconfigFiles : true;
|
1267
|
+
} else if (config.parser) {
|
1268
|
+
config.parserOptions = {
|
1269
|
+
project: tsconfigFiles.length > 0 ? tsconfigFiles : true
|
1270
|
+
};
|
1263
1271
|
}
|
1264
1272
|
return config;
|
1265
1273
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@agilebot/eslint-config",
|
3
|
-
"version": "0.3.
|
3
|
+
"version": "0.3.11",
|
4
4
|
"description": "Agilebot's ESLint config",
|
5
5
|
"bin": {
|
6
6
|
"eslint-agilebot": "bin/eslint-agilebot"
|
@@ -18,40 +18,40 @@
|
|
18
18
|
},
|
19
19
|
"homepage": "https://github.com/sh-agilebot/frontend-toolkit/tree/master/packages/eslint-config#readme",
|
20
20
|
"dependencies": {
|
21
|
-
"@cspell/eslint-plugin": "^8.
|
22
|
-
"@eslint-react/eslint-plugin": "^1.
|
23
|
-
"@stylistic/eslint-plugin": "^2.1
|
24
|
-
"@typescript-eslint/eslint-plugin": "~7.
|
25
|
-
"@typescript-eslint/parser": "~7.
|
21
|
+
"@cspell/eslint-plugin": "^8.10.4",
|
22
|
+
"@eslint-react/eslint-plugin": "^1.8.2",
|
23
|
+
"@stylistic/eslint-plugin": "^2.6.1",
|
24
|
+
"@typescript-eslint/eslint-plugin": "~7.16.0",
|
25
|
+
"@typescript-eslint/parser": "~7.16.0",
|
26
26
|
"eslint-config-godaddy": "^6.0.0",
|
27
27
|
"eslint-config-prettier": "^9.1.0",
|
28
28
|
"eslint-import-resolver-typescript": "^3.6.1",
|
29
|
-
"eslint-plugin-deprecation": "^
|
29
|
+
"eslint-plugin-deprecation": "^3.0.0",
|
30
30
|
"eslint-plugin-eslint-comments": "^3.2.0",
|
31
31
|
"eslint-plugin-file-progress": "^1.4.0",
|
32
|
-
"eslint-plugin-import-x": "^
|
33
|
-
"eslint-plugin-jsdoc": "^48.
|
34
|
-
"eslint-plugin-jsx-a11y": "^6.
|
35
|
-
"eslint-plugin-n": "^17.
|
36
|
-
"eslint-plugin-no-relative-import-paths": "^1.5.
|
32
|
+
"eslint-plugin-import-x": "^3.1.0",
|
33
|
+
"eslint-plugin-jsdoc": "^48.11.0",
|
34
|
+
"eslint-plugin-jsx-a11y": "^6.9.0",
|
35
|
+
"eslint-plugin-n": "^17.10.1",
|
36
|
+
"eslint-plugin-no-relative-import-paths": "^1.5.5",
|
37
37
|
"eslint-plugin-prefer-arrow-functions": "^3.3.2",
|
38
|
-
"eslint-plugin-prettier": "^5.1
|
39
|
-
"eslint-plugin-promise": "^
|
40
|
-
"eslint-plugin-react": "^7.
|
38
|
+
"eslint-plugin-prettier": "^5.2.1",
|
39
|
+
"eslint-plugin-promise": "^7.0.0",
|
40
|
+
"eslint-plugin-react": "^7.35.0",
|
41
41
|
"eslint-plugin-react-hooks": "^4.6.2",
|
42
|
-
"eslint-plugin-unicorn": "^
|
42
|
+
"eslint-plugin-unicorn": "^54.0.0",
|
43
43
|
"eslint-plugin-unused-imports": "^3.2.0",
|
44
44
|
"eslint-plugin-vue": "^9.26.0",
|
45
45
|
"eslint-plugin-you-dont-need-lodash-underscore": "^6.13.0",
|
46
46
|
"vue-eslint-parser": "^9.4.2",
|
47
|
-
"@agilebot/eslint-utils": "0.3.
|
47
|
+
"@agilebot/eslint-utils": "0.3.11"
|
48
48
|
},
|
49
49
|
"devDependencies": {
|
50
50
|
"eslint-config-love": "^47.0.0"
|
51
51
|
},
|
52
52
|
"peerDependencies": {
|
53
53
|
"eslint": "^7.0.0 || ^8.0.0",
|
54
|
-
"@agilebot/eslint-plugin": "0.3.
|
54
|
+
"@agilebot/eslint-plugin": "0.3.11"
|
55
55
|
},
|
56
56
|
"files": [
|
57
57
|
"bin",
|