@jsse/eslint-config 0.1.21 → 0.2.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/LICENSE +21 -21
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/index.cjs +182 -139
- package/dist/index.d.cts +653 -1423
- package/dist/index.d.ts +653 -1423
- package/dist/index.js +182 -139
- package/package.json +29 -30
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2023-PRESENT Jesse K Rubin <https://github.com/jessekrubin>
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023-PRESENT Jesse K Rubin <https://github.com/jessekrubin>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/cli.cjs
CHANGED
package/dist/cli.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
30
30
|
));
|
|
31
31
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
32
|
|
|
33
|
-
// node_modules/.pnpm/globals@15.
|
|
33
|
+
// node_modules/.pnpm/globals@15.9.0/node_modules/globals/globals.json
|
|
34
34
|
var require_globals = __commonJS({
|
|
35
|
-
"node_modules/.pnpm/globals@15.
|
|
35
|
+
"node_modules/.pnpm/globals@15.9.0/node_modules/globals/globals.json"(exports2, module2) {
|
|
36
36
|
module2.exports = {
|
|
37
37
|
amd: {
|
|
38
38
|
define: false,
|
|
@@ -68,6 +68,9 @@ var require_globals = __commonJS({
|
|
|
68
68
|
AbstractRange: false,
|
|
69
69
|
Accelerometer: false,
|
|
70
70
|
addEventListener: false,
|
|
71
|
+
ai: false,
|
|
72
|
+
AI: false,
|
|
73
|
+
AITextSession: false,
|
|
71
74
|
alert: false,
|
|
72
75
|
AnalyserNode: false,
|
|
73
76
|
Animation: false,
|
|
@@ -137,6 +140,7 @@ var require_globals = __commonJS({
|
|
|
137
140
|
CDATASection: false,
|
|
138
141
|
ChannelMergerNode: false,
|
|
139
142
|
ChannelSplitterNode: false,
|
|
143
|
+
ChapterInformation: false,
|
|
140
144
|
CharacterBoundsUpdateEvent: false,
|
|
141
145
|
CharacterData: false,
|
|
142
146
|
clearInterval: false,
|
|
@@ -201,6 +205,7 @@ var require_globals = __commonJS({
|
|
|
201
205
|
CSSNamespaceRule: false,
|
|
202
206
|
CSSNumericArray: false,
|
|
203
207
|
CSSNumericValue: false,
|
|
208
|
+
CSSPageDescriptors: false,
|
|
204
209
|
CSSPageRule: false,
|
|
205
210
|
CSSPerspective: false,
|
|
206
211
|
CSSPositionTryDescriptors: false,
|
|
@@ -2653,6 +2658,7 @@ var require_globals = __commonJS({
|
|
|
2653
2658
|
AbortController: false,
|
|
2654
2659
|
AbortSignal: false,
|
|
2655
2660
|
addEventListener: false,
|
|
2661
|
+
ai: false,
|
|
2656
2662
|
atob: false,
|
|
2657
2663
|
AudioData: false,
|
|
2658
2664
|
AudioDecoder: false,
|
|
@@ -2963,9 +2969,9 @@ var require_globals = __commonJS({
|
|
|
2963
2969
|
}
|
|
2964
2970
|
});
|
|
2965
2971
|
|
|
2966
|
-
// node_modules/.pnpm/globals@15.
|
|
2972
|
+
// node_modules/.pnpm/globals@15.9.0/node_modules/globals/index.js
|
|
2967
2973
|
var require_globals2 = __commonJS({
|
|
2968
|
-
"node_modules/.pnpm/globals@15.
|
|
2974
|
+
"node_modules/.pnpm/globals@15.9.0/node_modules/globals/index.js"(exports2, module2) {
|
|
2969
2975
|
"use strict";
|
|
2970
2976
|
module2.exports = require_globals();
|
|
2971
2977
|
}
|
|
@@ -9881,10 +9887,10 @@ function isLagerLevel(level) {
|
|
|
9881
9887
|
return level === "trace" || level === "debug" || level === "info" || level === "warn" || level === "error" || level === "fatal";
|
|
9882
9888
|
}
|
|
9883
9889
|
var Lager = class {
|
|
9890
|
+
_level = "info";
|
|
9891
|
+
id = "lager";
|
|
9892
|
+
levelNo = levels[this._level];
|
|
9884
9893
|
constructor(options) {
|
|
9885
|
-
this._level = "info";
|
|
9886
|
-
this.id = "lager";
|
|
9887
|
-
this.levelNo = levels[this._level];
|
|
9888
9894
|
const { level, id } = {
|
|
9889
9895
|
level: "info",
|
|
9890
9896
|
id: "lager",
|
|
@@ -9996,6 +10002,8 @@ var GLOB_EXCLUDE = [
|
|
|
9996
10002
|
"**/.vitepress/cache",
|
|
9997
10003
|
"**/*.bak",
|
|
9998
10004
|
"**/*.min.*",
|
|
10005
|
+
"**/.yarn",
|
|
10006
|
+
"**/.pnp.*",
|
|
9999
10007
|
"**/auto-import?(s).d.ts",
|
|
10000
10008
|
"**/bun.lockb",
|
|
10001
10009
|
"**/CHANGELOG*.md",
|
|
@@ -10530,23 +10538,6 @@ var jsdoc = async () => {
|
|
|
10530
10538
|
];
|
|
10531
10539
|
};
|
|
10532
10540
|
|
|
10533
|
-
// src/configs/tsdoc.ts
|
|
10534
|
-
var tsdoc = async () => {
|
|
10535
|
-
const { pluginTsdoc } = await importPluginTsdoc();
|
|
10536
|
-
return [
|
|
10537
|
-
{
|
|
10538
|
-
files: ["*.ts", "*.tsx"],
|
|
10539
|
-
name: "jsse/tsdoc",
|
|
10540
|
-
plugins: {
|
|
10541
|
-
tsdoc: pluginTsdoc
|
|
10542
|
-
},
|
|
10543
|
-
rules: {
|
|
10544
|
-
"tsdoc/syntax": "warn"
|
|
10545
|
-
}
|
|
10546
|
-
}
|
|
10547
|
-
];
|
|
10548
|
-
};
|
|
10549
|
-
|
|
10550
10541
|
// src/configs/jsonc.ts
|
|
10551
10542
|
var jsonc = async (options) => {
|
|
10552
10543
|
const { overrides = {}, stylistic: stylistic2 = true } = options ?? {};
|
|
@@ -10646,7 +10637,7 @@ function typescriptRulesTypeAware() {
|
|
|
10646
10637
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
10647
10638
|
"@typescript-eslint/no-unnecessary-type-arguments": "off",
|
|
10648
10639
|
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
10649
|
-
"@typescript-eslint/no-useless-template-literals": "error",
|
|
10640
|
+
// "@typescript-eslint/no-useless-template-literals": "error",
|
|
10650
10641
|
"no-throw-literal": "off",
|
|
10651
10642
|
"@typescript-eslint/only-throw-error": "error",
|
|
10652
10643
|
"@typescript-eslint/no-unsafe-argument": "error",
|
|
@@ -10789,56 +10780,61 @@ function typescriptRulesTypeOblivious() {
|
|
|
10789
10780
|
}
|
|
10790
10781
|
],
|
|
10791
10782
|
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
10792
|
-
"@typescript-eslint/ban-types": [
|
|
10793
|
-
|
|
10794
|
-
|
|
10795
|
-
|
|
10796
|
-
|
|
10797
|
-
|
|
10798
|
-
|
|
10799
|
-
|
|
10800
|
-
|
|
10801
|
-
|
|
10802
|
-
|
|
10803
|
-
|
|
10804
|
-
|
|
10805
|
-
|
|
10806
|
-
|
|
10807
|
-
|
|
10808
|
-
|
|
10809
|
-
|
|
10810
|
-
|
|
10811
|
-
|
|
10812
|
-
|
|
10813
|
-
|
|
10814
|
-
|
|
10815
|
-
|
|
10816
|
-
|
|
10817
|
-
|
|
10818
|
-
|
|
10819
|
-
|
|
10820
|
-
|
|
10821
|
-
|
|
10822
|
-
|
|
10823
|
-
|
|
10824
|
-
|
|
10825
|
-
|
|
10826
|
-
|
|
10827
|
-
|
|
10828
|
-
|
|
10829
|
-
|
|
10830
|
-
|
|
10831
|
-
|
|
10832
|
-
|
|
10833
|
-
|
|
10834
|
-
|
|
10835
|
-
|
|
10836
|
-
|
|
10837
|
-
|
|
10838
|
-
|
|
10839
|
-
|
|
10840
|
-
|
|
10841
|
-
],
|
|
10783
|
+
// "@typescript-eslint/ban-types": [
|
|
10784
|
+
// "warn",
|
|
10785
|
+
// {
|
|
10786
|
+
// extendDefaults: false,
|
|
10787
|
+
// types: {
|
|
10788
|
+
// String: {
|
|
10789
|
+
// message: 'Use "string" instead',
|
|
10790
|
+
// fixWith: "string",
|
|
10791
|
+
// },
|
|
10792
|
+
// Boolean: {
|
|
10793
|
+
// message: 'Use "boolean" instead',
|
|
10794
|
+
// fixWith: "boolean",
|
|
10795
|
+
// },
|
|
10796
|
+
// Number: {
|
|
10797
|
+
// message: 'Use "number" instead',
|
|
10798
|
+
// fixWith: "number",
|
|
10799
|
+
// },
|
|
10800
|
+
// BigInt: {
|
|
10801
|
+
// message: "Use `bigint` instead.",
|
|
10802
|
+
// fixWith: "bigint",
|
|
10803
|
+
// },
|
|
10804
|
+
// Object: {
|
|
10805
|
+
// message:
|
|
10806
|
+
// "The `Object` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead. See https://github.com/typescript-eslint/typescript-eslint/pull/848",
|
|
10807
|
+
// fixWith: "Record<string, unknown>",
|
|
10808
|
+
// },
|
|
10809
|
+
// object: {
|
|
10810
|
+
// message:
|
|
10811
|
+
// "The `object` type is hard to use. Use `Record<string, unknown>` instead. See: https://github.com/typescript-eslint/typescript-eslint/pull/848",
|
|
10812
|
+
// fixWith: "Record<string, unknown>",
|
|
10813
|
+
// },
|
|
10814
|
+
// Symbol: {
|
|
10815
|
+
// message: 'Use "symbol" instead',
|
|
10816
|
+
// fixWith: "symbol",
|
|
10817
|
+
// },
|
|
10818
|
+
// Function: {
|
|
10819
|
+
// message:
|
|
10820
|
+
// 'The "Function" type accepts any function-like value.\nIt provides no type safety when calling the function, which can be a common source of bugs.\nIt also accepts things like class declarations, which will throw at runtime as they will not be called with "new".\nIf you are expecting the function to accept certain arguments, you should explicitly define the function shape.',
|
|
10821
|
+
// },
|
|
10822
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10823
|
+
// "{}": {
|
|
10824
|
+
// message:
|
|
10825
|
+
// "The `{}` type is mostly the same as `unknown`. You probably want `Record<string, unknown>` instead.",
|
|
10826
|
+
// fixWith: "Record<string, unknown>",
|
|
10827
|
+
// },
|
|
10828
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10829
|
+
// "[]": "Don't use the empty array type `[]`. It only allows empty arrays. Use `SomeType[]` instead.",
|
|
10830
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10831
|
+
// "[[]]":
|
|
10832
|
+
// "Don't use `[[]]`. It only allows an array with a single element which is an empty array. Use `SomeType[][]` instead.",
|
|
10833
|
+
// // eslint-disable-next-line @typescript-eslint/naming-convention
|
|
10834
|
+
// "[[[]]]": "Don't use `[[[]]]`. Use `SomeType[][][]` instead.",
|
|
10835
|
+
// },
|
|
10836
|
+
// },
|
|
10837
|
+
// ],
|
|
10842
10838
|
"@typescript-eslint/consistent-type-assertions": "error",
|
|
10843
10839
|
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
|
|
10844
10840
|
"@typescript-eslint/member-ordering": [
|
|
@@ -10988,29 +10984,28 @@ function typescriptRulesTypeOblivious() {
|
|
|
10988
10984
|
],
|
|
10989
10985
|
"default-param-last": "off",
|
|
10990
10986
|
"@typescript-eslint/default-param-last": "error",
|
|
10991
|
-
"func-call-spacing": "off",
|
|
10987
|
+
// "func-call-spacing": "off",
|
|
10992
10988
|
"@typescript-eslint/func-call-spacing": ["error", "never"],
|
|
10993
|
-
"keyword-spacing": "off",
|
|
10989
|
+
// "keyword-spacing": "off",
|
|
10994
10990
|
"@typescript-eslint/keyword-spacing": "error",
|
|
10995
|
-
"lines-between-class-members": "off",
|
|
10996
|
-
"@typescript-eslint/lines-between-class-members": [
|
|
10997
|
-
|
|
10998
|
-
|
|
10999
|
-
|
|
11000
|
-
|
|
11001
|
-
|
|
11002
|
-
],
|
|
10991
|
+
// "lines-between-class-members": "off",
|
|
10992
|
+
// "@typescript-eslint/lines-between-class-members": [
|
|
10993
|
+
// "error",
|
|
10994
|
+
// "always",
|
|
10995
|
+
// {
|
|
10996
|
+
// exceptAfterSingleLine: true,
|
|
10997
|
+
// },
|
|
10998
|
+
// ],
|
|
11003
10999
|
"no-dupe-class-members": "off",
|
|
11004
11000
|
"@typescript-eslint/no-dupe-class-members": "error",
|
|
11005
11001
|
"no-empty-function": "off",
|
|
11006
11002
|
"@typescript-eslint/no-empty-function": "error",
|
|
11007
|
-
"no-extra-parens": "off",
|
|
11008
|
-
"no-extra-semi": "off",
|
|
11003
|
+
// "no-extra-parens": "off",
|
|
11004
|
+
// "no-extra-semi": "off",
|
|
11009
11005
|
"@typescript-eslint/no-extra-semi": "error",
|
|
11010
11006
|
"no-loop-func": "off",
|
|
11011
11007
|
"@typescript-eslint/no-loop-func": "error",
|
|
11012
11008
|
"no-loss-of-precision": "off",
|
|
11013
|
-
"@typescript-eslint/no-loss-of-precision": "error",
|
|
11014
11009
|
"no-redeclare": "off",
|
|
11015
11010
|
"@typescript-eslint/no-redeclare": "error",
|
|
11016
11011
|
"no-restricted-imports": "off",
|
|
@@ -11029,17 +11024,17 @@ function typescriptRulesTypeOblivious() {
|
|
|
11029
11024
|
]
|
|
11030
11025
|
}
|
|
11031
11026
|
],
|
|
11032
|
-
"padding-line-between-statements": "off",
|
|
11027
|
+
// "padding-line-between-statements": "off",
|
|
11033
11028
|
"@typescript-eslint/padding-line-between-statements": "off",
|
|
11034
|
-
quotes: "off",
|
|
11029
|
+
// quotes: "off",
|
|
11035
11030
|
"@typescript-eslint/quotes": "off",
|
|
11036
|
-
"space-before-function-paren": "off",
|
|
11031
|
+
// "space-before-function-paren": "off",
|
|
11037
11032
|
"@typescript-eslint/space-before-function-paren": "off",
|
|
11038
|
-
"space-infix-ops": "off",
|
|
11033
|
+
// "space-infix-ops": "off",
|
|
11039
11034
|
"@typescript-eslint/space-infix-ops": "error",
|
|
11040
|
-
semi: "off",
|
|
11035
|
+
// semi: "off",
|
|
11041
11036
|
"@typescript-eslint/semi": ["error", "always"],
|
|
11042
|
-
"space-before-blocks": "off",
|
|
11037
|
+
// "space-before-blocks": "off",
|
|
11043
11038
|
"@typescript-eslint/space-before-blocks": ["error", "always"],
|
|
11044
11039
|
"no-undef": "off",
|
|
11045
11040
|
"no-duplicate-imports": "off",
|
|
@@ -11167,6 +11162,33 @@ var n = async () => {
|
|
|
11167
11162
|
];
|
|
11168
11163
|
};
|
|
11169
11164
|
|
|
11165
|
+
// src/configs/no-only-tests.ts
|
|
11166
|
+
var noOnlyTests = async (options = {}) => {
|
|
11167
|
+
const { isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
11168
|
+
const pluginNoOnlyTests = await interopDefault2(
|
|
11169
|
+
// @ts-expect-error - types are incorrect/missing
|
|
11170
|
+
import("eslint-plugin-no-only-tests")
|
|
11171
|
+
);
|
|
11172
|
+
return [
|
|
11173
|
+
{
|
|
11174
|
+
name: "jsse/no-only-tests/setup",
|
|
11175
|
+
plugins: {
|
|
11176
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
11177
|
+
"no-only-tests": pluginNoOnlyTests
|
|
11178
|
+
}
|
|
11179
|
+
},
|
|
11180
|
+
{
|
|
11181
|
+
files: GLOB_TESTS,
|
|
11182
|
+
name: "jsse/no-only-tests/rules",
|
|
11183
|
+
rules: {
|
|
11184
|
+
"no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
|
|
11185
|
+
"unicorn/no-null": "off",
|
|
11186
|
+
...overrides
|
|
11187
|
+
}
|
|
11188
|
+
}
|
|
11189
|
+
];
|
|
11190
|
+
};
|
|
11191
|
+
|
|
11170
11192
|
// src/configs/perfectionist.ts
|
|
11171
11193
|
var perfectionist = async () => {
|
|
11172
11194
|
return [
|
|
@@ -11314,7 +11336,16 @@ function typescriptLanguageOptions(options) {
|
|
|
11314
11336
|
tsconfig
|
|
11315
11337
|
} = options || {};
|
|
11316
11338
|
const tsOptions = tsconfig ? {
|
|
11317
|
-
project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
11339
|
+
// project: Array.isArray(tsconfig) ? tsconfig : [tsconfig],
|
|
11340
|
+
projectService: {
|
|
11341
|
+
allowDefaultProject: [
|
|
11342
|
+
"*.js",
|
|
11343
|
+
"tsconfig.json",
|
|
11344
|
+
"*.ts",
|
|
11345
|
+
"scripts/*.ts"
|
|
11346
|
+
],
|
|
11347
|
+
defaultProject: tsconfig
|
|
11348
|
+
},
|
|
11318
11349
|
tsconfigRootDir: import_node_process4.default.cwd()
|
|
11319
11350
|
} : {};
|
|
11320
11351
|
const parserOptions = {
|
|
@@ -11897,33 +11928,6 @@ var tailwind = async (options) => {
|
|
|
11897
11928
|
];
|
|
11898
11929
|
};
|
|
11899
11930
|
|
|
11900
|
-
// src/configs/no-only-tests.ts
|
|
11901
|
-
var noOnlyTests = async (options = {}) => {
|
|
11902
|
-
const { isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
11903
|
-
const pluginNoOnlyTests = await interopDefault2(
|
|
11904
|
-
// @ts-expect-error - types are incorrect/missing
|
|
11905
|
-
import("eslint-plugin-no-only-tests")
|
|
11906
|
-
);
|
|
11907
|
-
return [
|
|
11908
|
-
{
|
|
11909
|
-
name: "jsse/no-only-tests/setup",
|
|
11910
|
-
plugins: {
|
|
11911
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
11912
|
-
"no-only-tests": pluginNoOnlyTests
|
|
11913
|
-
}
|
|
11914
|
-
},
|
|
11915
|
-
{
|
|
11916
|
-
files: GLOB_TESTS,
|
|
11917
|
-
name: "jsse/no-only-tests/rules",
|
|
11918
|
-
rules: {
|
|
11919
|
-
"no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
|
|
11920
|
-
"unicorn/no-null": "off",
|
|
11921
|
-
...overrides
|
|
11922
|
-
}
|
|
11923
|
-
}
|
|
11924
|
-
];
|
|
11925
|
-
};
|
|
11926
|
-
|
|
11927
11931
|
// src/configs/ts/typescript.ts
|
|
11928
11932
|
var typescript = async (options) => {
|
|
11929
11933
|
const {
|
|
@@ -11939,9 +11943,9 @@ var typescript = async (options) => {
|
|
|
11939
11943
|
const tsPrefixTo = prefix?.to ?? "@typescript-eslint";
|
|
11940
11944
|
const tsrules = {
|
|
11941
11945
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11942
|
-
...import_eslint_plugin.default.configs["eslint-recommended"]
|
|
11946
|
+
...(import_eslint_plugin.default.configs["eslint-recommended"]?.overrides ?? [])[0]?.rules,
|
|
11943
11947
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11944
|
-
...import_eslint_plugin.default.configs.strict
|
|
11948
|
+
...import_eslint_plugin.default.configs.strict?.rules,
|
|
11945
11949
|
"no-invalid-this": "off",
|
|
11946
11950
|
...typescriptRules(
|
|
11947
11951
|
typeAware !== false && tsconfigPath ? { typeAware: true } : { typeAware: false }
|
|
@@ -11972,6 +11976,7 @@ var typescript = async (options) => {
|
|
|
11972
11976
|
// only apply ts rules to ts files!
|
|
11973
11977
|
files: [GLOB_TS, GLOB_TSX, ...componentExts.map((ext) => `**/*.${ext}`)],
|
|
11974
11978
|
name: "jsse/typescript/rules",
|
|
11979
|
+
// may not need to rename all rules here........
|
|
11975
11980
|
rules: renameRules(tsrules || {}, tsPrefix, tsPrefixTo)
|
|
11976
11981
|
},
|
|
11977
11982
|
{
|
|
@@ -12003,12 +12008,29 @@ var typescript = async (options) => {
|
|
|
12003
12008
|
];
|
|
12004
12009
|
};
|
|
12005
12010
|
|
|
12011
|
+
// src/configs/tsdoc.ts
|
|
12012
|
+
var tsdoc = async () => {
|
|
12013
|
+
const { pluginTsdoc } = await importPluginTsdoc();
|
|
12014
|
+
return [
|
|
12015
|
+
{
|
|
12016
|
+
files: ["*.ts", "*.tsx"],
|
|
12017
|
+
name: "jsse/tsdoc",
|
|
12018
|
+
plugins: {
|
|
12019
|
+
tsdoc: pluginTsdoc
|
|
12020
|
+
},
|
|
12021
|
+
rules: {
|
|
12022
|
+
"tsdoc/syntax": "warn"
|
|
12023
|
+
}
|
|
12024
|
+
}
|
|
12025
|
+
];
|
|
12026
|
+
};
|
|
12027
|
+
|
|
12006
12028
|
// src/configs/unicorn.ts
|
|
12007
12029
|
function unicornOff() {
|
|
12008
12030
|
return {
|
|
12009
12031
|
"unicorn/catch-error-name": "off",
|
|
12010
12032
|
"unicorn/consistent-destructuring": "off",
|
|
12011
|
-
"unicorn/no-array-for-each": "off",
|
|
12033
|
+
// "unicorn/no-array-for-each": "off",
|
|
12012
12034
|
"unicorn/no-array-reduce": "off",
|
|
12013
12035
|
"unicorn/no-nested-ternary": "off",
|
|
12014
12036
|
// conflicts with prettier
|
|
@@ -12021,7 +12043,11 @@ function unicornOff() {
|
|
|
12021
12043
|
};
|
|
12022
12044
|
}
|
|
12023
12045
|
function unicornRecommended() {
|
|
12024
|
-
|
|
12046
|
+
const rules = import_eslint_plugin_unicorn.default.configs.recommended.rules;
|
|
12047
|
+
if (rules === void 0) {
|
|
12048
|
+
throw new Error("Expected rules to be defined in unicorn plugin");
|
|
12049
|
+
}
|
|
12050
|
+
return rules;
|
|
12025
12051
|
}
|
|
12026
12052
|
var unicorn = async () => {
|
|
12027
12053
|
return [
|
|
@@ -12405,35 +12431,34 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12405
12431
|
if (off && off.length > 0) {
|
|
12406
12432
|
log.debug("Turning off rules", off);
|
|
12407
12433
|
const currentlyActiveRules = /* @__PURE__ */ new Set();
|
|
12408
|
-
|
|
12409
|
-
Object.keys(config.rules ?? {})
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
off.forEach((rule) => {
|
|
12434
|
+
for (const config of combinedConfigs) {
|
|
12435
|
+
for (const rule of Object.keys(config.rules ?? {}))
|
|
12436
|
+
currentlyActiveRules.add(rule);
|
|
12437
|
+
}
|
|
12438
|
+
for (const rule of off) {
|
|
12414
12439
|
if (!currentlyActiveRules.has(rule)) {
|
|
12415
12440
|
log.info(
|
|
12416
12441
|
`Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
|
|
12417
12442
|
);
|
|
12418
12443
|
}
|
|
12419
|
-
}
|
|
12420
|
-
|
|
12421
|
-
Object.keys(config.rules ?? {})
|
|
12444
|
+
}
|
|
12445
|
+
for (const config of combinedConfigs) {
|
|
12446
|
+
for (const rule of Object.keys(config.rules ?? {})) {
|
|
12422
12447
|
if (off.includes(rule) && config.rules) {
|
|
12423
12448
|
config.rules[rule] = "off";
|
|
12424
12449
|
}
|
|
12425
|
-
}
|
|
12426
|
-
}
|
|
12450
|
+
}
|
|
12451
|
+
}
|
|
12427
12452
|
}
|
|
12428
12453
|
if (normalizedOptions.rootId !== "jsse") {
|
|
12429
|
-
|
|
12454
|
+
for (const config of combinedConfigs) {
|
|
12430
12455
|
if (config.name && config.name.startsWith("jsse/")) {
|
|
12431
12456
|
config.name = config.name.replace(
|
|
12432
12457
|
"jsse/",
|
|
12433
12458
|
`${normalizedOptions.rootId}:`
|
|
12434
12459
|
);
|
|
12435
12460
|
}
|
|
12436
|
-
}
|
|
12461
|
+
}
|
|
12437
12462
|
}
|
|
12438
12463
|
if (normalizedOptions.preReturn) {
|
|
12439
12464
|
log.debug("Running preReturn");
|
|
@@ -12450,6 +12475,24 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12450
12475
|
return res;
|
|
12451
12476
|
}
|
|
12452
12477
|
}
|
|
12478
|
+
for (const config of combinedConfigs) {
|
|
12479
|
+
if (config.plugins) {
|
|
12480
|
+
for (const [key, value] of Object.entries(config.plugins)) {
|
|
12481
|
+
if (key.startsWith("@typescript-eslint/")) {
|
|
12482
|
+
delete config.plugins[key];
|
|
12483
|
+
config.plugins[`${tsPrefix}/${key.slice("@typescript-eslint/".length)}`] = value;
|
|
12484
|
+
}
|
|
12485
|
+
}
|
|
12486
|
+
}
|
|
12487
|
+
if (config.rules) {
|
|
12488
|
+
for (const [key, value] of Object.entries(config.rules)) {
|
|
12489
|
+
if (key.startsWith("@typescript-eslint/")) {
|
|
12490
|
+
delete config.rules[key];
|
|
12491
|
+
config.rules[`${tsPrefix}/${key.slice("@typescript-eslint/".length)}`] = value;
|
|
12492
|
+
}
|
|
12493
|
+
}
|
|
12494
|
+
}
|
|
12495
|
+
}
|
|
12453
12496
|
return combinedConfigs;
|
|
12454
12497
|
}
|
|
12455
12498
|
|