@nekoyasuii/config 0.2.0 → 0.2.1

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,16 +1,28 @@
1
- declare const _default: {
2
- extends: ({
1
+ declare const config: {
2
+ extends: (import("oxlint").OxlintConfig | {
3
3
  env: {
4
4
  browser: true;
5
5
  };
6
6
  ignorePatterns: string[];
7
- overrides: {
7
+ overrides: ({
8
8
  files: string[];
9
9
  rules: {
10
10
  "no-empty-function": "off";
11
11
  "promise/prefer-await-to-then": "off";
12
+ "import/no-commonjs"?: undefined;
13
+ "no-restricted-globals"?: undefined;
14
+ "unicorn/prefer-module"?: undefined;
15
+ };
16
+ } | {
17
+ files: string[];
18
+ rules: {
19
+ "no-empty-function"?: undefined;
20
+ "promise/prefer-await-to-then"?: undefined;
21
+ "import/no-commonjs": "error";
22
+ "no-restricted-globals": ["error", string, string];
23
+ "unicorn/prefer-module": "off";
12
24
  };
13
- }[];
25
+ })[];
14
26
  plugins: ("eslint" | "import" | "jsdoc" | "node" | "oxc" | "promise" | "typescript" | "unicorn")[];
15
27
  rules: {
16
28
  "accessor-pairs": "error";
@@ -36,7 +48,61 @@ declare const _default: {
36
48
  "id-denylist": "error";
37
49
  "id-length": "off";
38
50
  "id-match": "error";
51
+ "import/consistent-type-specifier-style": ["error", "prefer-top-level"];
52
+ "import/default": "error";
53
+ "import/exports-last": "off";
54
+ "import/extensions": "off";
55
+ "import/first": "error";
56
+ "import/group-exports": "off";
57
+ "import/max-dependencies": "off";
58
+ "import/namespace": "error";
59
+ "import/newline-after-import": "error";
60
+ "import/no-absolute-path": "error";
61
+ "import/no-amd": "error";
62
+ "import/no-anonymous-default-export": "off";
63
+ "import/no-commonjs": "off";
64
+ "import/no-cycle": "error";
65
+ "import/no-default-export": "off";
66
+ "import/no-duplicates": "error";
67
+ "import/no-dynamic-require": "off";
68
+ "import/no-empty-named-blocks": "error";
69
+ "import/no-mutable-exports": "error";
70
+ "import/no-named-as-default": "error";
71
+ "import/no-named-as-default-member": "error";
72
+ "import/no-named-default": "error";
73
+ "import/no-named-export": "off";
74
+ "import/no-namespace": "off";
75
+ "import/no-nodejs-modules": "off";
76
+ "import/no-relative-parent-imports": "off";
77
+ "import/no-self-import": "error";
78
+ "import/no-unassigned-import": "off";
79
+ "import/no-webpack-loader-syntax": "error";
80
+ "import/prefer-default-export": "off";
81
+ "import/unambiguous": "off";
39
82
  "init-declarations": "off";
83
+ "jsdoc/check-access": "error";
84
+ "jsdoc/check-property-names": "error";
85
+ "jsdoc/check-tag-names": "error";
86
+ "jsdoc/empty-tags": "error";
87
+ "jsdoc/implements-on-classes": "error";
88
+ "jsdoc/no-blank-blocks": "error";
89
+ "jsdoc/no-defaults": "error";
90
+ "jsdoc/require-param": "off";
91
+ "jsdoc/require-param-description": "error";
92
+ "jsdoc/require-param-name": "error";
93
+ "jsdoc/require-param-type": "off";
94
+ "jsdoc/require-property": "error";
95
+ "jsdoc/require-property-description": "error";
96
+ "jsdoc/require-property-name": "error";
97
+ "jsdoc/require-property-type": "error";
98
+ "jsdoc/require-returns": "off";
99
+ "jsdoc/require-returns-description": "error";
100
+ "jsdoc/require-returns-type": "off";
101
+ "jsdoc/require-throws-description": "error";
102
+ "jsdoc/require-throws-type": "error";
103
+ "jsdoc/require-yields": "error";
104
+ "jsdoc/require-yields-description": "error";
105
+ "jsdoc/require-yields-type": "error";
40
106
  "logical-assignment-operators": "error";
41
107
  "max-classes-per-file": "error";
42
108
  "max-depth": "off";
@@ -56,10 +122,10 @@ declare const _default: {
56
122
  "no-class-assign": "error";
57
123
  "no-compare-neg-zero": "error";
58
124
  "no-cond-assign": "error";
125
+ "no-console": "off";
59
126
  "no-const-assign": "error";
60
127
  "no-constant-binary-expression": "error";
61
128
  "no-constant-condition": "error";
62
- "no-console": "off";
63
129
  "no-constructor-return": "error";
64
130
  "no-continue": "off";
65
131
  "no-control-regex": "error";
@@ -171,90 +237,6 @@ declare const _default: {
171
237
  }];
172
238
  "no-warning-comments": "error";
173
239
  "no-with": "error";
174
- "object-shorthand": "error";
175
- "one-var": ["error", "never"];
176
- "operator-assignment": "error";
177
- "prefer-arrow-callback": "error";
178
- "prefer-const": "error";
179
- "prefer-destructuring": "error";
180
- "prefer-exponentiation-operator": "error";
181
- "prefer-named-capture-group": "error";
182
- "prefer-numeric-literals": "error";
183
- "prefer-object-has-own": "error";
184
- "prefer-object-spread": "error";
185
- "prefer-promise-reject-errors": "error";
186
- "prefer-regex-literals": "error";
187
- "prefer-rest-params": "error";
188
- "prefer-spread": "error";
189
- "prefer-template": "error";
190
- "preserve-caught-error": "error";
191
- radix: "error";
192
- "require-await": "error";
193
- "require-unicode-regexp": "error";
194
- "require-yield": "error";
195
- "sort-imports": "off";
196
- "sort-keys": "off";
197
- "sort-vars": "error";
198
- "symbol-description": "error";
199
- "unicode-bom": "error";
200
- "use-isnan": "error";
201
- "valid-typeof": "error";
202
- "vars-on-top": "error";
203
- yoda: "error";
204
- "import/consistent-type-specifier-style": ["error", "prefer-top-level"];
205
- "import/default": "error";
206
- "import/exports-last": "off";
207
- "import/extensions": "off";
208
- "import/first": "error";
209
- "import/group-exports": "off";
210
- "import/max-dependencies": "off";
211
- "import/namespace": "error";
212
- "import/newline-after-import": "error";
213
- "import/no-absolute-path": "error";
214
- "import/no-amd": "error";
215
- "import/no-anonymous-default-export": "off";
216
- "import/no-commonjs": "off";
217
- "import/no-cycle": "error";
218
- "import/no-default-export": "off";
219
- "import/no-duplicates": "error";
220
- "import/no-dynamic-require": "off";
221
- "import/no-empty-named-blocks": "error";
222
- "import/no-mutable-exports": "error";
223
- "import/no-named-as-default": "error";
224
- "import/no-named-as-default-member": "error";
225
- "import/no-named-default": "error";
226
- "import/no-named-export": "off";
227
- "import/no-namespace": "off";
228
- "import/no-nodejs-modules": "off";
229
- "import/no-relative-parent-imports": "off";
230
- "import/no-self-import": "error";
231
- "import/no-unassigned-import": "off";
232
- "import/no-webpack-loader-syntax": "error";
233
- "import/prefer-default-export": "off";
234
- "import/unambiguous": "off";
235
- "jsdoc/check-access": "error";
236
- "jsdoc/check-property-names": "error";
237
- "jsdoc/check-tag-names": "error";
238
- "jsdoc/empty-tags": "error";
239
- "jsdoc/implements-on-classes": "error";
240
- "jsdoc/no-blank-blocks": "error";
241
- "jsdoc/no-defaults": "error";
242
- "jsdoc/require-param": "off";
243
- "jsdoc/require-param-description": "error";
244
- "jsdoc/require-param-name": "error";
245
- "jsdoc/require-param-type": "off";
246
- "jsdoc/require-property": "error";
247
- "jsdoc/require-property-description": "error";
248
- "jsdoc/require-property-name": "error";
249
- "jsdoc/require-property-type": "error";
250
- "jsdoc/require-returns": "off";
251
- "jsdoc/require-returns-description": "error";
252
- "jsdoc/require-returns-type": "off";
253
- "jsdoc/require-throws-description": "error";
254
- "jsdoc/require-throws-type": "error";
255
- "jsdoc/require-yields": "error";
256
- "jsdoc/require-yields-description": "error";
257
- "jsdoc/require-yields-type": "error";
258
240
  "node/callback-return": "error";
259
241
  "node/exports-style": "error";
260
242
  "node/global-require": "error";
@@ -266,6 +248,9 @@ declare const _default: {
266
248
  "node/no-process-env": "off";
267
249
  "node/no-sync": "off";
268
250
  "node/no-top-level-await": "off";
251
+ "object-shorthand": "error";
252
+ "one-var": ["error", "never"];
253
+ "operator-assignment": "error";
269
254
  "oxc/approx-constant": "error";
270
255
  "oxc/bad-array-method-on-arguments": "error";
271
256
  "oxc/bad-bitwise-operator": "error";
@@ -293,6 +278,20 @@ declare const _default: {
293
278
  "oxc/number-arg-out-of-range": "error";
294
279
  "oxc/only-used-in-recursion": "error";
295
280
  "oxc/uninvoked-array-callback": "error";
281
+ "prefer-arrow-callback": "error";
282
+ "prefer-const": "error";
283
+ "prefer-destructuring": "error";
284
+ "prefer-exponentiation-operator": "error";
285
+ "prefer-named-capture-group": "error";
286
+ "prefer-numeric-literals": "error";
287
+ "prefer-object-has-own": "error";
288
+ "prefer-object-spread": "error";
289
+ "prefer-promise-reject-errors": "error";
290
+ "prefer-regex-literals": "error";
291
+ "prefer-rest-params": "error";
292
+ "prefer-spread": "error";
293
+ "prefer-template": "error";
294
+ "preserve-caught-error": "error";
296
295
  "promise/always-return": "off";
297
296
  "promise/avoid-new": "error";
298
297
  "promise/catch-or-return": "off";
@@ -308,6 +307,14 @@ declare const _default: {
308
307
  "promise/prefer-catch": "error";
309
308
  "promise/spec-only": "error";
310
309
  "promise/valid-params": "error";
310
+ radix: "error";
311
+ "require-await": "error";
312
+ "require-unicode-regexp": "error";
313
+ "require-yield": "error";
314
+ "sort-imports": "off";
315
+ "sort-keys": "off";
316
+ "sort-vars": "error";
317
+ "symbol-description": "error";
311
318
  "typescript/adjacent-overload-signatures": "error";
312
319
  "typescript/array-type": "error";
313
320
  "typescript/await-thenable": "error";
@@ -361,12 +368,12 @@ declare const _default: {
361
368
  "typescript/no-this-alias": "error";
362
369
  "typescript/no-unnecessary-boolean-literal-compare": "error";
363
370
  "typescript/no-unnecessary-parameter-property-assignment": "error";
371
+ "typescript/no-unnecessary-qualifier": "error";
364
372
  "typescript/no-unnecessary-template-expression": "error";
365
373
  "typescript/no-unnecessary-type-arguments": "error";
366
374
  "typescript/no-unnecessary-type-assertion": "error";
367
375
  "typescript/no-unnecessary-type-constraint": "error";
368
376
  "typescript/no-unnecessary-type-conversion": "error";
369
- "typescript/no-unnecessary-qualifier": "error";
370
377
  "typescript/no-unnecessary-type-parameters": "error";
371
378
  "typescript/no-unsafe-argument": "error";
372
379
  "typescript/no-unsafe-assignment": "error";
@@ -416,13 +423,14 @@ declare const _default: {
416
423
  "typescript/unbound-method": "error";
417
424
  "typescript/unified-signatures": "error";
418
425
  "typescript/use-unknown-in-catch-callback-variable": "error";
419
- "unicorn/consistent-template-literal-escape": "error";
426
+ "unicode-bom": "error";
420
427
  "unicorn/catch-error-name": "error";
421
428
  "unicorn/consistent-assert": "error";
422
429
  "unicorn/consistent-date-clone": "error";
423
430
  "unicorn/consistent-empty-array-spread": "error";
424
431
  "unicorn/consistent-existence-index-check": "error";
425
432
  "unicorn/consistent-function-scoping": "error";
433
+ "unicorn/consistent-template-literal-escape": "error";
426
434
  "unicorn/custom-error-definition": "error";
427
435
  "unicorn/empty-brace-spaces": "error";
428
436
  "unicorn/error-message": "error";
@@ -460,7 +468,7 @@ declare const _default: {
460
468
  "unicorn/no-magic-array-flat-depth": "error";
461
469
  "unicorn/no-negated-condition": "error";
462
470
  "unicorn/no-negation-in-equality-check": "error";
463
- "unicorn/no-nested-ternary": "error";
471
+ "unicorn/no-nested-ternary": "off";
464
472
  "unicorn/no-new-array": "error";
465
473
  "unicorn/no-new-buffer": "error";
466
474
  "unicorn/no-null": "off";
@@ -555,93 +563,10 @@ declare const _default: {
555
563
  withDash: true;
556
564
  }];
557
565
  "unicorn/throw-new-error": "error";
558
- };
559
- } | {
560
- settings: {
561
- "react-doctor": {
562
- portedRuleMode: string;
563
- };
564
- };
565
- jsPlugins: ({
566
- readonly name: "github";
567
- readonly specifier: "eslint-plugin-github";
568
- } | {
569
- readonly name: "sonarjs";
570
- readonly specifier: "eslint-plugin-sonarjs";
571
- } | {
572
- readonly name: "react-doctor";
573
- readonly specifier: "oxlint-plugin-react-doctor";
574
- } | {
575
- readonly name: "tailwindcss";
576
- readonly specifier: "oxlint-tailwindcss";
577
- } | {
578
- readonly name: "anti-slop";
579
- readonly specifier: string;
580
- } | {
581
- readonly name: "no-comment-slop";
582
- readonly specifier: string;
583
- } | {
584
- readonly name: "shadcn";
585
- readonly specifier: string;
586
- } | {
587
- readonly name: "lazuee";
588
- readonly specifier: string;
589
- })[];
590
- overrides: ({
591
- files: string[];
592
- rules: {
593
- [k: string]: any;
594
- };
595
- } | {
596
- files: string[];
597
- rules: {
598
- [k: string]: any;
599
- };
600
- } | {
601
- files: string[];
602
- rules: {
603
- [k: string]: any;
604
- };
605
- } | {
606
- files: string[];
607
- rules: {
608
- [k: string]: any;
609
- };
610
- } | {
611
- files: string[];
612
- rules: {
613
- [k: string]: any;
614
- };
615
- } | {
616
- files: string[];
617
- rules: {
618
- [k: string]: any;
619
- };
620
- } | {
621
- files: string[];
622
- rules: {
623
- [k: string]: any;
624
- };
625
- } | {
626
- files: string[];
627
- rules: {
628
- [k: string]: any;
629
- };
630
- })[];
631
- rules: {
632
- [k: string]: "error" | "off" | "warn" | ["error", number] | ["error", {
633
- allowInTypeGuards: boolean;
634
- }] | ["error", {
635
- allow: string[];
636
- contracts: {
637
- pattern: string;
638
- allow: string[];
639
- }[];
640
- }] | ["error", {
641
- allow: string[];
642
- }] | ["error", {
643
- allow: string[];
644
- }];
566
+ "use-isnan": "error";
567
+ "valid-typeof": "error";
568
+ "vars-on-top": "error";
569
+ yoda: "error";
645
570
  };
646
571
  } | {
647
572
  plugins: ("jsx-a11y" | "react" | "react-perf")[];
@@ -802,21 +727,5 @@ declare const _default: {
802
727
  }];
803
728
  };
804
729
  })[];
805
- rules: {
806
- /**
807
- * Opinionated anti-slop rules that flag valid code: a comment above
808
- * every type assertion and explicit named contracts like
809
- * `Record<Theme, ThemeColors>`. Runtime `typeof` narrowing is how form
810
- * data and `unknown` route errors are parsed before use.
811
- */
812
- "anti-slop/require-safety-comment-for-type-assertion": "off";
813
- "anti-slop/no-known-value-widening": "off";
814
- "anti-slop/no-runtime-typeof": "off";
815
- };
816
- settings: {
817
- "react-doctor": {
818
- portedRuleMode: string;
819
- };
820
- };
821
730
  };
822
- export default _default;
731
+ export default config;
@@ -1,17 +1,17 @@
1
1
  import"../../../chunk-tvk9tq03.js";
2
2
  import {
3
3
  coreConfig2
4
- } from "../../../chunk-k5zpegn9.js";
4
+ } from "../../../chunk-kg81mxfa.js";
5
5
  import {
6
6
  selectJsPlugins2
7
- } from "../../../chunk-5cy3qjw4.js";
7
+ } from "../../../chunk-fkpy6323.js";
8
8
  import {
9
9
  reactConfig2
10
10
  } from "../../../chunk-cpyyjvfv.js";
11
11
 
12
12
  // tools/oxlint/config/index.ts
13
13
  import { defineConfig } from "oxlint";
14
- var config_default = defineConfig({
14
+ var config = defineConfig({
15
15
  extends: [
16
16
  coreConfig2,
17
17
  reactConfig2,
@@ -20,7 +20,7 @@ var config_default = defineConfig({
20
20
  ignorePatterns: [...coreConfig2.ignorePatterns ?? []],
21
21
  overrides: [
22
22
  {
23
- files: ["**/server/**"],
23
+ files: ["**/{server,api,backend}/**"],
24
24
  rules: {
25
25
  "react/rules-of-hooks": "off"
26
26
  }
@@ -36,18 +36,9 @@ var config_default = defineConfig({
36
36
  ]
37
37
  }
38
38
  }
39
- ],
40
- rules: {
41
- "anti-slop/require-safety-comment-for-type-assertion": "off",
42
- "anti-slop/no-known-value-widening": "off",
43
- "anti-slop/no-runtime-typeof": "off"
44
- },
45
- settings: {
46
- "react-doctor": {
47
- portedRuleMode: "curated"
48
- }
49
- }
39
+ ]
50
40
  });
41
+ var config_default = config;
51
42
  export {
52
43
  config_default as default
53
44
  };
@@ -0,0 +1,47 @@
1
+ export declare const antiSlopConfig: {
2
+ overrides: {
3
+ files: string[];
4
+ rules: {
5
+ "anti-slop/no-unknown-parameters": "off";
6
+ "anti-slop/no-unsafe-dictionary-type": "off";
7
+ };
8
+ }[];
9
+ rules: {
10
+ /** ── anti-slop ──────────────────────────────────────────────────── */
11
+ "anti-slop/no-chained-type-assertions": "error";
12
+ "anti-slop/no-conditional-empty-object-spread": "error";
13
+ "anti-slop/no-known-value-widening": "error";
14
+ "anti-slop/no-module-mocking": "error";
15
+ "anti-slop/no-object-parameters": "error";
16
+ "anti-slop/no-reflect-apply": "error";
17
+ "anti-slop/no-reflect-get": "error";
18
+ /**
19
+ * allowInTypeGuards exempts `typeof` inside type predicate functions
20
+ * ((x): x is T): predicates are the named-boundary pattern the rule
21
+ * pushes toward, and hand-rolled JSON/boundary validation has no other
22
+ * way to write the check (dmmulroy/anti-slop#10)
23
+ */
24
+ "anti-slop/no-runtime-typeof": ["error", {
25
+ allowInTypeGuards: boolean;
26
+ }];
27
+ "anti-slop/no-shape-in-symbol-names": "error";
28
+ "anti-slop/no-unknown-parameters": "error";
29
+ "anti-slop/no-unknown-returns": "error";
30
+ "anti-slop/no-unknown-type-aliases": "error";
31
+ "anti-slop/no-unsafe-dictionary-type": "error";
32
+ "anti-slop/no-widen-then-assert": "error";
33
+ "anti-slop/require-safety-comment-for-type-assertion": "error";
34
+ /**
35
+ * Core rules that pinch against anti-slop when both are enabled:
36
+ * consistent-indexed-object-style's autofix rewrites index-signature
37
+ * interfaces into `Record` aliases, which no-known-value-widening
38
+ * resolves and re-flags (a fix/break loop)
39
+ *
40
+ * no-immediate-mutation bans the empty-accumulator escape from the same
41
+ * rule. Extending this preset after core turns them off by default
42
+ */
43
+ "typescript/consistent-indexed-object-style": "off";
44
+ "unicorn/no-immediate-mutation": "off";
45
+ };
46
+ };
47
+ export default antiSlopConfig;
@@ -0,0 +1,57 @@
1
+ export declare const githubConfig: {
2
+ overrides: ({
3
+ files: string[];
4
+ rules: {
5
+ /**
6
+ * File-based router names
7
+ * (e.g. `__root.tsx`, `$.tsx`, `posts.$postId.tsx`, `_layout.tsx`, `{-$slug}.tsx`, `+page.ts`)
8
+ * do not match the GitHub kebab-case regex
9
+ */
10
+ "github/filenames-match-regex": "off";
11
+ };
12
+ } | {
13
+ files: string[];
14
+ rules: {
15
+ /**
16
+ * Allow pages-router bracketed route filenames while still rejecting non-route names in `pages/`
17
+ * (e.g. `[slug].astro`, `[...slug].astro`, `[[...slug]].tsx`, `[lang]-[version].astro`
18
+ * and Next.js requires `_app`, `_document` and `_error`)
19
+ */
20
+ "github/filenames-match-regex": ["error", "^_?(?:\\[\\[\\.\\.\\.[a-z0-9-]+\\]\\]|\\[(?:\\.\\.\\.)?[a-z0-9-]+\\]|[a-z0-9-]+)+(?:\\.[a-z0-9-]+)?$"];
21
+ };
22
+ })[];
23
+ rules: {
24
+ /** ── github ───────────────────────────────────────────────────────── */
25
+ "github/a11y-aria-label-is-well-formatted": "error";
26
+ "github/a11y-no-title-attribute": "error";
27
+ "github/a11y-no-visually-hidden-interactive-element": "error";
28
+ "github/a11y-role-supports-aria-props": "error";
29
+ "github/a11y-svg-has-accessible-name": "error";
30
+ "github/array-foreach": "error";
31
+ "github/async-currenttarget": "error";
32
+ "github/async-preventdefault": "error";
33
+ "github/authenticity-token": "error";
34
+ "github/filenames-match-regex": "error";
35
+ "github/get-attribute": "error";
36
+ "github/js-class-name": "error";
37
+ "github/no-blur": "error";
38
+ "github/no-d-none": "error";
39
+ /** Conflicts with unicorn/prefer-dom-node-dataset, which is the benchmark */
40
+ "github/no-dataset": "off";
41
+ "github/no-dynamic-script-tag": "error";
42
+ /**
43
+ * The JS plugin bridge misreads module-scoped declarations (e.g. Astro
44
+ * frontmatter) as implicit globals, producing false positives.
45
+ */
46
+ "github/no-implicit-buggy-globals": "off";
47
+ "github/no-inner-html": "error";
48
+ "github/no-innerText": "error";
49
+ "github/no-then": "error";
50
+ "github/no-useless-passive": "error";
51
+ "github/prefer-observers": "error";
52
+ "github/require-passive-events": "error";
53
+ /** Mirrors the ESLint preset */
54
+ "github/unescaped-html-literal": "off";
55
+ };
56
+ };
57
+ export default githubConfig;