@jsse/eslint-config 0.1.21 → 0.1.22
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 +79 -68
- package/dist/index.d.cts +530 -330
- package/dist/index.d.ts +530 -330
- package/dist/index.js +79 -68
- package/package.json +24 -25
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 ?? {};
|
|
@@ -11167,6 +11158,33 @@ var n = async () => {
|
|
|
11167
11158
|
];
|
|
11168
11159
|
};
|
|
11169
11160
|
|
|
11161
|
+
// src/configs/no-only-tests.ts
|
|
11162
|
+
var noOnlyTests = async (options = {}) => {
|
|
11163
|
+
const { isInEditor: isInEditor2 = false, overrides = {} } = options;
|
|
11164
|
+
const pluginNoOnlyTests = await interopDefault2(
|
|
11165
|
+
// @ts-expect-error - types are incorrect/missing
|
|
11166
|
+
import("eslint-plugin-no-only-tests")
|
|
11167
|
+
);
|
|
11168
|
+
return [
|
|
11169
|
+
{
|
|
11170
|
+
name: "jsse/no-only-tests/setup",
|
|
11171
|
+
plugins: {
|
|
11172
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
11173
|
+
"no-only-tests": pluginNoOnlyTests
|
|
11174
|
+
}
|
|
11175
|
+
},
|
|
11176
|
+
{
|
|
11177
|
+
files: GLOB_TESTS,
|
|
11178
|
+
name: "jsse/no-only-tests/rules",
|
|
11179
|
+
rules: {
|
|
11180
|
+
"no-only-tests/no-only-tests": isInEditor2 ? "off" : isCI() ? "error" : "warn",
|
|
11181
|
+
"unicorn/no-null": "off",
|
|
11182
|
+
...overrides
|
|
11183
|
+
}
|
|
11184
|
+
}
|
|
11185
|
+
];
|
|
11186
|
+
};
|
|
11187
|
+
|
|
11170
11188
|
// src/configs/perfectionist.ts
|
|
11171
11189
|
var perfectionist = async () => {
|
|
11172
11190
|
return [
|
|
@@ -11897,33 +11915,6 @@ var tailwind = async (options) => {
|
|
|
11897
11915
|
];
|
|
11898
11916
|
};
|
|
11899
11917
|
|
|
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
11918
|
// src/configs/ts/typescript.ts
|
|
11928
11919
|
var typescript = async (options) => {
|
|
11929
11920
|
const {
|
|
@@ -11939,9 +11930,9 @@ var typescript = async (options) => {
|
|
|
11939
11930
|
const tsPrefixTo = prefix?.to ?? "@typescript-eslint";
|
|
11940
11931
|
const tsrules = {
|
|
11941
11932
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11942
|
-
...import_eslint_plugin.default.configs["eslint-recommended"]
|
|
11933
|
+
...(import_eslint_plugin.default.configs["eslint-recommended"]?.overrides ?? [])[0]?.rules,
|
|
11943
11934
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
11944
|
-
...import_eslint_plugin.default.configs.strict
|
|
11935
|
+
...import_eslint_plugin.default.configs.strict?.rules,
|
|
11945
11936
|
"no-invalid-this": "off",
|
|
11946
11937
|
...typescriptRules(
|
|
11947
11938
|
typeAware !== false && tsconfigPath ? { typeAware: true } : { typeAware: false }
|
|
@@ -12003,12 +11994,29 @@ var typescript = async (options) => {
|
|
|
12003
11994
|
];
|
|
12004
11995
|
};
|
|
12005
11996
|
|
|
11997
|
+
// src/configs/tsdoc.ts
|
|
11998
|
+
var tsdoc = async () => {
|
|
11999
|
+
const { pluginTsdoc } = await importPluginTsdoc();
|
|
12000
|
+
return [
|
|
12001
|
+
{
|
|
12002
|
+
files: ["*.ts", "*.tsx"],
|
|
12003
|
+
name: "jsse/tsdoc",
|
|
12004
|
+
plugins: {
|
|
12005
|
+
tsdoc: pluginTsdoc
|
|
12006
|
+
},
|
|
12007
|
+
rules: {
|
|
12008
|
+
"tsdoc/syntax": "warn"
|
|
12009
|
+
}
|
|
12010
|
+
}
|
|
12011
|
+
];
|
|
12012
|
+
};
|
|
12013
|
+
|
|
12006
12014
|
// src/configs/unicorn.ts
|
|
12007
12015
|
function unicornOff() {
|
|
12008
12016
|
return {
|
|
12009
12017
|
"unicorn/catch-error-name": "off",
|
|
12010
12018
|
"unicorn/consistent-destructuring": "off",
|
|
12011
|
-
"unicorn/no-array-for-each": "off",
|
|
12019
|
+
// "unicorn/no-array-for-each": "off",
|
|
12012
12020
|
"unicorn/no-array-reduce": "off",
|
|
12013
12021
|
"unicorn/no-nested-ternary": "off",
|
|
12014
12022
|
// conflicts with prettier
|
|
@@ -12021,7 +12029,11 @@ function unicornOff() {
|
|
|
12021
12029
|
};
|
|
12022
12030
|
}
|
|
12023
12031
|
function unicornRecommended() {
|
|
12024
|
-
|
|
12032
|
+
const rules = import_eslint_plugin_unicorn.default.configs.recommended.rules;
|
|
12033
|
+
if (rules === void 0) {
|
|
12034
|
+
throw new Error("Expected rules to be defined in unicorn plugin");
|
|
12035
|
+
}
|
|
12036
|
+
return rules;
|
|
12025
12037
|
}
|
|
12026
12038
|
var unicorn = async () => {
|
|
12027
12039
|
return [
|
|
@@ -12405,35 +12417,34 @@ async function jsse(options = {}, ...userConfigs) {
|
|
|
12405
12417
|
if (off && off.length > 0) {
|
|
12406
12418
|
log.debug("Turning off rules", off);
|
|
12407
12419
|
const currentlyActiveRules = /* @__PURE__ */ new Set();
|
|
12408
|
-
|
|
12409
|
-
Object.keys(config.rules ?? {})
|
|
12410
|
-
|
|
12411
|
-
|
|
12412
|
-
|
|
12413
|
-
off.forEach((rule) => {
|
|
12420
|
+
for (const config of combinedConfigs) {
|
|
12421
|
+
for (const rule of Object.keys(config.rules ?? {}))
|
|
12422
|
+
currentlyActiveRules.add(rule);
|
|
12423
|
+
}
|
|
12424
|
+
for (const rule of off) {
|
|
12414
12425
|
if (!currentlyActiveRules.has(rule)) {
|
|
12415
12426
|
log.info(
|
|
12416
12427
|
`Rule \`${rule}\` is not active in the current config, you can remove it from the off list`
|
|
12417
12428
|
);
|
|
12418
12429
|
}
|
|
12419
|
-
}
|
|
12420
|
-
|
|
12421
|
-
Object.keys(config.rules ?? {})
|
|
12430
|
+
}
|
|
12431
|
+
for (const config of combinedConfigs) {
|
|
12432
|
+
for (const rule of Object.keys(config.rules ?? {})) {
|
|
12422
12433
|
if (off.includes(rule) && config.rules) {
|
|
12423
12434
|
config.rules[rule] = "off";
|
|
12424
12435
|
}
|
|
12425
|
-
}
|
|
12426
|
-
}
|
|
12436
|
+
}
|
|
12437
|
+
}
|
|
12427
12438
|
}
|
|
12428
12439
|
if (normalizedOptions.rootId !== "jsse") {
|
|
12429
|
-
|
|
12440
|
+
for (const config of combinedConfigs) {
|
|
12430
12441
|
if (config.name && config.name.startsWith("jsse/")) {
|
|
12431
12442
|
config.name = config.name.replace(
|
|
12432
12443
|
"jsse/",
|
|
12433
12444
|
`${normalizedOptions.rootId}:`
|
|
12434
12445
|
);
|
|
12435
12446
|
}
|
|
12436
|
-
}
|
|
12447
|
+
}
|
|
12437
12448
|
}
|
|
12438
12449
|
if (normalizedOptions.preReturn) {
|
|
12439
12450
|
log.debug("Running preReturn");
|