@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 +17 -17
- package/readme.md +5 -4
- package/src/dprint.js +1 -0
- package/src/index.js +1 -0
- package/src/next.js +4 -18
- package/src/react.js +3 -2
- package/src/tailwind.js +13 -13
- package/src/xo.js +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tommy-mitchell/eslint-config-xo",
|
|
3
|
-
"version": "1.0.0
|
|
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
|
|
32
|
-
"
|
|
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.
|
|
35
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
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": "^
|
|
43
|
-
"@tommy-mitchell/dprint-config": "
|
|
44
|
-
"ava": "^6.
|
|
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.
|
|
47
|
-
"execa": "^9.
|
|
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": "
|
|
49
|
+
"xo": "~1.2.3"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"dprint": "0.x",
|
|
53
53
|
"react": "19.x",
|
|
54
|
-
"tailwindcss": "
|
|
55
|
-
"xo": "
|
|
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": "
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
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
|
-
|
|
5
|
-
baseDirectory: import.meta.dirname,
|
|
6
|
-
});
|
|
7
|
-
|
|
4
|
+
/** @type {import('xo').FlatXoConfig} */
|
|
8
5
|
export default [
|
|
9
|
-
|
|
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
|
|
2
|
-
import tailwind from "eslint-plugin-tailwindcss";
|
|
1
|
+
import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
/** @type {import('xo').FlatXoConfig} */
|
|
4
|
+
export default [{
|
|
5
5
|
plugins: {
|
|
6
|
-
"
|
|
6
|
+
"better-tailwindcss": eslintPluginBetterTailwindcss,
|
|
7
7
|
},
|
|
8
8
|
rules: {
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
"
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
"tailwindcss
|
|
20
|
-
callees: ["
|
|
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
|
}];
|