@will-stone/eslint-config 18.1.0 → 19.0.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.
Files changed (2) hide show
  1. package/dist/index.js +55 -77
  2. package/package.json +4 -3
package/dist/index.js CHANGED
@@ -2,13 +2,14 @@ import parserTypescript from "@typescript-eslint/parser";
2
2
  import restrictedGlobals from "confusing-browser-globals";
3
3
  import globals from "globals";
4
4
  import gitignore from "eslint-config-flat-gitignore";
5
- import * as pluginImport from "eslint-plugin-import-x";
6
5
  import pluginNode from "eslint-plugin-n";
7
6
  import pluginPackageJson from "eslint-plugin-package-json";
7
+ import pluginPerfectionist from "eslint-plugin-perfectionist";
8
+ import stylistic from "@stylistic/eslint-plugin";
8
9
  import pluginTsdoc from "eslint-plugin-tsdoc";
9
10
  import pluginUnicorn from "eslint-plugin-unicorn";
10
- import { readFileSync } from "node:fs";
11
11
  import { globbySync } from "globby";
12
+ import { readFileSync } from "node:fs";
12
13
 
13
14
  //#region src/globs.ts
14
15
  const GLOB_SRC_EXT = "?([cm])[jt]s?(x)";
@@ -350,15 +351,7 @@ async function base() {
350
351
  "require-unicode-regexp": "error",
351
352
  "require-yield": "error",
352
353
  "sort-imports": "off",
353
- "sort-keys": [
354
- "error",
355
- "asc",
356
- {
357
- allowLineSeparatedGroups: true,
358
- caseSensitive: false,
359
- natural: true
360
- }
361
- ],
354
+ "sort-keys": "off",
362
355
  "sort-vars": "off",
363
356
  strict: "off",
364
357
  "symbol-description": "error",
@@ -383,68 +376,6 @@ async function ignores() {
383
376
  }];
384
377
  }
385
378
 
386
- //#endregion
387
- //#region src/configs/imports.ts
388
- async function imports() {
389
- return [{
390
- name: "will-stone/imports",
391
- plugins: { "import-x": pluginImport },
392
- rules: {
393
- "import-x/consistent-type-specifier-style": ["warn", "prefer-top-level"],
394
- "import-x/export": "error",
395
- "import-x/exports-last": "off",
396
- "import-x/group-exports": "off",
397
- "import-x/newline-after-import": "warn",
398
- "import-x/no-empty-named-blocks": "warn",
399
- "import-x/no-rename-default": "off",
400
- "import-x/prefer-default-export": "off",
401
- "import-x/default": "off",
402
- "import-x/dynamic-import-chunkname": "off",
403
- "import-x/extensions": "off",
404
- "import-x/first": "off",
405
- "import-x/max-dependencies": "off",
406
- "import-x/named": "off",
407
- "import-x/namespace": "off",
408
- "import-x/no-absolute-path": "off",
409
- "import-x/no-amd": "off",
410
- "import-x/no-anonymous-default-export": "off",
411
- "import-x/no-commonjs": "off",
412
- "import-x/no-cycle": "off",
413
- "import-x/no-default-export": "off",
414
- "import-x/no-deprecated": "off",
415
- "import-x/no-duplicates": "off",
416
- "import-x/no-dynamic-require": "off",
417
- "import-x/no-extraneous-dependencies": "off",
418
- "import-x/no-import-module-exports": "off",
419
- "import-x/no-internal-modules": "off",
420
- "import-x/no-mutable-exports": "off",
421
- "import-x/no-named-as-default": "off",
422
- "import-x/no-named-as-default-member": "off",
423
- "import-x/no-named-default": "off",
424
- "import-x/no-named-export": "off",
425
- "import-x/no-namespace": "off",
426
- "import-x/no-nodejs-modules": "off",
427
- "import-x/no-relative-packages": "off",
428
- "import-x/no-relative-parent-imports": "off",
429
- "import-x/no-restricted-paths": "off",
430
- "import-x/no-self-import": "off",
431
- "import-x/no-unassigned-import": "off",
432
- "import-x/no-unresolved": "off",
433
- "import-x/no-unused-modules": "off",
434
- "import-x/no-useless-path-segments": "off",
435
- "import-x/no-webpack-loader-syntax": "off",
436
- "import-x/order": ["warn", {
437
- alphabetize: {
438
- caseInsensitive: true,
439
- order: "asc"
440
- },
441
- "newlines-between": "always"
442
- }],
443
- "import-x/unambiguous": "off"
444
- }
445
- }];
446
- }
447
-
448
379
  //#endregion
449
380
  //#region src/configs/jest.ts
450
381
  async function jest(_options) {
@@ -617,6 +548,27 @@ async function packageJson() {
617
548
  }];
618
549
  }
619
550
 
551
+ //#endregion
552
+ //#region src/configs/perfectionist.ts
553
+ async function perfectionist() {
554
+ return [{
555
+ name: "will-stone/perfectionist",
556
+ plugins: { perfectionist: pluginPerfectionist },
557
+ rules: {
558
+ "perfectionist/sort-imports": "warn",
559
+ "perfectionist/sort-named-imports": "warn",
560
+ "perfectionist/sort-object-types": ["warn", {
561
+ partitionByNewLine: true,
562
+ type: "natural"
563
+ }],
564
+ "perfectionist/sort-objects": ["warn", {
565
+ partitionByNewLine: true,
566
+ type: "natural"
567
+ }]
568
+ }
569
+ }];
570
+ }
571
+
620
572
  //#endregion
621
573
  //#region src/configs/react.ts
622
574
  async function react(_options) {
@@ -883,6 +835,28 @@ async function react(_options) {
883
835
  }];
884
836
  }
885
837
 
838
+ //#endregion
839
+ //#region src/configs/style.ts
840
+ async function style() {
841
+ return [{
842
+ name: "will-stone/style",
843
+ plugins: { "@stylistic": stylistic },
844
+ rules: { "@stylistic/padding-line-between-statements": [
845
+ "warn",
846
+ {
847
+ blankLine: "always",
848
+ next: "*",
849
+ prev: "import"
850
+ },
851
+ {
852
+ blankLine: "any",
853
+ next: "import",
854
+ prev: "import"
855
+ }
856
+ ] }
857
+ }];
858
+ }
859
+
886
860
  //#endregion
887
861
  //#region src/configs/tailwind.ts
888
862
  async function tailwind(rawOptions) {
@@ -1347,10 +1321,6 @@ const defaultConfigs = [
1347
1321
  config: base,
1348
1322
  name: "Base"
1349
1323
  },
1350
- {
1351
- config: imports,
1352
- name: "Imports"
1353
- },
1354
1324
  {
1355
1325
  config: unicorn,
1356
1326
  name: "Unicorn"
@@ -1366,6 +1336,14 @@ const defaultConfigs = [
1366
1336
  {
1367
1337
  config: tsdoc,
1368
1338
  name: "TSDoc"
1339
+ },
1340
+ {
1341
+ config: style,
1342
+ name: "Style"
1343
+ },
1344
+ {
1345
+ config: perfectionist,
1346
+ name: "Perfectionist"
1369
1347
  }
1370
1348
  ];
1371
1349
  const autoConfigs = [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@will-stone/eslint-config",
3
- "version": "18.1.0",
3
+ "version": "19.0.0",
4
4
  "description": "Will Stone's ESLint config",
5
5
  "keywords": [
6
6
  "eslint-config"
@@ -30,14 +30,15 @@
30
30
  "typecheck": "tsc --noEmit"
31
31
  },
32
32
  "dependencies": {
33
+ "@stylistic/eslint-plugin": "^4.4.1",
33
34
  "@typescript-eslint/eslint-plugin": "^8.33.1",
34
35
  "@typescript-eslint/parser": "^8.33.1",
35
36
  "confusing-browser-globals": "^1.0.11",
36
37
  "eslint-config-flat-gitignore": "^2.1.0",
37
- "eslint-plugin-import-x": "^4.15.0",
38
38
  "eslint-plugin-jsx-a11y": "^6.10.2",
39
39
  "eslint-plugin-n": "^17.19.0",
40
40
  "eslint-plugin-package-json": "^0.33.2",
41
+ "eslint-plugin-perfectionist": "^4.14.0",
41
42
  "eslint-plugin-tsdoc": "^0.4.0",
42
43
  "eslint-plugin-unicorn": "^59.0.1",
43
44
  "globals": "^16.2.0",
@@ -102,7 +103,7 @@
102
103
  "optional": true
103
104
  }
104
105
  },
105
- "packageManager": "pnpm@10.6.5",
106
+ "packageManager": "pnpm@10.11.1",
106
107
  "engines": {
107
108
  "node": ">=22"
108
109
  },