@schoero/configs 0.0.0-beta.0 → 0.0.0-beta.10

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.
@@ -1,9 +1,6 @@
1
- import globals from "globals";
2
-
3
1
  import eslintPluginStylisticJS from "@stylistic/eslint-plugin-js";
4
2
  import eslintPluginStylisticPlus from "@stylistic/eslint-plugin-plus";
5
3
  import eslintPluginStylisticTS from "@stylistic/eslint-plugin-ts";
6
- import parserTs from "@typescript-eslint/parser";
7
4
 
8
5
  /** @type { import("eslint").Linter.FlatConfig[] } */
9
6
  export const stylistic = [
@@ -11,15 +8,7 @@ export const stylistic = [
11
8
  files: ["**/*.{js,jsx,cjs,mjs,ts,tsx}"],
12
9
  plugins: {
13
10
  "eslint-plugin-stylistic-js": eslintPluginStylisticJS,
14
- "eslint-plugin-stylistic-plus": eslintPluginStylisticPlus,
15
- },
16
- languageOptions: {
17
- globals: {
18
- ...globals.browser,
19
- ...globals.node,
20
- ...globals.builtin,
21
- ...globals.worker,
22
- },
11
+ "eslint-plugin-stylistic-plus": eslintPluginStylisticPlus
23
12
  },
24
13
  rules: {
25
14
 
@@ -38,7 +27,7 @@ export const stylistic = [
38
27
  ExportDeclaration: { consistent: true, multiline: true },
39
28
  ImportDeclaration: { consistent: true, multiline: true },
40
29
  ObjectExpression: { consistent: true, multiline: true },
41
- ObjectPattern: { consistent: true, multiline: true },
30
+ ObjectPattern: { consistent: true, multiline: true }
42
31
  }],
43
32
 
44
33
  // function
@@ -64,24 +53,21 @@ export const stylistic = [
64
53
  overrides: {
65
54
  else: {
66
55
  after: true,
67
- before: true,
56
+ before: true
68
57
  },
69
58
  for: {
70
- after: false,
59
+ after: false
71
60
  },
72
61
  if: {
73
62
  after: false,
74
- before: false,
63
+ before: false
75
64
  },
76
65
  while: {
77
- after: false,
78
- },
79
- },
66
+ after: false
67
+ }
68
+ }
80
69
  }],
81
70
 
82
- // comment
83
- "eslint-plugin-stylistic-js/lines-around-comment": ["warn", { beforeBlockComment: true, beforeLineComment: true }],
84
-
85
71
  // class
86
72
  "eslint-plugin-stylistic-js/new-parens": "warn",
87
73
  "eslint-plugin-stylistic-js/lines-between-class-members": "warn",
@@ -116,12 +102,12 @@ export const stylistic = [
116
102
  {
117
103
  blankLine: "always",
118
104
  next: "*",
119
- prev: "class",
105
+ prev: "class"
120
106
  },
121
107
  {
122
108
  blankLine: "always",
123
109
  next: "class",
124
- prev: "*",
110
+ prev: "*"
125
111
  }],
126
112
 
127
113
  // quotes
@@ -135,7 +121,7 @@ export const stylistic = [
135
121
  "eslint-plugin-stylistic-js/brace-style": ["warn", "1tbs", { allowSingleLine: true }],
136
122
 
137
123
  // comma
138
- "eslint-plugin-stylistic-js/comma-dangle": ["warn", "always-multiline"],
124
+ "eslint-plugin-stylistic-js/comma-dangle": ["warn", "never"],
139
125
  "eslint-plugin-stylistic-js/comma-spacing": ["warn", { after: true, before: false }],
140
126
  "eslint-plugin-stylistic-js/comma-style": ["warn", "last"],
141
127
 
@@ -145,30 +131,18 @@ export const stylistic = [
145
131
  "eslint-plugin-stylistic-js/semi-style": ["warn", "last"],
146
132
  "eslint-plugin-stylistic-js/no-extra-semi": "warn",
147
133
 
148
- // operators
149
- "eslint-plugin-stylistic-js/no-mixed-operators": "warn",
150
-
151
134
  // template literals
152
135
  "eslint-plugin-stylistic-js/template-curly-spacing": ["warn", "never"],
153
- "eslint-plugin-stylistic-js/template-tag-spacing": ["warn", "never"],
136
+ "eslint-plugin-stylistic-js/template-tag-spacing": ["warn", "never"]
154
137
 
155
- },
138
+ }
156
139
  },
157
140
 
158
141
  {
159
142
  files: ["**/*.{ts,tsx}"],
160
143
  plugins: {
161
144
  "eslint-plugin-stylistic-ts": eslintPluginStylisticTS,
162
- "eslint-plugin-stylistic-js": eslintPluginStylisticJS,
163
- },
164
- languageOptions: {i
165
- parser: parserTs,
166
- globals: {
167
- ...globals.browser,
168
- ...globals.node,
169
- ...globals.builtin,
170
- ...globals.worker,
171
- },
145
+ "eslint-plugin-stylistic-js": eslintPluginStylisticJS
172
146
  },
173
147
  rules: {
174
148
 
@@ -187,10 +161,6 @@ export const stylistic = [
187
161
  "eslint-plugin-stylistic-js/comma-spacing": "off",
188
162
  "eslint-plugin-stylistic-ts/comma-spacing": ["warn", { after: true, before: false }],
189
163
 
190
- // comments
191
- "eslint-plugin-stylistic-js/lines-around-comment": "off",
192
- "eslint-plugin-stylistic-ts/lines-around-comment": ["warn", { beforeBlockComment: true, beforeLineComment: true }],
193
-
194
164
  // functions
195
165
  "eslint-plugin-stylistic-js/function-call-spacing": "off",
196
166
  "eslint-plugin-stylistic-ts/function-call-spacing": ["warn", "never"],
@@ -235,12 +205,12 @@ export const stylistic = [
235
205
  {
236
206
  blankLine: "always",
237
207
  next: "*",
238
- prev: "class",
208
+ prev: "class"
239
209
  },
240
210
  {
241
211
  blankLine: "always",
242
212
  next: "class",
243
- prev: "*",
213
+ prev: "*"
244
214
  }],
245
215
 
246
216
  // keywords
@@ -251,35 +221,35 @@ export const stylistic = [
251
221
  overrides: {
252
222
  else: {
253
223
  after: true,
254
- before: true,
224
+ before: true
255
225
  },
256
226
  for: {
257
- after: false,
227
+ after: false
258
228
  },
259
229
  if: {
260
230
  after: false,
261
- before: false,
231
+ before: false
262
232
  },
263
233
  while: {
264
- after: false,
265
- },
266
- },
234
+ after: false
235
+ }
236
+ }
267
237
  }],
268
238
 
269
239
  // object type members
270
240
  "eslint-plugin-stylistic-ts/member-delimiter-style": ["warn", {
271
241
  multiline: {
272
242
  delimiter: "semi",
273
- requireLast: true,
243
+ requireLast: true
274
244
  },
275
245
  multilineDetection: "brackets",
276
246
  singleline: {
277
247
  delimiter: "semi",
278
- requireLast: true,
279
- },
280
- }],
248
+ requireLast: true
249
+ }
250
+ }]
281
251
 
282
- },
283
- },
252
+ }
253
+ }
284
254
 
285
255
  ];
@@ -3,7 +3,7 @@ import eslintPluginTailwindcss from "eslint-plugin-tailwindcss";
3
3
 
4
4
 
5
5
  const tailwindOptions = {
6
- callees: ["twMerge", "twJoin", "cn", "cnv", "cva"],
6
+ callees: ["twMerge", "twJoin", "cn", "cnv", "cva"]
7
7
  };
8
8
 
9
9
  /** @type { import("eslint").Linter.FlatConfig[] } */
@@ -12,7 +12,7 @@ export const tailwind = [
12
12
  files: ["**/*.{js,jsx,cjs,mjs,tsx,css}"],
13
13
  plugins: {
14
14
  "eslint-plugin-tailwindcss": eslintPluginTailwindcss,
15
- "eslint-plugin-readable-tailwind": eslintPluginReadableTailwind,
15
+ "eslint-plugin-readable-tailwind": eslintPluginReadableTailwind
16
16
  },
17
17
  rules: {
18
18
  "eslint-plugin-tailwindcss/enforces-negative-arbitrary-values": ["warn", tailwindOptions],
@@ -20,9 +20,8 @@ export const tailwind = [
20
20
  "eslint-plugin-tailwindcss/no-contradicting-classname": ["warn", tailwindOptions],
21
21
 
22
22
  "eslint-plugin-readable-tailwind/multiline": ["warn", { ...tailwindOptions, printWidth: 119 }],
23
- "eslint-plugin-readable-tailwind/jsx-attribute-expression": "warn",
24
23
  "eslint-plugin-readable-tailwind/no-unnecessary-whitespace": ["warn", { ...tailwindOptions }],
25
- "eslint-plugin-readable-tailwind/sort-classes": ["warn", { ...tailwindOptions }],
26
- },
27
- },
24
+ "eslint-plugin-readable-tailwind/sort-classes": ["warn", { ...tailwindOptions }]
25
+ }
26
+ }
28
27
  ];
@@ -6,7 +6,7 @@ import eslintPluginTypeScriptSortKeys from "eslint-plugin-typescript-sort-keys";
6
6
  import eslintPluginStylisticJS from "@stylistic/eslint-plugin-js";
7
7
  import eslintPluginStylisticTS from "@stylistic/eslint-plugin-ts";
8
8
  import eslintPluginTypeScript from "@typescript-eslint/eslint-plugin";
9
- import parserTs from "@typescript-eslint/parser";
9
+ import eslintParserTypeScript from "@typescript-eslint/parser";
10
10
 
11
11
  import { javascript } from "./javascript.js";
12
12
 
@@ -17,9 +17,17 @@ export const typescript = [
17
17
 
18
18
  // typescript
19
19
  {
20
+
20
21
  languageOptions: {
21
- parser: parserTs,
22
+ parser: eslintParserTypeScript,
23
+ parserOptions: {
24
+ project: "./tsconfig.json"
25
+ }
22
26
  },
27
+ files: ["**/*.{ts,tsx}"]
28
+ },
29
+
30
+ {
23
31
  files: ["**/*.{ts,tsx}"],
24
32
  plugins: {
25
33
  "eslint-plugin-import": eslintPluginImport,
@@ -27,6 +35,7 @@ export const typescript = [
27
35
  "eslint-plugin-typescript": eslintPluginTypeScript,
28
36
  "eslint-plugin-stylistic-ts": eslintPluginStylisticTS,
29
37
  "eslint-plugin-stylistic-js": eslintPluginStylisticJS,
38
+ "eslint-plugin-typescript-sort-keys": eslintPluginTypeScriptSortKeys
30
39
  },
31
40
  rules: {
32
41
 
@@ -49,14 +58,14 @@ export const typescript = [
49
58
 
50
59
  // interfaces
51
60
  "eslint-plugin-typescript/method-signature-style": ["warn", "method"],
52
- "typescript-sort-keys/interface": ["warn", "asc", {
61
+ "eslint-plugin-typescript-sort-keys/interface": ["warn", "asc", {
53
62
  caseSensitive: true,
54
63
  natural: true,
55
- requiredFirst: true,
64
+ requiredFirst: true
56
65
  }],
57
66
 
58
67
  // enum
59
- "typescript-sort-keys/string-enum": "warn",
68
+ "eslint-plugin-typescript-sort-keys/string-enum": "warn",
60
69
 
61
70
  // functions
62
71
  "eslint-plugin-typescript/unified-signatures": ["warn", { ignoreDifferentlyNamedParameters: true }],
@@ -101,9 +110,9 @@ export const typescript = [
101
110
  "off",
102
111
  {
103
112
  ignorePrimitives: {
104
- boolean: true,
105
- },
106
- },
113
+ boolean: true
114
+ }
115
+ }
107
116
  ],
108
117
 
109
118
  // no unused
@@ -113,10 +122,13 @@ export const typescript = [
113
122
  {
114
123
  allowShortCircuit: true,
115
124
  allowTaggedTemplates: true,
116
- allowTernary: true,
117
- },
125
+ allowTernary: true
126
+ }
118
127
  ],
119
128
 
129
+ // no useless
130
+ "eslint-plugin-typescript/no-useless-template-literals": "warn",
131
+
120
132
  // modern syntax
121
133
  "eslint-plugin-typescript/prefer-string-starts-ends-with": "warn",
122
134
 
@@ -126,7 +138,7 @@ export const typescript = [
126
138
  "eslint-plugin-typescript/restrict-template-expressions": ["warn", {
127
139
  allowBoolean: true,
128
140
  allowNullish: true,
129
- allowNumber: true,
141
+ allowNumber: true
130
142
  }],
131
143
 
132
144
  // custom
@@ -134,76 +146,79 @@ export const typescript = [
134
146
  "warn",
135
147
  {
136
148
  message: "No number keys. Number keys get internally converted to strings and should be avoided.",
137
- selector: "TSIndexSignature > Identifier[name='key'] > TSTypeAnnotation:has(TSNumberKeyword)",
138
- },
149
+ selector: "TSIndexSignature > Identifier[name='key'] > TSTypeAnnotation:has(TSNumberKeyword)"
150
+ }
139
151
  ],
140
152
 
141
153
  // naming conventions
142
- "eslint-plugin-typescript/naming-convention": [
143
- "warn",
154
+ "eslint-plugin-typescript/naming-convention": ["warn",
144
155
  {
145
156
  filter: {
146
157
  match: false,
147
- regex: "^[0-9]*$",
158
+ regex: "^[0-9]*$"
148
159
  },
149
160
  format: ["camelCase", "UPPER_CASE", "PascalCase"],
150
161
  leadingUnderscore: "allow",
151
162
  selector: "objectLiteralProperty",
152
- trailingUnderscore: "allow",
163
+ trailingUnderscore: "allow"
153
164
  },
154
165
  {
155
166
  format: ["camelCase", "UPPER_CASE"],
156
167
  leadingUnderscore: "allow",
157
- selector: "variable",
168
+ selector: "variable"
158
169
  },
159
170
  {
160
171
  custom: {
161
172
  match: false,
162
- regex: "^I[A-Z]",
173
+ regex: "^I[A-Z]"
163
174
  },
164
175
  format: ["PascalCase"],
165
- selector: "interface",
176
+ selector: "interface"
166
177
  },
167
178
  {
168
179
  format: ["camelCase"],
169
180
  leadingUnderscore: "allow",
170
- selector: "parameter",
181
+ selector: "parameter"
171
182
  },
172
183
  {
173
184
  format: ["camelCase"],
174
185
  leadingUnderscore: "allow",
175
186
  modifiers: ["private"],
176
- selector: "memberLike",
187
+ selector: "memberLike"
177
188
  },
178
189
  {
179
190
  format: ["camelCase", "UPPER_CASE", "PascalCase"],
180
191
  leadingUnderscore: "allow",
181
192
  modifiers: ["override"],
182
193
  selector: "memberLike",
183
- trailingUnderscore: "allow",
194
+ trailingUnderscore: "allow"
184
195
  },
185
196
  {
186
197
  format: ["UPPER_CASE", "PascalCase"],
187
- selector: "enumMember",
198
+ selector: "enumMember"
188
199
  },
189
200
  {
190
201
  format: ["PascalCase"],
191
- selector: "typeLike",
202
+ selector: "typeLike"
192
203
  },
193
204
  {
194
205
  format: ["PascalCase"],
195
206
  selector: "class",
196
- trailingUnderscore: "allow",
207
+ trailingUnderscore: "allow"
197
208
  },
198
- ],
209
+ {
210
+ format: ["PascalCase"],
211
+ selector: "variable",
212
+ trailingUnderscore: "allow"
213
+ }],
199
214
  "eslint-plugin-typescript/no-base-to-string": "warn",
200
215
 
201
216
  "eslint-plugin-typescript/no-confusing-void-expression": ["warn", {
202
217
  ignoreArrowShorthand: true,
203
- ignoreVoidOperator: true,
204
- }],
218
+ ignoreVoidOperator: true
219
+ }]
205
220
 
206
- },
221
+ }
207
222
  },
208
223
 
209
224
  // jsdoc
@@ -212,22 +227,22 @@ export const typescript = [
212
227
  plugins: {
213
228
  "eslint-plugin-import": eslintPluginImport,
214
229
  "eslint-plugin-jsdoc": eslintPluginJSDoc,
215
- "eslint-plugin-stylistic-ts": eslintPluginStylisticTS,
230
+ "eslint-plugin-stylistic-ts": eslintPluginStylisticTS
216
231
  },
217
232
  rules: {
218
233
 
219
234
  // disable JSDoc types
220
235
  "eslint-plugin-jsdoc/check-types": "off",
221
236
  "eslint-plugin-jsdoc/no-defaults": "warn",
222
- "eslint-plugin-jsdoc/no-types": "warn",
223
- },
237
+ "eslint-plugin-jsdoc/no-types": "warn"
238
+ }
224
239
  },
225
240
 
226
241
  // sort type keys
227
242
  {
228
243
  files: ["**/*.{ts,tsx}"],
229
244
  plugins: {
230
- "eslint-plugin-typescript-sort-keys": eslintPluginTypeScriptSortKeys,
245
+ "eslint-plugin-typescript-sort-keys": eslintPluginTypeScriptSortKeys
231
246
  },
232
247
  rules: {
233
248
  "eslint-plugin-typescript-sort-keys/interface": [
@@ -236,21 +251,21 @@ export const typescript = [
236
251
  {
237
252
  caseSensitive: true,
238
253
  natural: true,
239
- requiredFirst: true,
240
- },
254
+ requiredFirst: true
255
+ }
241
256
  ],
242
- "eslint-plugin-typescript-sort-keys/string-enum": "warn",
243
- },
257
+ "eslint-plugin-typescript-sort-keys/string-enum": "warn"
258
+ }
244
259
  },
245
260
 
246
261
  // tsconfig.json
247
262
  {
248
263
  files: ["**/tsconfig.json", "**/tsconfig.*.json"],
249
264
  plugins: {
250
- "eslint-plugin-jsonc": eslintPluginJsonc,
265
+ "eslint-plugin-jsonc": eslintPluginJsonc
251
266
  },
252
267
  languageOptions: {
253
- parser: eslintPluginJsonc,
268
+ parser: eslintPluginJsonc
254
269
  },
255
270
  rules: {
256
271
  "eslint-plugin-jsonc/sort-keys": [
@@ -259,25 +274,25 @@ export const typescript = [
259
274
  order: {
260
275
  caseSensitive: true,
261
276
  natural: true,
262
- type: "asc",
277
+ type: "asc"
263
278
  },
264
- pathPattern: "^.*..*$",
279
+ pathPattern: "^.*..*$"
265
280
  },
266
281
  {
267
282
  order: ["extends", "compilerOptions", "include", "exclude"],
268
- pathPattern: "^$",
269
- },
270
- ],
271
- },
283
+ pathPattern: "^$"
284
+ }
285
+ ]
286
+ }
272
287
  },
273
288
 
274
289
  // standalone typescript
275
290
  {
276
291
  languageOptions: {
277
- parser: parserTs,
292
+ parser: eslintParserTypeScript
278
293
  },
279
294
  plugins: {
280
- "eslint-plugin-typescript": eslintPluginTypeScript,
295
+ "@typescript-eslint": eslintPluginTypeScript
281
296
  },
282
297
  files: [
283
298
  "**/*.config.ts",
@@ -288,11 +303,10 @@ export const typescript = [
288
303
  "**/*.md/*.mts",
289
304
  "**/*.md/*.mtsx",
290
305
  "**/*.md/*.cts",
291
- "**/*.md/*.ctsx",
306
+ "**/*.md/*.ctsx"
292
307
  ],
293
308
  rules: {
294
- ...eslintPluginTypeScript.configs["disable-type-checked"].rules,
295
- },
296
- },
297
-
309
+ ...eslintPluginTypeScript.configs["disable-type-checked"].rules
310
+ }
311
+ }
298
312
  ];
package/eslint/vitest.js CHANGED
@@ -1,14 +1,12 @@
1
1
  import eslintPluginVitest from "eslint-plugin-vitest";
2
2
 
3
- import parserTs from "@typescript-eslint/parser";
4
-
5
3
 
6
4
  /** @type { import("eslint").Linter.FlatConfig[] } */
7
5
  export const vitest = [
8
6
  {
9
7
  files: ["**/*.test.{js,jsx,cjs,mjs,ts,tsx}", "**/*.test-d.{ts,tsx}"],
10
8
  plugins: {
11
- "eslint-plugin-vitest": eslintPluginVitest,
9
+ "eslint-plugin-vitest": eslintPluginVitest
12
10
  },
13
11
  rules: {
14
12
  "eslint-plugin-vitest/expect-expect": "warn",
@@ -24,19 +22,18 @@ export const vitest = [
24
22
  "eslint-plugin-vitest/prefer-to-have-length": "warn",
25
23
  "eslint-plugin-vitest/prefer-todo": "warn",
26
24
  "eslint-plugin-vitest/valid-expect": "warn",
27
- "eslint-plugin-vitest/valid-title": "warn",
28
- },
25
+ "eslint-plugin-vitest/valid-title": "warn"
26
+ }
29
27
  },
30
28
  {
31
-
32
29
  files: ["**/*.test-d.ts"],
33
- languageOptions: {
34
- parser: parserTs,
30
+ plugins: {
31
+ "eslint-plugin-vitest": eslintPluginVitest
35
32
  },
36
33
  rules: {
37
- "vitest/expect-expect": "off",
38
- "vitest/prefer-lowercase-title": "off",
39
- },
34
+ "eslint-plugin-vitest/expect-expect": "off",
35
+ "eslint-plugin-vitest/prefer-lowercase-title": "off"
36
+ }
40
37
 
41
- },
38
+ }
42
39
  ];
package/eslint/yaml.js CHANGED
@@ -1,40 +1,41 @@
1
1
  import eslintPluginYml from "eslint-plugin-yml";
2
- import yamlESLintParser from "yaml-eslint-parser";
2
+ import eslintParserYaml from "yaml-eslint-parser";
3
3
 
4
4
  /** @type {import("eslint").Linter.FlatConfig[]} */
5
5
  export const yaml = [
6
6
  {
7
7
  files: ["**/*.{yaml,yml}"],
8
- excludedFiles: ["pnpm-lock.yaml"],
9
- plugins: {
10
- "eslint-plugin-yml": eslintPluginYml,
11
- },
8
+ ignores: ["pnpm-lock.yaml"],
12
9
  languageOptions: {
13
- parser: yamlESLintParser,
10
+ parser: eslintParserYaml
11
+ }
12
+ },
13
+ {
14
+ files: ["**/*.{yaml,yml}"],
15
+ ignores: ["pnpm-lock.yaml"],
16
+ plugins: {
17
+ "eslint-plugin-yml": eslintPluginYml
14
18
  },
15
19
  rules: {
16
20
  "eslint-plugin-yml/quotes": ["warn", { avoidEscape: true, prefer: "double" }],
17
21
  "eslint-plugin-yml/sort-keys": ["warn", "asc", {
18
22
  caseSensitive: false,
19
23
  minKeys: 2,
20
- natural: true,
21
- }],
22
- },
24
+ natural: true
25
+ }]
26
+ }
23
27
  },
24
28
  {
25
29
  files: ["**/.github/**/*.{yaml,yml}"],
26
30
  plugins: {
27
- "eslint-plugin-yml": eslintPluginYml,
28
- },
29
- languageOptions: {
30
- parser: yamlESLintParser,
31
+ "eslint-plugin-yml": eslintPluginYml
31
32
  },
32
33
  rules: {
33
34
  "eslint-plugin-yml/sort-keys": [
34
35
  "warn",
35
36
  {
36
37
  order: ["name", "on", "jobs"],
37
- pathPattern: "^$",
38
+ pathPattern: "^$"
38
39
  },
39
40
  {
40
41
  order: [
@@ -48,19 +49,19 @@ export const yaml = [
48
49
  "pages",
49
50
  "deploy",
50
51
  "publish",
51
- "release",
52
+ "release"
52
53
  ],
53
- pathPattern: "^jobs.*",
54
+ pathPattern: "^jobs.*"
54
55
  },
55
56
  {
56
57
  order: {
57
58
  caseSensitive: true,
58
59
  natural: true,
59
- type: "asc",
60
+ type: "asc"
60
61
  },
61
- pathPattern: "^.*$",
62
- },
63
- ],
64
- },
65
- },
62
+ pathPattern: "^.*$"
63
+ }
64
+ ]
65
+ }
66
+ }
66
67
  ];