@freehour/eslint-rules 1.0.18 → 10.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.
package/README.md CHANGED
@@ -37,6 +37,8 @@ export default defineConfig(
37
37
  );
38
38
  ```
39
39
 
40
+ **Note:** Tailwind rules require Tailwind CSS 4.3.0 or higher
41
+
40
42
  The ESLint rules are designed to be compatible with the following TypeScript compiler options. Make sure to set them in your `tsconfig.json`:
41
43
 
42
44
  ```jsonc
package/dist/config.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Config } from 'eslint/config';
1
+ import { ConfigObject } from 'eslint/config';
2
2
  export interface ConfigOptions {
3
3
  /**
4
4
  * Enable when targeting Node.js.
@@ -25,5 +25,5 @@ export interface ConfigOptions {
25
25
  */
26
26
  imports?: boolean;
27
27
  }
28
- export declare function createConfig({ node, browser, react, tailwindcss, stylistic, imports, }?: ConfigOptions): Promise<Config>;
28
+ export declare function createConfig({ node, browser, react, tailwindcss, stylistic, imports, }?: ConfigOptions): Promise<ConfigObject>;
29
29
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../lib/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAY5C,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,YAAY,CAAC,EAC/B,IAAY,EACZ,OAAe,EACf,KAAa,EACb,WAAmB,EACnB,SAAiB,EACjB,OAAe,GAClB,GAAE,aAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,CA8oCtC"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../lib/config.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAalD,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAsB,YAAY,CAAC,EAC/B,IAAY,EACZ,OAAe,EACf,KAAa,EACb,WAAmB,EACnB,SAAiB,EACjB,OAAe,GAClB,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC,CA4nC5C"}
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import o from "@stylistic/eslint-plugin";
8
8
  import s from "eslint-plugin-import-x";
9
9
  import c from "eslint-plugin-tailwindcss";
10
10
  import l from "eslint-plugin-simple-import-sort";
11
- //#region lib/config.ts
11
+ // lib/config.ts
12
12
  async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p = !1, stylistic: m = !1, imports: h = !1 } = {}) {
13
13
  return {
14
14
  languageOptions: {
@@ -94,6 +94,7 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
94
94
  "no-sparse-arrays": "error",
95
95
  "no-template-curly-in-string": "warn",
96
96
  "no-this-before-super": "error",
97
+ "no-unassigned-vars": "warn",
97
98
  "no-undef": "error",
98
99
  "no-unexpected-multiline": "error",
99
100
  "no-unmodified-loop-condition": "error",
@@ -110,6 +111,7 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
110
111
  variables: !0,
111
112
  allowNamedExports: !1
112
113
  }],
114
+ "no-useless-assignment": "warn",
113
115
  "no-useless-backreference": "warn",
114
116
  "require-atomic-updates": "warn",
115
117
  "use-isnan": "error",
@@ -269,7 +271,6 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
269
271
  "no-empty-function": "off",
270
272
  "no-implied-eval": "off",
271
273
  "no-invalid-this": "off",
272
- "no-loop-func": "off",
273
274
  "no-magic-numbers": "off",
274
275
  "no-redeclare": "off",
275
276
  "no-restricted-imports": "off",
@@ -328,12 +329,12 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
328
329
  "@typescript-eslint/no-extraneous-class": "warn",
329
330
  "@typescript-eslint/no-floating-promises": "error",
330
331
  "@typescript-eslint/no-for-in-array": "error",
332
+ "@typescript-eslint/no-generated-empty-object-type": "warn",
331
333
  "@typescript-eslint/no-implied-eval": "error",
332
334
  "@typescript-eslint/no-import-type-side-effects": "warn",
333
335
  "@typescript-eslint/no-inferrable-types": "warn",
334
336
  "@typescript-eslint/no-invalid-this": "off",
335
337
  "@typescript-eslint/no-invalid-void-type": "warn",
336
- "@typescript-eslint/no-loop-func": "warn",
337
338
  "@typescript-eslint/no-magic-numbers": "off",
338
339
  "@typescript-eslint/no-meaningless-void-operator": "warn",
339
340
  "@typescript-eslint/no-misused-new": "error",
@@ -364,7 +365,9 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
364
365
  "@typescript-eslint/no-unsafe-argument": "off",
365
366
  "@typescript-eslint/no-unsafe-assignment": "off",
366
367
  "@typescript-eslint/no-unsafe-call": "off",
368
+ "@typescript-eslint/no-unsafe-class-instance-assignment": "error",
367
369
  "@typescript-eslint/no-unsafe-declaration-merging": "error",
370
+ "@typescript-eslint/no-unsafe-enum-assignment": "error",
368
371
  "@typescript-eslint/no-unsafe-enum-comparison": "off",
369
372
  "@typescript-eslint/no-unsafe-function-type": "warn",
370
373
  "@typescript-eslint/no-unsafe-member-access": "off",
@@ -421,9 +424,6 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
421
424
  "@typescript-eslint/unified-signatures": "warn",
422
425
  "@typescript-eslint/use-unknown-in-catch-callback-variable": "off",
423
426
  ...m && {
424
- "@stylistic/array-bracket-newline": "warn",
425
- "@stylistic/array-bracket-spacing": "warn",
426
- "@stylistic/array-element-newline": ["warn", "consistent"],
427
427
  "@stylistic/arrow-parens": ["warn", "as-needed"],
428
428
  "@stylistic/arrow-spacing": "warn",
429
429
  "@stylistic/block-spacing": "warn",
@@ -434,9 +434,7 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
434
434
  "@stylistic/computed-property-spacing": "warn",
435
435
  "@stylistic/dot-location": ["warn", "property"],
436
436
  "@stylistic/eol-last": "warn",
437
- "@stylistic/function-call-argument-newline": ["warn", "consistent"],
438
437
  "@stylistic/function-call-spacing": "warn",
439
- "@stylistic/function-paren-newline": ["warn", "multiline-arguments"],
440
438
  "@stylistic/generator-star-spacing": "warn",
441
439
  "@stylistic/implicit-arrow-linebreak": "warn",
442
440
  "@stylistic/indent": ["warn", 4],
@@ -465,6 +463,8 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
465
463
  "@stylistic/exp-jsx-props-style": ["warn", { singleLine: { maxItems: 1 } }],
466
464
  "@stylistic/jsx-quotes": "warn",
467
465
  "@stylistic/jsx-self-closing-comp": "warn",
466
+ "@stylistic/jsx-shorthand-boolean": "warn",
467
+ "@stylistic/jsx-shorthand-fragment": "warn",
468
468
  "@stylistic/jsx-tag-spacing": "warn",
469
469
  "@stylistic/jsx-wrap-multilines": ["warn", {
470
470
  declaration: "parens-new-line",
@@ -490,7 +490,7 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
490
490
  "always",
491
491
  { exceptAfterSingleLine: !0 }
492
492
  ],
493
- "@stylistic/exp-list-style": "warn",
493
+ "@stylistic/list-style": "warn",
494
494
  "@stylistic/max-len": "off",
495
495
  "@stylistic/max-statements-per-line": "warn",
496
496
  "@stylistic/member-delimiter-style": "warn",
@@ -521,31 +521,11 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
521
521
  "@stylistic/no-trailing-spaces": "warn",
522
522
  "@stylistic/no-whitespace-before-property": "warn",
523
523
  "@stylistic/nonblock-statement-body-position": "off",
524
- "@stylistic/object-curly-newline": ["warn", {
525
- ObjectExpression: {
526
- multiline: !0,
527
- consistent: !0
528
- },
529
- ObjectPattern: {
530
- multiline: !0,
531
- consistent: !0
532
- },
533
- ImportDeclaration: {
534
- multiline: !0,
535
- consistent: !0
536
- },
537
- ExportDeclaration: {
538
- multiline: !0,
539
- consistent: !0
540
- }
541
- }],
542
- "@stylistic/object-curly-spacing": ["warn", "always"],
543
- "@stylistic/object-property-newline": ["warn", { allowAllPropertiesOnSameLine: !0 }],
544
524
  "@stylistic/one-var-declaration-per-line": "warn",
545
525
  "@stylistic/operator-linebreak": [
546
526
  "warn",
547
527
  "before",
548
- { overrides: { "=": "ignore" } }
528
+ { overrides: { "=": "after" } }
549
529
  ],
550
530
  "@stylistic/padded-blocks": "off",
551
531
  "@stylistic/padding-line-between-statements": ["warn", {
@@ -581,6 +561,10 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
581
561
  },
582
562
  ...h && {
583
563
  "no-duplicate-imports": "off",
564
+ "import-x/avoid-barrel-files": "off",
565
+ "import-x/avoid-importing-barrel-files": "off",
566
+ "import-x/avoid-namespace-import": "off",
567
+ "import-x/avoid-re-export-all": "off",
584
568
  "import-x/export": "error",
585
569
  "import-x/no-deprecated": "warn",
586
570
  "import-x/no-empty-named-blocks": "warn",
@@ -644,14 +628,11 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
644
628
  "@stylistic/jsx-curly-spacing": "off",
645
629
  "@stylistic/jsx-equals-spacing": "off",
646
630
  "@stylistic/jsx-first-prop-new-line": "off",
647
- "@stylistic/jsx-indent": "off",
648
631
  "@stylistic/jsx-indent-props": "off",
649
632
  "@stylistic/jsx-max-props-per-line": "off",
650
633
  "@stylistic/jsx-newline": "off",
651
634
  "@stylistic/jsx-one-expression-per-line": "off",
652
635
  "@stylistic/jsx-pascal-case": "off",
653
- "@stylistic/jsx-props-no-multi-spaces": "off",
654
- "@stylistic/jsx-sort-props": "off",
655
636
  "@stylistic/jsx-tag-spacing": "off"
656
637
  },
657
638
  "react/boolean-prop-naming": "off",
@@ -794,12 +775,17 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
794
775
  "react-hooks/unsupported-syntax": "warn",
795
776
  "react-hooks/use-memo": "off",
796
777
  "react-hooks/incompatible-library": "warn",
797
- "react-refresh/only-export-components": ["warn", { allowConstantExport: !0 }]
778
+ "react-refresh/only-export-components": ["warn", {
779
+ allowConstantExport: !0,
780
+ allowCompoundComponents: !0
781
+ }]
798
782
  },
799
783
  ...p && {
800
784
  "tailwindcss/classnames-order": "warn",
785
+ "tailwindcss/enforces-canonical-classname": "warn",
801
786
  "tailwindcss/enforces-negative-arbitrary-values": "warn",
802
787
  "tailwindcss/enforces-shorthand": "warn",
788
+ "tailwindcss/important-modifier-suffix": "warn",
803
789
  "tailwindcss/migration-from-tailwind-2": "off",
804
790
  "tailwindcss/no-arbitrary-value": "off",
805
791
  "tailwindcss/no-custom-classname": "warn",
@@ -825,5 +811,4 @@ async function u({ node: u = !1, browser: d = !1, react: f = !1, tailwindcss: p
825
811
  }
826
812
  };
827
813
  }
828
- //#endregion
829
814
  export { u as createConfig };
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "private": false,
4
4
  "displayName": "eslint-rules",
5
5
  "description": "ESLint rules for TypeScript projects.",
6
- "version": "1.0.18",
6
+ "version": "10.0.0",
7
7
  "type": "module",
8
8
  "repository": {
9
9
  "type": "git",
@@ -22,27 +22,27 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@stylistic/eslint-plugin": "5.10.0",
26
- "eslint-import-resolver-typescript": "^4.4.4",
27
- "eslint-plugin-import-x": "4.16.2",
25
+ "@stylistic/eslint-plugin": "6.0.1",
26
+ "eslint-import-resolver-typescript": "^4.4.5",
27
+ "eslint-plugin-import-x": "4.18.1",
28
28
  "eslint-plugin-react": "7.37.5",
29
- "eslint-plugin-react-hooks": "7.0.1",
30
- "eslint-plugin-react-refresh": "0.5.2",
31
- "eslint-plugin-simple-import-sort": "12.1.1",
32
- "eslint-plugin-tailwindcss": "4.0.0-beta.0",
33
- "typescript-eslint": "8.58.0"
29
+ "eslint-plugin-react-hooks": "7.1.1",
30
+ "eslint-plugin-react-refresh": "0.5.8",
31
+ "eslint-plugin-simple-import-sort": "14.0.0",
32
+ "eslint-plugin-tailwindcss": "4.4.0",
33
+ "typescript-eslint": "8.73.0"
34
34
  },
35
35
  "peerDependencies": {
36
- "eslint": "9.39.4",
36
+ "eslint": "10.15.0",
37
37
  "typescript": "^6.0.0"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/eslint-plugin-tailwindcss": "^3.17.0",
41
- "ajv": "^8.18.0",
42
- "bun-types": "^1.3.11",
43
- "eslint": "9.39.4",
44
- "typescript": "^6.0.0",
45
- "vite": "^8.0.3",
41
+ "ajv": "^8.20.0",
42
+ "bun-types": "^1.4.4",
43
+ "eslint": "10.15.0",
44
+ "typescript": "^6.0.3",
45
+ "vite": "^8.3.8",
46
46
  "vite-plugin-dts": "^4.5.4"
47
47
  },
48
48
  "trustedDependencies": [