@schoero/configs 1.0.34 → 1.0.35

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/README.md CHANGED
@@ -23,19 +23,7 @@ npm i --save-dev @schoero/configs
23
23
  {
24
24
 
25
25
  // eslint
26
- "[javascript]": {
27
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
28
- },
29
- "[json]": {
30
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
31
- },
32
- "[json5]": {
33
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
34
- },
35
- "[jsonc]": {
36
- "editor.defaultFormatter": "dbaeumer.vscode-eslint"
37
- },
38
- "[typescript]": {
26
+ "[javascript][javascriptreact][json][json5][jsonc][typescript][typescriptreact]": {
39
27
  "editor.defaultFormatter": "dbaeumer.vscode-eslint"
40
28
  },
41
29
  "eslint.validate": ["javascript", "typescript", "json", "jsonc", "json5", "yaml"],
package/eslint/imports.js CHANGED
@@ -1,6 +1,6 @@
1
- import eslintPluginImportX from "eslint-plugin-import-x";
2
1
  import eslintPluginImportNewlines from "eslint-plugin-import-newlines";
3
- import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort";
2
+ import eslintPluginImportX from "eslint-plugin-import-x";
3
+ import eslintPluginPerfectionist from "eslint-plugin-perfectionist";
4
4
  import eslintPluginUnusedImports from "eslint-plugin-unused-imports";
5
5
 
6
6
  /** @type { import("eslint").Linter.FlatConfig[] } */
@@ -11,7 +11,7 @@ export const imports = [
11
11
  "eslint-plugin-unused-imports": eslintPluginUnusedImports,
12
12
  "eslint-plugin-import-newlines": eslintPluginImportNewlines,
13
13
  "eslint-plugin-import-x": eslintPluginImportX,
14
- "eslint-plugin-simple-import-sort": eslintPluginSimpleImportSort
14
+ "eslint-plugin-perfectionist": eslintPluginPerfectionist
15
15
  },
16
16
  rules: {
17
17
  "eslint-plugin-unused-imports/no-unused-imports": "warn",
@@ -24,57 +24,66 @@ export const imports = [
24
24
 
25
25
  "eslint-plugin-import-newlines/enforce": ["warn", { "items": 6, "max-len": 119 }],
26
26
 
27
- "eslint-plugin-simple-import-sort/exports": "warn",
28
- "eslint-plugin-simple-import-sort/imports": [
27
+ // imports
28
+ "eslint-plugin-perfectionist/sort-imports": [
29
29
  "warn",
30
30
  {
31
31
  groups: [
32
-
33
- // side effect imports
34
- ["^\\u0000"],
35
-
36
- // node builtins
37
- ["^node:"],
38
-
39
- // external packages
40
- ["^"],
41
-
42
- // internal packages
43
- ["^@(?!.*\\u0000$)"],
44
- ["^@schoero(?!.*\\u0000$)"],
45
- ["^(?!node:)(?!.*\\u0000$)(.*):"],
46
-
47
- // parent imports. Put `..` last
48
- ["^\\.\\.(?!/?.*\\u0000$)", "^\\.\\./?(?!.*\\u0000$)"],
49
-
50
- // other relative imports. Put same-folder imports and `.` last
51
- ["^\\./(?=.*/)(?!/?.*\\u0000$)", "^\\.(?!/?.*\\u0000$)", "^\\./?(?!.*\\u0000$)"],
52
-
53
- // style imports
54
- ["^.+\\.s?css$"],
55
-
56
- // json imports
57
- ["^.+\\.jsonc?$"],
58
-
59
- // type imports
60
- ["^node:(.*)\\u0000$"],
61
-
62
- // types from external packages
63
- ["\\u0000$"],
64
-
65
- // types from internal packages
66
- ["^@(.*)\\u0000$"],
67
- ["^@schoero(.*)\\u0000$"],
68
- ["^(?!node:)(.*):(.*)\\u0000$"],
69
-
70
- // types from parent imports. Put `..` last
71
- ["^\\.\\.(?=/?\\u0000$)", "^\\.\\./?\\u0000$"],
72
-
73
- // types from other relative imports. Put same-folder imports and `.` last
74
- ["^\\./(?=.*\\u0000$)", "^\\.(?=/?\\u0000$)", "^\\./?\\u0000$"]
32
+ "side-effect",
33
+ "builtin",
34
+ "external",
35
+ "internal",
36
+ ["parent", "sibling", "index"],
37
+ "object",
38
+ "style",
39
+
40
+ "external-type",
41
+ "internal-type",
42
+ ["parent-type", "sibling-type", "index-type"],
43
+ "object-type",
44
+
45
+ "side-effect-style",
46
+
47
+ "unknown"
48
+ ],
49
+ internalPattern: [
50
+ "~*",
51
+ "~**/*",
52
+ "~**/**/*",
53
+ "!(node)*:*",
54
+ "!(node)*:**/*",
55
+ "!(node)*:**/**/*"
75
56
  ]
76
57
  }
58
+ ],
59
+ "eslint-plugin-perfectionist/sort-named-imports": [
60
+ "warn",
61
+ {
62
+ type: "alphabetical",
63
+ order: "asc",
64
+ ignoreCase: true
65
+ }
66
+ ],
67
+
68
+ // exports
69
+ "eslint-plugin-perfectionist/sort-exports": [
70
+ "warn",
71
+ {
72
+ type: "alphabetical",
73
+ order: "asc",
74
+ ignoreCase: true
75
+ }
76
+ ],
77
+ "eslint-plugin-perfectionist/sort-named-exports": [
78
+ "warn",
79
+ {
80
+ type: "alphabetical",
81
+ order: "asc",
82
+ ignoreCase: true
83
+ }
77
84
  ]
85
+
78
86
  }
87
+
79
88
  }
80
89
  ];
@@ -1,6 +1,5 @@
1
1
  import eslintPluginJSDoc from "eslint-plugin-jsdoc";
2
- import eslintPluginSortDestructureKeys from "eslint-plugin-sort-destructure-keys";
3
- import eslintPluginSortKeys from "eslint-plugin-sort-keys";
2
+ import eslintPluginPerfectionist from "eslint-plugin-perfectionist";
4
3
  import eslintPluginUnicorn from "eslint-plugin-unicorn";
5
4
  import globals from "globals";
6
5
 
@@ -8,7 +7,7 @@ import { imports } from "./imports.js";
8
7
  import { jsdoc } from "./jsdoc.js";
9
8
  import { stylistic } from "./stylistic.js";
10
9
 
11
- /** @type { import("eslint").Linter.FlatConfig[] } */
10
+ /** @type { import("eslint").Linter.Config[] } */
12
11
  export const javascript = [
13
12
  ...imports,
14
13
  ...jsdoc,
@@ -18,8 +17,7 @@ export const javascript = [
18
17
  files: ["**/*.{js,jsx,cjs,mjs,ts,tsx,cts}"],
19
18
  plugins: {
20
19
  "eslint-plugin-unicorn": eslintPluginUnicorn,
21
- "eslint-plugin-sort-destructure-keys": eslintPluginSortDestructureKeys,
22
- "eslint-plugin-sort-keys": eslintPluginSortKeys,
20
+ "eslint-plugin-perfectionist": eslintPluginPerfectionist,
23
21
  "eslint-plugin-jsdoc": eslintPluginJSDoc
24
22
  },
25
23
  languageOptions: {
@@ -56,9 +54,27 @@ export const javascript = [
56
54
  "object-shorthand": ["warn", "always", { avoidQuotes: true }],
57
55
  "dot-notation": ["warn", { allowKeywords: true }],
58
56
  "prefer-object-spread": "warn",
59
-
60
- "eslint-plugin-sort-destructure-keys/sort-destructure-keys": "warn",
61
- "eslint-plugin-sort-keys/sort-keys-fix": "warn",
57
+ "eslint-plugin-perfectionist/sort-objects": [
58
+ "warn",
59
+ {
60
+ type: "alphabetical",
61
+ order: "asc",
62
+ ignoreCase: true,
63
+ partitionByComment: false,
64
+ partitionByNewLine: true
65
+ }
66
+ ],
67
+
68
+ // arrays
69
+ "eslint-plugin-perfectionist/sort-array-includes": [
70
+ "warn",
71
+ {
72
+ type: "alphabetical",
73
+ order: "asc",
74
+ ignoreCase: true,
75
+ groupKind: "spreads-first"
76
+ }
77
+ ],
62
78
 
63
79
  // classes
64
80
  "no-dupe-class-members": "error",
package/eslint/jsx.js CHANGED
@@ -1,9 +1,8 @@
1
- import eslintPluginTypeScript from "typescript-eslint";
2
-
3
1
  import eslintPluginStylisticJS from "@stylistic/eslint-plugin-js";
4
2
  import eslintPluginStylisticJSX from "@stylistic/eslint-plugin-jsx";
5
3
  import eslintPluginStylisticPlus from "@stylistic/eslint-plugin-plus";
6
4
  import eslintPluginStylisticTS from "@stylistic/eslint-plugin-ts";
5
+ import eslintPluginTypeScript from "typescript-eslint";
7
6
 
8
7
 
9
8
  /** @type {import("eslint").Linter.FlatConfig[]} */
@@ -1,10 +1,11 @@
1
+ import eslintPluginStylisticJS from "@stylistic/eslint-plugin-js";
2
+ import eslintPluginStylisticTS from "@stylistic/eslint-plugin-ts";
3
+ import eslintPluginTypeScript from "@typescript-eslint/eslint-plugin";
4
+ import eslintParserTypeScript from "@typescript-eslint/parser";
1
5
  import eslintPluginImportX from "eslint-plugin-import-x";
2
6
  import eslintPluginJSDoc from "eslint-plugin-jsdoc";
3
7
  import eslintPluginJsonc from "eslint-plugin-jsonc";
4
- import eslintPluginTypeScript from "typescript-eslint";
5
-
6
- import eslintPluginStylisticJS from "@stylistic/eslint-plugin-js";
7
- import eslintPluginStylisticTS from "@stylistic/eslint-plugin-ts";
8
+ import eslintPluginPerfectionist from "eslint-plugin-perfectionist";
8
9
 
9
10
  import { javascript } from "./javascript.js";
10
11
 
@@ -17,9 +18,8 @@ export const typescript = [
17
18
  {
18
19
 
19
20
  languageOptions: {
20
- parser: eslintPluginTypeScript.parser,
21
+ parser: eslintParserTypeScript,
21
22
  parserOptions: {
22
- EXPERIMENTAL_useProjectService: true,
23
23
  projectService: true,
24
24
  project: false
25
25
  }
@@ -32,10 +32,10 @@ export const typescript = [
32
32
  plugins: {
33
33
  "eslint-plugin-import-x": eslintPluginImportX,
34
34
  "eslint-plugin-jsdoc": eslintPluginJSDoc,
35
- "eslint-plugin-typescript": eslintPluginTypeScript.plugin,
35
+ "eslint-plugin-typescript": eslintPluginTypeScript,
36
36
  "eslint-plugin-stylistic-ts": eslintPluginStylisticTS,
37
- "eslint-plugin-stylistic-js": eslintPluginStylisticJS
38
- // "eslint-plugin-typescript-sort-keys": eslintPluginTypeScriptSortKeys
37
+ "eslint-plugin-stylistic-js": eslintPluginStylisticJS,
38
+ "eslint-plugin-perfectionist": eslintPluginPerfectionist
39
39
  },
40
40
  rules: {
41
41
 
@@ -58,14 +58,78 @@ export const typescript = [
58
58
 
59
59
  // interfaces
60
60
  "eslint-plugin-typescript/method-signature-style": ["warn", "property"], // https://www.totaltypescript.com/method-shorthand-syntax-considered-harmful
61
- // "eslint-plugin-typescript-sort-keys/interface": ["warn", "asc", {
62
- // caseSensitive: true,
63
- // natural: true,
64
- // requiredFirst: true
65
- // }],
66
61
 
67
- // enum
68
- // "eslint-plugin-typescript-sort-keys/string-enum": "warn",
62
+ // sort types
63
+ "eslint-plugin-perfectionist/sort-object-types": [
64
+ "warn",
65
+ {
66
+ type: "alphabetical",
67
+ order: "asc",
68
+ ignoreCase: true,
69
+ partitionByNewLine: true,
70
+ groupKind: "required-first"
71
+ }
72
+ ],
73
+ "eslint-plugin-perfectionist/sort-interfaces": [
74
+ "warn",
75
+ {
76
+ type: "alphabetical",
77
+ order: "asc",
78
+ ignoreCase: true,
79
+ partitionByNewLine: false,
80
+ groupKind: "required-first"
81
+ }
82
+ ],
83
+ "eslint-plugin-perfectionist/sort-union-types": [
84
+ "warn",
85
+ {
86
+ type: "alphabetical",
87
+ order: "asc",
88
+ ignoreCase: true,
89
+ groups: [
90
+ "union",
91
+ "conditional",
92
+ "function",
93
+ "intersection",
94
+ "literal",
95
+ "operator",
96
+ "named",
97
+ "keyword",
98
+ "nullish",
99
+ "object"
100
+ ]
101
+ }
102
+ ],
103
+ "eslint-plugin-perfectionist/sort-intersection-types": [
104
+ "warn",
105
+ {
106
+ type: "alphabetical",
107
+ order: "asc",
108
+ ignoreCase: true,
109
+ groups: [
110
+ "union",
111
+ "conditional",
112
+ "function",
113
+ "intersection",
114
+ "literal",
115
+ "operator",
116
+ "named",
117
+ "keyword",
118
+ "nullish",
119
+ "object"
120
+ ]
121
+ }
122
+ ],
123
+ "eslint-plugin-perfectionist/sort-enums": [
124
+ "warn",
125
+ {
126
+ type: "alphabetical",
127
+ order: "asc",
128
+ ignoreCase: true,
129
+ partitionByComment: false,
130
+ sortByValue: false
131
+ }
132
+ ],
69
133
 
70
134
  // functions
71
135
  "eslint-plugin-typescript/unified-signatures": ["warn", { ignoreDifferentlyNamedParameters: true }],
@@ -247,12 +311,11 @@ export const typescript = [
247
311
  // standalone typescript
248
312
  {
249
313
  plugins: {
250
- "eslint-plugin-typescript": eslintPluginTypeScript.plugin
314
+ "eslint-plugin-typescript": eslintPluginTypeScript
251
315
  },
252
316
  languageOptions: {
253
- parser: eslintPluginTypeScript.parser,
317
+ parser: eslintParserTypeScript,
254
318
  parserOptions: {
255
- EXPERIMENTAL_useProjectService: false,
256
319
  projectService: false,
257
320
  project: false,
258
321
  program: null
@@ -264,7 +327,7 @@ export const typescript = [
264
327
  ],
265
328
  rules: {
266
329
  ...Object.fromEntries(
267
- Object.entries(eslintPluginTypeScript.configs.disableTypeChecked.rules).map(([ruleName, ruleConfig]) => {
330
+ Object.entries(eslintPluginTypeScript.configs["disable-type-checked"].rules).map(([ruleName, ruleConfig]) => {
268
331
  return [
269
332
  ruleName.replace("@typescript-eslint", "eslint-plugin-typescript"),
270
333
  ruleConfig
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.0.34",
2
+ "version": "1.0.35",
3
3
  "type": "module",
4
4
  "name": "@schoero/configs",
5
5
  "description": "",
@@ -75,7 +75,7 @@
75
75
  }
76
76
  },
77
77
  "dependencies": {
78
- "@cspell/dict-bash": "^4.1.3",
78
+ "@cspell/dict-bash": "^4.1.4",
79
79
  "@cspell/dict-companies": "^3.1.4",
80
80
  "@cspell/dict-css": "^4.0.13",
81
81
  "@cspell/dict-de-ch": "^1.2.0",
@@ -88,29 +88,28 @@
88
88
  "@cspell/dict-lorem-ipsum": "^4.0.0",
89
89
  "@cspell/dict-markdown": "^2.0.2",
90
90
  "@cspell/dict-node": "^5.0.1",
91
- "@cspell/dict-npm": "^5.0.18",
92
- "@cspell/dict-public-licenses": "^2.0.7",
93
- "@cspell/dict-software-terms": "^4.0.6",
91
+ "@cspell/dict-npm": "^5.1.0",
92
+ "@cspell/dict-public-licenses": "^2.0.8",
93
+ "@cspell/dict-software-terms": "^4.1.1",
94
94
  "@cspell/dict-typescript": "^3.1.6",
95
- "@stylistic/eslint-plugin-js": "^2.6.2",
96
- "@stylistic/eslint-plugin-jsx": "^2.6.2",
97
- "@stylistic/eslint-plugin-plus": "^2.6.2",
98
- "@stylistic/eslint-plugin-ts": "^2.6.2",
99
- "cspell-lib": "^8.13.3",
95
+ "@stylistic/eslint-plugin-js": "^2.6.4",
96
+ "@stylistic/eslint-plugin-jsx": "^2.6.4",
97
+ "@stylistic/eslint-plugin-plus": "^2.6.4",
98
+ "@stylistic/eslint-plugin-ts": "^2.6.4",
99
+ "@typescript-eslint/eslint-plugin": "^8.3.0",
100
+ "@typescript-eslint/parser": "^8.3.0",
101
+ "cspell-lib": "^8.14.2",
100
102
  "eslint-plugin-import-newlines": "^1.4.0",
101
- "eslint-plugin-import-x": "^3.1.0",
103
+ "eslint-plugin-import-x": "^4.1.0",
102
104
  "eslint-plugin-jsdoc": "^50.2.2",
103
105
  "eslint-plugin-jsonc": "^2.16.0",
104
106
  "eslint-plugin-markdown": "^5.1.0",
105
- "eslint-plugin-simple-import-sort": "^12.1.1",
106
- "eslint-plugin-sort-destructure-keys": "^2.0.0",
107
- "eslint-plugin-sort-keys": "^2.3.5",
107
+ "eslint-plugin-perfectionist": "^3.3.0",
108
108
  "eslint-plugin-unicorn": "^55.0.0",
109
109
  "eslint-plugin-unused-imports": "^4.1.3",
110
110
  "eslint-plugin-vitest": "^0.5.4",
111
111
  "eslint-plugin-yml": "^1.14.0",
112
112
  "markdownlint-cli2": "^0.13.0",
113
- "typescript-eslint": "^8.1.0",
114
113
  "vite-tsconfig-paths": "^5.0.1",
115
114
  "vitest-github-actions-reporter": "^0.11.1"
116
115
  },
@@ -119,12 +118,12 @@
119
118
  "eslint-plugin-tailwindcss": "^3.17.4"
120
119
  },
121
120
  "devDependencies": {
122
- "@types/node": "^22.3.0",
121
+ "@types/node": "^22.5.0",
123
122
  "changelogen": "^0.5.5",
124
- "cspell": "^8.13.3",
125
- "eslint": "^9.9.0",
123
+ "cspell": "^8.14.2",
124
+ "eslint": "^9.9.1",
126
125
  "markdownlint": "^0.34.0",
127
- "vite": "^5.4.0",
126
+ "vite": "^5.4.2",
128
127
  "vitest": "^2.0.5"
129
128
  },
130
129
  "keywords": []
@@ -1,5 +1,4 @@
1
1
  import { resolve } from "node:path/posix";
2
-
3
2
  import tsconfigPaths from "vite-tsconfig-paths";
4
3
  import GithubActionsReporter from "vitest-github-actions-reporter";
5
4