@indigo-reemploi/eslint-config-client 0.2.0 → 1.0.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.
Files changed (3) hide show
  1. package/README.md +53 -2
  2. package/package.json +11 -11
  3. package/src/eslint.mjs +17 -6
package/README.md CHANGED
@@ -11,17 +11,28 @@ yarn add @indigo-reemploi/eslint-config-client
11
11
  import { eslint } from "@indigo-reemploi/eslint-config-client";
12
12
 
13
13
  export default [
14
- ...eslint
14
+ ...eslint,
15
+ "settings": {
16
+ "better-tailwindcss": {
17
+ // tailwindcss 4: the path to the entry file of the css based tailwind config (eg: `src/global.css`)
18
+ "entryPoint": "src/core/theme/tailwind.css",
19
+ // tailwindcss 3: the path to the tailwind config file (eg: `tailwind.config.js`)
20
+ "tailwindConfig": "tailwind.config.js"
21
+ }
22
+ }
15
23
  ];
16
24
  ```
17
25
 
18
26
  And for prettier
27
+
19
28
  ```javascript
20
29
  // prettier.config.mjs
21
30
  import { prettier } from "@indigo-reemploi/eslint-config-client";
22
31
 
23
32
  export default {
24
- ...prettier
33
+ ...prettier,
34
+ // tailwindcss 4: the path to the entry file
35
+ tailwindStylesheet: 'src/core/theme/tailwind.css',
25
36
  };
26
37
  ```
27
38
 
@@ -33,4 +44,44 @@ A chaque changement, aller dans le repo dans lequel on veut tester la config (pa
33
44
  # dans circular-client
34
45
  yarn add ../eslint-config-client
35
46
  yarn run lint:fix
47
+ ```
48
+
49
+
50
+ # Upgrade guide
51
+ ## From V0 to V1
52
+
53
+ This upgrade works with Tailwind V3 and V4.
54
+
55
+ On client:
56
+
57
+ ```javascript
58
+ // eslint.config.mjs
59
+ import { eslint } from "@indigo-reemploi/eslint-config-client";
60
+
61
+ export default [
62
+ ...eslint,
63
+ {
64
+ settings: {
65
+ "better-tailwindcss": {
66
+ // Tailwind CSS 4: the path to the entry file of the CSS-based Tailwind config (e.g.: `src/global.css`)
67
+ entryPoint: "src/core/theme/tailwind.css",
68
+ // Tailwind CSS 3: the path to the Tailwind config file (e.g.: `tailwind.config.js`)
69
+ tailwindConfig: "tailwind.config.js"
70
+ }
71
+ }
72
+ }
73
+ ];
74
+ ```
75
+
76
+ And:
77
+
78
+ ```javascript
79
+ // prettier.config.mjs
80
+ import { prettier } from "@indigo-reemploi/eslint-config-client";
81
+
82
+ export default {
83
+ ...prettier,
84
+ // Tailwind CSS 4: the path to the entry file
85
+ tailwindStylesheet: 'src/core/theme/tailwind.css',
86
+ };
36
87
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigo-reemploi/eslint-config-client",
3
- "version": "0.2.0",
3
+ "version": "1.0.1",
4
4
  "description": "Shared eslint config for Client",
5
5
  "main": "./src/index.mjs",
6
6
  "files": [
@@ -8,28 +8,28 @@
8
8
  ],
9
9
  "author": "Antoine Torrini",
10
10
  "license": "MIT",
11
- "packageManager": "yarn@4.10.3",
11
+ "packageManager": "yarn@4.12.0",
12
12
  "dependencies": {
13
- "@eslint/compat": "1.4.1",
14
- "@eslint/js": "9.39.0",
13
+ "@eslint/compat": "2.0.0",
14
+ "@eslint/js": "9.39.1",
15
15
  "@types/eslint__js": "9.14.0",
16
- "@typescript-eslint/parser": "8.46.2",
16
+ "@typescript-eslint/parser": "8.49.0",
17
17
  "eslint-config-prettier": "10.1.8",
18
+ "eslint-plugin-better-tailwindcss": "^3.7.10",
18
19
  "eslint-plugin-import": "2.32.0",
19
- "eslint-plugin-jest": "29.0.1",
20
+ "eslint-plugin-jest": "29.2.1",
20
21
  "eslint-plugin-jsx-a11y": "6.10.2",
21
22
  "eslint-plugin-prettier": "5.5.4",
22
23
  "eslint-plugin-react": "7.37.5",
23
24
  "eslint-plugin-simple-import-sort": "12.1.1",
24
- "eslint-plugin-tailwindcss": "3.18.2",
25
25
  "eslint-plugin-unused-imports": "4.3.0",
26
- "prettier-plugin-tailwindcss": "0.7.1",
27
- "typescript-eslint": "8.46.2"
26
+ "prettier-plugin-tailwindcss": "0.7.2",
27
+ "typescript-eslint": "8.49.0"
28
28
  },
29
29
  "peerDependencies": {
30
- "eslint": "9.39.0",
30
+ "eslint": "9.39.1",
31
31
  "jest": "^29.7.0 || ^30.0.0",
32
- "prettier": "3.6.2",
32
+ "prettier": "3.7.4",
33
33
  "typescript": "^5.8.3"
34
34
  }
35
35
  }
package/src/eslint.mjs CHANGED
@@ -5,16 +5,15 @@ import jsxA11y from "eslint-plugin-jsx-a11y";
5
5
  import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
6
6
  import react from "eslint-plugin-react";
7
7
  import simpleImportSort from "eslint-plugin-simple-import-sort";
8
- import tailwind from "eslint-plugin-tailwindcss";
9
8
  import unusedImports from "eslint-plugin-unused-imports";
10
9
  import tseslint from "typescript-eslint";
10
+ import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
11
11
 
12
12
  import importRules from "./rules/import.mjs";
13
13
 
14
14
  export default tseslint.config(
15
15
  eslint.configs.recommended,
16
16
  ...tseslint.configs.recommended,
17
- ...tailwind.configs["flat/recommended"],
18
17
  jest.configs["flat/recommended"],
19
18
  jsxA11y.flatConfigs.recommended,
20
19
  react.configs.flat.recommended,
@@ -79,17 +78,29 @@ export default tseslint.config(
79
78
  },
80
79
  },
81
80
  importRules,
81
+ {
82
+ plugins: {
83
+ "better-tailwindcss": eslintPluginBetterTailwindcss,
84
+ },
85
+ rules: {
86
+ ...eslintPluginBetterTailwindcss.configs["recommended-error"].rules,
87
+ "better-tailwindcss/enforce-consistent-line-wrapping": "off", // Conflict with prettier
88
+ "better-tailwindcss/enforce-consistent-class-order": [
89
+ "error",
90
+ { order: "official" },
91
+ ],
92
+ "better-tailwindcss/no-unregistered-classes": "off",
93
+ },
94
+ },
82
95
  {
83
96
  rules: {
84
- // our custom rules
85
97
  "jest/expect-expect": "off",
86
- "tailwindcss/no-custom-classname": "off",
87
98
  "react/prop-types": "off",
88
- "@typescript-eslint/no-empty-object-type": "off"
99
+ "@typescript-eslint/no-empty-object-type": "off",
89
100
  },
90
101
  },
91
102
  eslintPluginPrettierRecommended,
92
103
  {
93
104
  ignores: ["**/*.stories.*"],
94
- },
105
+ }
95
106
  );