@tommy-mitchell/eslint-config-xo 1.0.0-4 → 1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tommy-mitchell/eslint-config-xo",
3
- "version": "1.0.0-4",
3
+ "version": "1.0.0",
4
4
  "description": "Personal config for XO.",
5
5
  "keywords": [
6
6
  "nodejs",
@@ -28,31 +28,31 @@
28
28
  "test": "ava"
29
29
  },
30
30
  "dependencies": {
31
- "@eslint/eslintrc": "^3.2.0",
32
- "@next/eslint-plugin-next": "^15.1.6",
31
+ "@next/eslint-plugin-next": "^16.0.5",
32
+ "eslint-plugin-better-tailwindcss": "^3.7.11",
33
33
  "eslint-plugin-jsx-a11y": "^6.10.2",
34
- "eslint-plugin-perfectionist": "^4.8.0",
35
- "eslint-plugin-react-refresh": "^0.4.19",
36
- "eslint-plugin-readable-tailwind": "^1.9.0",
34
+ "eslint-plugin-perfectionist": "^4.15.1",
35
+ "eslint-plugin-react-refresh": "^0.4.24",
37
36
  "eslint-plugin-simple-import-sort": "^12.1.1",
38
- "eslint-plugin-sort-react-dependency-arrays": "^1.0.0",
39
- "eslint-plugin-tailwindcss": "^3.18.0"
37
+ "eslint-plugin-sort-react-dependency-arrays": "^1.0.0"
40
38
  },
41
39
  "devDependencies": {
42
- "@stylistic/eslint-plugin": "^3.0.1",
43
- "@tommy-mitchell/dprint-config": "^0.4.0",
44
- "ava": "^6.2.0",
40
+ "@stylistic/eslint-plugin": "^5.6.1",
41
+ "@tommy-mitchell/dprint-config": "0.6.0",
42
+ "ava": "^6.4.1",
45
43
  "dprint": "0.x",
46
- "eslint-plugin-react": "^7.37.4",
47
- "execa": "^9.5.2",
44
+ "eslint-plugin-react": "^7.37.5",
45
+ "execa": "^9.6.0",
46
+ "react": "^19.2.0",
47
+ "tailwindcss": "^4.1.17",
48
48
  "tempy": "^3.1.0",
49
- "xo": "npm:@spence-s/flat-xo@latest"
49
+ "xo": "~1.2.3"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "dprint": "0.x",
53
53
  "react": "19.x",
54
- "tailwindcss": "3.x",
55
- "xo": "0.x"
54
+ "tailwindcss": "4.x",
55
+ "xo": "1.x"
56
56
  },
57
57
  "peerDependenciesMeta": {
58
58
  "dprint": {
@@ -66,7 +66,7 @@
66
66
  }
67
67
  },
68
68
  "engines": {
69
- "node": "^18.20 || ^20.10 || >=21"
69
+ "node": ">=20.17"
70
70
  },
71
71
  "ava": {
72
72
  "timeout": "30s"
package/readme.md CHANGED
@@ -5,7 +5,7 @@ Personal config for [`XO`](https://github.com/xojs/xo). Recommended to be used w
5
5
  ## Install
6
6
 
7
7
  ```sh
8
- npm install --save-dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest
8
+ npm install --save-dev @tommy-mitchell/eslint-config-xo xo
9
9
  ```
10
10
 
11
11
  <details>
@@ -13,7 +13,7 @@ npm install --save-dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/fl
13
13
  <p>
14
14
 
15
15
  ```sh
16
- yarn add --dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest
16
+ yarn add --dev @tommy-mitchell/eslint-config-xo xo
17
17
  ```
18
18
 
19
19
  </p>
@@ -24,11 +24,11 @@ yarn add --dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@la
24
24
  <p>
25
25
 
26
26
  ```sh
27
- npm install --save-dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest @tommy-mitchell/dprint-config dprint
27
+ npm install --save-dev @tommy-mitchell/eslint-config-xo xo @tommy-mitchell/dprint-config dprint
28
28
  ```
29
29
 
30
30
  ```sh
31
- yarn add --dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest @tommy-mitchell/dprint-config dprint
31
+ yarn add --dev @tommy-mitchell/eslint-config-xo xo @tommy-mitchell/dprint-config dprint
32
32
  ```
33
33
 
34
34
  </p>
@@ -47,6 +47,7 @@ yarn add --dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@la
47
47
  // xo.config.js
48
48
  import * as configs from "@tommy-mitchell/eslint-config-xo";
49
49
 
50
+ /** @type {import('xo').FlatXoConfig} */
50
51
  export default [
51
52
  ...configs.xo,
52
53
  ...configs.react, // If using React
package/src/dprint.js CHANGED
@@ -28,6 +28,7 @@ const disabledRules = Object.fromEntries(
28
28
  .map(rule => [`@stylistic/${rule}`, "off"]),
29
29
  );
30
30
 
31
+ /** @type {import('xo').FlatXoConfig} */
31
32
  export default [
32
33
  {
33
34
  rules: {
package/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as dprint } from "./dprint.js";
2
2
  export { default as next } from "./next.js";
3
3
  export { default as react } from "./react.js";
4
+ // TODO: only load if tailwind is installed
4
5
  export { default as tailwind } from "./tailwind.js";
5
6
  export { default as xo } from "./xo.js";
package/src/next.js CHANGED
@@ -1,22 +1,8 @@
1
- import { FlatCompat } from "@eslint/eslintrc";
2
1
  import next from "@next/eslint-plugin-next";
2
+ import reactRefresh from "eslint-plugin-react-refresh";
3
3
 
4
- const compat = new FlatCompat({
5
- baseDirectory: import.meta.dirname,
6
- });
7
-
4
+ /** @type {import('xo').FlatXoConfig} */
8
5
  export default [
9
- ...compat.config(next.configs["core-web-vitals"]),
10
- {
11
- files: "**/{layout,page}.{jsx,tsx}",
12
- rules: {
13
- "react-refresh/only-export-components": ["warn", {
14
- allowConstantExport: true,
15
- allowExportNames: [
16
- "metadata",
17
- "generateMetadata",
18
- ],
19
- }],
20
- },
21
- },
6
+ next.configs["core-web-vitals"],
7
+ reactRefresh.configs.next,
22
8
  ];
package/src/react.js CHANGED
@@ -8,6 +8,7 @@ const configs = [
8
8
  jsxA11y.flatConfigs.recommended,
9
9
  ];
10
10
 
11
+ /** @type {import('xo').FlatXoConfig} */
11
12
  export default [{ react: true }, ...configs, {
12
13
  plugins: {
13
14
  "react-refresh": reactRefresh,
@@ -52,11 +53,11 @@ export default [{ react: true }, ...configs, {
52
53
  files: "**/*.{ts,cts,mts,tsx}",
53
54
  rules: {
54
55
  "perfectionist/sort-interfaces": ["error", {
55
- customGroups: { callback: "on*" },
56
+ customGroups: { callback: "^on[A-Z].*" },
56
57
  groups: ["unknown", "callback"],
57
58
  }],
58
59
  "perfectionist/sort-object-types": ["error", {
59
- customGroups: { callback: "on*" },
60
+ customGroups: { callback: "^on[A-Z].*" },
60
61
  groups: ["unknown", "callback"],
61
62
  }],
62
63
  },
package/src/tailwind.js CHANGED
@@ -1,23 +1,23 @@
1
- import eslintPluginReadableTailwind from "eslint-plugin-readable-tailwind";
2
- import tailwind from "eslint-plugin-tailwindcss";
1
+ import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
3
2
 
4
- export default [...tailwind.configs["flat/recommended"], {
3
+ /** @type {import('xo').FlatXoConfig} */
4
+ export default [{
5
5
  plugins: {
6
- "readable-tailwind": eslintPluginReadableTailwind,
6
+ "better-tailwindcss": eslintPluginBetterTailwindcss,
7
7
  },
8
8
  rules: {
9
- "readable-tailwind/multiline": ["warn", {
10
- group: "newLine",
9
+ ...eslintPluginBetterTailwindcss.configs.recommended.rules,
10
+ "better-tailwindcss/enforce-consistent-line-wrapping": ["warn", {
11
11
  indent: "tab",
12
12
  preferSingleLine: true,
13
13
  printWidth: 120,
14
14
  }],
15
- "readable-tailwind/no-duplicate-classes": "warn",
16
- "readable-tailwind/no-unnecessary-whitespace": "warn",
17
- "readable-tailwind/sort-classes": "warn",
18
- "tailwindcss/classnames-order": "off",
19
- "tailwindcss/no-custom-classname": ["warn", {
20
- callees: ["classnames", "clsx", "ctl", "cva", "tv", "tva", "tw", "twMerge", "cn", "cnx"],
21
- }],
15
+ "better-tailwindcss/enforce-shorthand-classes": "warn",
16
+ "better-tailwindcss/no-deprecated-classes": "warn",
17
+ },
18
+ settings: {
19
+ "better-tailwindcss": {
20
+ callees: ["clsx", "cn", "cnx", "cva", "cx", "tv", "twJoin", "twMerge"],
21
+ },
22
22
  },
23
23
  }];
package/src/xo.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import perfectionist from "eslint-plugin-perfectionist";
2
2
  import simpleImportSort from "eslint-plugin-simple-import-sort";
3
3
 
4
+ /** @type {import('xo').FlatXoConfig} */
4
5
  export default [{
5
6
  plugins: {
6
7
  perfectionist,