@chris.araneo/eslint-config 0.0.48 → 0.0.50
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/index.cjs +13 -2
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/{src/typescript.cjs → index.js} +159 -42
- package/dist/index.js.map +1 -0
- package/package.json +2 -2
- package/dist/src/angular.cjs +0 -89
- package/dist/src/json.cjs +0 -64
- package/dist/src/utils.cjs +0 -32
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -8,10 +7,6 @@ var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
|
8
7
|
var __commonJS = (cb, mod) => function __require() {
|
|
9
8
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
9
|
};
|
|
11
|
-
var __export = (target, all) => {
|
|
12
|
-
for (var name in all)
|
|
13
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
14
|
-
};
|
|
15
10
|
var __copyProps = (to, from, except, desc) => {
|
|
16
11
|
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
12
|
for (let key of __getOwnPropNames(from))
|
|
@@ -28,12 +23,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
23
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
24
|
mod
|
|
30
25
|
));
|
|
31
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
26
|
|
|
33
27
|
// node_modules/@eslint/js/package.json
|
|
34
28
|
var require_package = __commonJS({
|
|
35
|
-
"node_modules/@eslint/js/package.json"(
|
|
36
|
-
|
|
29
|
+
"node_modules/@eslint/js/package.json"(exports, module) {
|
|
30
|
+
module.exports = {
|
|
37
31
|
name: "@eslint/js",
|
|
38
32
|
version: "9.27.0",
|
|
39
33
|
description: "ESLint JavaScript language implementation",
|
|
@@ -74,9 +68,9 @@ var require_package = __commonJS({
|
|
|
74
68
|
|
|
75
69
|
// node_modules/@eslint/js/src/configs/eslint-all.js
|
|
76
70
|
var require_eslint_all = __commonJS({
|
|
77
|
-
"node_modules/@eslint/js/src/configs/eslint-all.js"(
|
|
71
|
+
"node_modules/@eslint/js/src/configs/eslint-all.js"(exports, module) {
|
|
78
72
|
"use strict";
|
|
79
|
-
|
|
73
|
+
module.exports = Object.freeze({
|
|
80
74
|
"rules": {
|
|
81
75
|
"accessor-pairs": "error",
|
|
82
76
|
"array-callback-return": "error",
|
|
@@ -283,9 +277,9 @@ var require_eslint_all = __commonJS({
|
|
|
283
277
|
|
|
284
278
|
// node_modules/@eslint/js/src/configs/eslint-recommended.js
|
|
285
279
|
var require_eslint_recommended = __commonJS({
|
|
286
|
-
"node_modules/@eslint/js/src/configs/eslint-recommended.js"(
|
|
280
|
+
"node_modules/@eslint/js/src/configs/eslint-recommended.js"(exports, module) {
|
|
287
281
|
"use strict";
|
|
288
|
-
|
|
282
|
+
module.exports = Object.freeze({
|
|
289
283
|
rules: Object.freeze({
|
|
290
284
|
"constructor-super": "error",
|
|
291
285
|
"for-direction": "error",
|
|
@@ -355,10 +349,10 @@ var require_eslint_recommended = __commonJS({
|
|
|
355
349
|
|
|
356
350
|
// node_modules/@eslint/js/src/index.js
|
|
357
351
|
var require_src = __commonJS({
|
|
358
|
-
"node_modules/@eslint/js/src/index.js"(
|
|
352
|
+
"node_modules/@eslint/js/src/index.js"(exports, module) {
|
|
359
353
|
"use strict";
|
|
360
354
|
var { name, version } = require_package();
|
|
361
|
-
|
|
355
|
+
module.exports = {
|
|
362
356
|
meta: {
|
|
363
357
|
name,
|
|
364
358
|
version
|
|
@@ -373,8 +367,8 @@ var require_src = __commonJS({
|
|
|
373
367
|
|
|
374
368
|
// node_modules/globals/globals.json
|
|
375
369
|
var require_globals = __commonJS({
|
|
376
|
-
"node_modules/globals/globals.json"(
|
|
377
|
-
|
|
370
|
+
"node_modules/globals/globals.json"(exports, module) {
|
|
371
|
+
module.exports = {
|
|
378
372
|
builtin: {
|
|
379
373
|
AggregateError: false,
|
|
380
374
|
Array: false,
|
|
@@ -2377,32 +2371,102 @@ var require_globals = __commonJS({
|
|
|
2377
2371
|
|
|
2378
2372
|
// node_modules/globals/index.js
|
|
2379
2373
|
var require_globals2 = __commonJS({
|
|
2380
|
-
"node_modules/globals/index.js"(
|
|
2374
|
+
"node_modules/globals/index.js"(exports, module) {
|
|
2381
2375
|
"use strict";
|
|
2382
|
-
|
|
2376
|
+
module.exports = require_globals();
|
|
2383
2377
|
}
|
|
2384
2378
|
});
|
|
2385
2379
|
|
|
2386
|
-
//
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
module.exports = __toCommonJS(typescript_exports);
|
|
2393
|
-
var import_js = __toESM(require_src(), 1);
|
|
2394
|
-
var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
|
|
2395
|
-
var import_eslint_plugin_simple_import_sort = __toESM(require("eslint-plugin-simple-import-sort"), 1);
|
|
2396
|
-
var import_eslint_plugin_unicorn = __toESM(require("eslint-plugin-unicorn"), 1);
|
|
2397
|
-
var import_globals = __toESM(require_globals2(), 1);
|
|
2380
|
+
// index.ts
|
|
2381
|
+
import tseslint2 from "typescript-eslint";
|
|
2382
|
+
|
|
2383
|
+
// src/json.ts
|
|
2384
|
+
import jsonc from "eslint-plugin-jsonc";
|
|
2385
|
+
import jsoncParser from "jsonc-eslint-parser";
|
|
2398
2386
|
|
|
2399
2387
|
// src/utils.ts
|
|
2400
2388
|
function isEmpty(value) {
|
|
2401
2389
|
return Array.isArray(value) && value.length === 0 || !Array.isArray(value);
|
|
2402
2390
|
}
|
|
2403
2391
|
|
|
2392
|
+
// src/json.ts
|
|
2393
|
+
var json_default = (jsons = []) => {
|
|
2394
|
+
if (isEmpty(jsons)) {
|
|
2395
|
+
return [];
|
|
2396
|
+
}
|
|
2397
|
+
return [
|
|
2398
|
+
...jsonc.configs["flat/recommended-with-jsonc"],
|
|
2399
|
+
{
|
|
2400
|
+
files: jsons,
|
|
2401
|
+
languageOptions: {
|
|
2402
|
+
parser: jsoncParser
|
|
2403
|
+
},
|
|
2404
|
+
rules: {
|
|
2405
|
+
"jsonc/no-comments": "error",
|
|
2406
|
+
"jsonc/no-dupe-keys": "error",
|
|
2407
|
+
"jsonc/sort-keys": "error",
|
|
2408
|
+
"jsonc/valid-json-number": "error"
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
];
|
|
2412
|
+
};
|
|
2413
|
+
|
|
2414
|
+
// src/angular.ts
|
|
2415
|
+
import angular from "angular-eslint";
|
|
2416
|
+
var angular_default = (isAngularApp = false, sources = [], templates = [], prefix) => {
|
|
2417
|
+
if (!isAngularApp) {
|
|
2418
|
+
return [];
|
|
2419
|
+
}
|
|
2420
|
+
const configs = [];
|
|
2421
|
+
if (!isEmpty(sources)) {
|
|
2422
|
+
configs.push({
|
|
2423
|
+
extends: [...angular.configs.tsAll],
|
|
2424
|
+
files: sources,
|
|
2425
|
+
processor: angular.processInlineTemplates,
|
|
2426
|
+
rules: {
|
|
2427
|
+
"@angular-eslint/component-selector": [
|
|
2428
|
+
"error",
|
|
2429
|
+
{
|
|
2430
|
+
prefix: prefix || "app",
|
|
2431
|
+
style: "kebab-case",
|
|
2432
|
+
type: "element"
|
|
2433
|
+
}
|
|
2434
|
+
],
|
|
2435
|
+
"@angular-eslint/directive-selector": [
|
|
2436
|
+
"error",
|
|
2437
|
+
{
|
|
2438
|
+
prefix: prefix || "app",
|
|
2439
|
+
style: "camelCase",
|
|
2440
|
+
type: "attribute"
|
|
2441
|
+
}
|
|
2442
|
+
],
|
|
2443
|
+
"@angular-eslint/no-forward-ref": "off",
|
|
2444
|
+
"@angular-eslint/prefer-on-push-component-change-detection": "off",
|
|
2445
|
+
"@angular-eslint/prefer-output-emitter-ref": "off",
|
|
2446
|
+
"@angular-eslint/prefer-signals": "off"
|
|
2447
|
+
}
|
|
2448
|
+
});
|
|
2449
|
+
}
|
|
2450
|
+
if (!isEmpty(templates)) {
|
|
2451
|
+
configs.push({
|
|
2452
|
+
files: templates,
|
|
2453
|
+
extends: [...angular.configs.templateAll],
|
|
2454
|
+
rules: {
|
|
2455
|
+
"@angular-eslint/template/i18n": "off",
|
|
2456
|
+
"@angular-eslint/template/prefer-control-flow": "off"
|
|
2457
|
+
}
|
|
2458
|
+
});
|
|
2459
|
+
}
|
|
2460
|
+
return configs;
|
|
2461
|
+
};
|
|
2462
|
+
|
|
2404
2463
|
// src/typescript.ts
|
|
2405
|
-
var
|
|
2464
|
+
var import_js = __toESM(require_src(), 1);
|
|
2465
|
+
var import_globals = __toESM(require_globals2(), 1);
|
|
2466
|
+
import tseslint from "typescript-eslint";
|
|
2467
|
+
import simpleImportSort from "eslint-plugin-simple-import-sort";
|
|
2468
|
+
import unicorn from "eslint-plugin-unicorn";
|
|
2469
|
+
import { get as getAppRootDir } from "app-root-dir";
|
|
2406
2470
|
var createConfigs = (sources = [], isTests = false, tsconfigRootDir) => {
|
|
2407
2471
|
if (isEmpty(sources)) {
|
|
2408
2472
|
return [];
|
|
@@ -2410,12 +2474,12 @@ var createConfigs = (sources = [], isTests = false, tsconfigRootDir) => {
|
|
|
2410
2474
|
const errorWhenNotTests = !isTests ? "error" : "off";
|
|
2411
2475
|
return [
|
|
2412
2476
|
{
|
|
2413
|
-
extends: [import_js.default.configs.all, ...
|
|
2477
|
+
extends: [import_js.default.configs.all, ...tseslint.configs.all],
|
|
2414
2478
|
files: sources,
|
|
2415
2479
|
languageOptions: {
|
|
2416
2480
|
parserOptions: {
|
|
2417
2481
|
projectService: true,
|
|
2418
|
-
tsconfigRootDir: tsconfigRootDir || (
|
|
2482
|
+
tsconfigRootDir: tsconfigRootDir || getAppRootDir()
|
|
2419
2483
|
}
|
|
2420
2484
|
},
|
|
2421
2485
|
rules: {
|
|
@@ -2427,6 +2491,7 @@ var createConfigs = (sources = [], isTests = false, tsconfigRootDir) => {
|
|
|
2427
2491
|
accessibility: "no-public"
|
|
2428
2492
|
}
|
|
2429
2493
|
],
|
|
2494
|
+
"@typescript-eslint/require-await": "off",
|
|
2430
2495
|
"@typescript-eslint/init-declarations": "off",
|
|
2431
2496
|
"@typescript-eslint/member-ordering": [
|
|
2432
2497
|
"error",
|
|
@@ -2465,10 +2530,19 @@ var createConfigs = (sources = [], isTests = false, tsconfigRootDir) => {
|
|
|
2465
2530
|
format: ["PascalCase"]
|
|
2466
2531
|
}
|
|
2467
2532
|
],
|
|
2533
|
+
"no-magic-numbers": "off",
|
|
2468
2534
|
"@typescript-eslint/no-confusing-void-expression": "off",
|
|
2469
2535
|
"@typescript-eslint/no-explicit-any": errorWhenNotTests,
|
|
2470
2536
|
"@typescript-eslint/no-extraneous-class": "off",
|
|
2471
|
-
"@typescript-eslint/no-magic-numbers":
|
|
2537
|
+
"@typescript-eslint/no-magic-numbers": [
|
|
2538
|
+
errorWhenNotTests,
|
|
2539
|
+
{
|
|
2540
|
+
ignoreEnums: true,
|
|
2541
|
+
ignoreNumericLiteralTypes: true,
|
|
2542
|
+
ignoreReadonlyClassProperties: true,
|
|
2543
|
+
ignoreTypeIndexes: true
|
|
2544
|
+
}
|
|
2545
|
+
],
|
|
2472
2546
|
"@typescript-eslint/no-non-null-assertion": errorWhenNotTests,
|
|
2473
2547
|
"@typescript-eslint/no-unsafe-assignment": errorWhenNotTests,
|
|
2474
2548
|
"@typescript-eslint/no-unsafe-call": errorWhenNotTests,
|
|
@@ -2479,7 +2553,7 @@ var createConfigs = (sources = [], isTests = false, tsconfigRootDir) => {
|
|
|
2479
2553
|
"@typescript-eslint/prefer-destructuring": errorWhenNotTests,
|
|
2480
2554
|
"@typescript-eslint/prefer-readonly-parameter-types": "off",
|
|
2481
2555
|
"@typescript-eslint/strict-boolean-expressions": "off",
|
|
2482
|
-
"@typescript-eslint/no-unsafe-type-assertion":
|
|
2556
|
+
"@typescript-eslint/no-unsafe-type-assertion": errorWhenNotTests,
|
|
2483
2557
|
"id-length": "off",
|
|
2484
2558
|
"max-lines-per-function": errorWhenNotTests,
|
|
2485
2559
|
"new-cap": "off",
|
|
@@ -2494,7 +2568,7 @@ var createConfigs = (sources = [], isTests = false, tsconfigRootDir) => {
|
|
|
2494
2568
|
}
|
|
2495
2569
|
},
|
|
2496
2570
|
{
|
|
2497
|
-
extends: [
|
|
2571
|
+
extends: [unicorn.configs.all],
|
|
2498
2572
|
files: sources,
|
|
2499
2573
|
languageOptions: {
|
|
2500
2574
|
globals: import_globals.default.builtin
|
|
@@ -2509,7 +2583,7 @@ var createConfigs = (sources = [], isTests = false, tsconfigRootDir) => {
|
|
|
2509
2583
|
{
|
|
2510
2584
|
files: sources,
|
|
2511
2585
|
plugins: {
|
|
2512
|
-
"simple-import-sort":
|
|
2586
|
+
"simple-import-sort": simpleImportSort
|
|
2513
2587
|
},
|
|
2514
2588
|
rules: {
|
|
2515
2589
|
"simple-import-sort/exports": "error",
|
|
@@ -2524,8 +2598,51 @@ var createTypeScriptConfigs = (sources = [], tsconfigRootDir) => {
|
|
|
2524
2598
|
var createTypeScriptTestsConfigs = (sources = [], tsconfigRootDir) => {
|
|
2525
2599
|
return createConfigs(sources, true, tsconfigRootDir);
|
|
2526
2600
|
};
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2601
|
+
|
|
2602
|
+
// index.ts
|
|
2603
|
+
var DEFAULT_IGNORED_FILES = [
|
|
2604
|
+
"node_modules/",
|
|
2605
|
+
"reports/",
|
|
2606
|
+
".stryker-tmp/",
|
|
2607
|
+
".angular",
|
|
2608
|
+
"package.json",
|
|
2609
|
+
"package-lock.json"
|
|
2610
|
+
];
|
|
2611
|
+
var index_default = (input = {
|
|
2612
|
+
jsons: [],
|
|
2613
|
+
sources: [],
|
|
2614
|
+
tests: [],
|
|
2615
|
+
templates: [],
|
|
2616
|
+
angularElementPrefix: "app",
|
|
2617
|
+
ignored: [],
|
|
2618
|
+
isAngularApp: false
|
|
2619
|
+
}) => {
|
|
2620
|
+
const {
|
|
2621
|
+
jsons,
|
|
2622
|
+
sources,
|
|
2623
|
+
tests,
|
|
2624
|
+
templates,
|
|
2625
|
+
angularElementPrefix,
|
|
2626
|
+
ignored,
|
|
2627
|
+
isAngularApp,
|
|
2628
|
+
tsconfigRootDir
|
|
2629
|
+
} = input;
|
|
2630
|
+
return tseslint2.config(
|
|
2631
|
+
...angular_default(
|
|
2632
|
+
isAngularApp,
|
|
2633
|
+
sources,
|
|
2634
|
+
templates,
|
|
2635
|
+
angularElementPrefix
|
|
2636
|
+
),
|
|
2637
|
+
...json_default(jsons),
|
|
2638
|
+
...createTypeScriptConfigs(sources, tsconfigRootDir),
|
|
2639
|
+
...createTypeScriptTestsConfigs(tests, tsconfigRootDir),
|
|
2640
|
+
{
|
|
2641
|
+
ignores: ignored || DEFAULT_IGNORED_FILES
|
|
2642
|
+
}
|
|
2643
|
+
);
|
|
2644
|
+
};
|
|
2645
|
+
export {
|
|
2646
|
+
index_default as default
|
|
2647
|
+
};
|
|
2648
|
+
//# sourceMappingURL=index.js.map
|