@tommy-mitchell/eslint-config-xo 1.0.0 → 2.0.0-beta.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 +8 -8
- package/readme.md +10 -2
- package/src/index.d.ts +2 -2
- package/src/next.js +1 -1
- package/src/react.js +9 -6
- package/src/tailwind.js +3 -4
- package/src/xo.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tommy-mitchell/eslint-config-xo",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
4
|
"description": "Personal config for XO.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nodejs",
|
|
@@ -29,30 +29,30 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@next/eslint-plugin-next": "^16.0.5",
|
|
32
|
-
"eslint-plugin-better-tailwindcss": "^3.
|
|
32
|
+
"eslint-plugin-better-tailwindcss": "^4.3.2",
|
|
33
33
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
34
|
-
"eslint-plugin-perfectionist": "^
|
|
35
|
-
"eslint-plugin-react-refresh": "^0.
|
|
34
|
+
"eslint-plugin-perfectionist": "^5.7.0",
|
|
35
|
+
"eslint-plugin-react-refresh": "^0.5.2",
|
|
36
36
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
37
37
|
"eslint-plugin-sort-react-dependency-arrays": "^1.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@stylistic/eslint-plugin": "^5.6.1",
|
|
41
41
|
"@tommy-mitchell/dprint-config": "0.6.0",
|
|
42
|
-
"ava": "^
|
|
42
|
+
"ava": "^7.0.0",
|
|
43
43
|
"dprint": "0.x",
|
|
44
44
|
"eslint-plugin-react": "^7.37.5",
|
|
45
45
|
"execa": "^9.6.0",
|
|
46
46
|
"react": "^19.2.0",
|
|
47
47
|
"tailwindcss": "^4.1.17",
|
|
48
48
|
"tempy": "^3.1.0",
|
|
49
|
-
"xo": "~
|
|
49
|
+
"xo": "~2.0.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"dprint": "0.x",
|
|
53
53
|
"react": "19.x",
|
|
54
54
|
"tailwindcss": "4.x",
|
|
55
|
-
"xo": "
|
|
55
|
+
"xo": "2.x"
|
|
56
56
|
},
|
|
57
57
|
"peerDependenciesMeta": {
|
|
58
58
|
"dprint": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
"engines": {
|
|
69
|
-
"node": ">=
|
|
69
|
+
"node": ">=22"
|
|
70
70
|
},
|
|
71
71
|
"ava": {
|
|
72
72
|
"timeout": "30s"
|
package/readme.md
CHANGED
|
@@ -16,6 +16,10 @@ npm install --save-dev @tommy-mitchell/eslint-config-xo xo
|
|
|
16
16
|
yarn add --dev @tommy-mitchell/eslint-config-xo xo
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
+
```sh
|
|
20
|
+
pnpm add --save-dev @tommy-mitchell/eslint-config-xo xo
|
|
21
|
+
```
|
|
22
|
+
|
|
19
23
|
</p>
|
|
20
24
|
</details>
|
|
21
25
|
|
|
@@ -31,6 +35,10 @@ npm install --save-dev @tommy-mitchell/eslint-config-xo xo @tommy-mitchell/dprin
|
|
|
31
35
|
yarn add --dev @tommy-mitchell/eslint-config-xo xo @tommy-mitchell/dprint-config dprint
|
|
32
36
|
```
|
|
33
37
|
|
|
38
|
+
```sh
|
|
39
|
+
pnpm add --save-dev @tommy-mitchell/eslint-config-xo xo @tommy-mitchell/dprint-config dprint
|
|
40
|
+
```
|
|
41
|
+
|
|
34
42
|
</p>
|
|
35
43
|
</details>
|
|
36
44
|
|
|
@@ -50,9 +58,9 @@ import * as configs from "@tommy-mitchell/eslint-config-xo";
|
|
|
50
58
|
/** @type {import('xo').FlatXoConfig} */
|
|
51
59
|
export default [
|
|
52
60
|
...configs.xo,
|
|
53
|
-
...configs.react, // If using React
|
|
61
|
+
...configs.react({ version: "19" }), // If using React
|
|
54
62
|
...configs.next, // If using Next.js
|
|
55
|
-
...configs.tailwind, // If using
|
|
63
|
+
...configs.tailwind({ config: "src/tailwind.css" }), // If using TailwindCSS
|
|
56
64
|
...configs.dprint, // If using dprint (must be last to override stylistic rules)
|
|
57
65
|
// Plus any overrides
|
|
58
66
|
]
|
package/src/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ import type { FlatXoConfig } from "xo";
|
|
|
2
2
|
|
|
3
3
|
export declare const dprint: FlatXoConfig;
|
|
4
4
|
export declare const next: FlatXoConfig;
|
|
5
|
-
export declare const react: FlatXoConfig;
|
|
6
|
-
export declare const tailwind: FlatXoConfig;
|
|
5
|
+
export declare const react: (options?: { version?: string; }) => FlatXoConfig;
|
|
6
|
+
export declare const tailwind: ({ config }: { config: string; }) => FlatXoConfig;
|
|
7
7
|
export declare const xo: FlatXoConfig;
|
package/src/next.js
CHANGED
package/src/react.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
2
2
|
import react from "eslint-plugin-react";
|
|
3
|
-
import reactRefresh from "eslint-plugin-react-refresh";
|
|
3
|
+
import { reactRefresh } from "eslint-plugin-react-refresh";
|
|
4
4
|
import sortReactDependencyArrays from "eslint-plugin-sort-react-dependency-arrays";
|
|
5
5
|
|
|
6
6
|
const configs = [
|
|
@@ -8,10 +8,10 @@ const configs = [
|
|
|
8
8
|
jsxA11y.flatConfigs.recommended,
|
|
9
9
|
];
|
|
10
10
|
|
|
11
|
-
/** @type {import('xo').FlatXoConfig} */
|
|
12
|
-
export default [{ react: true }, ...configs, {
|
|
11
|
+
/** @type {(options?: {version?: string}) => import('xo').FlatXoConfig} */
|
|
12
|
+
export default ({ version = "detect" } = {}) => [{ react: true, settings: { react: { version } } }, ...configs, {
|
|
13
13
|
plugins: {
|
|
14
|
-
"react-refresh": reactRefresh,
|
|
14
|
+
"react-refresh": reactRefresh.plugin,
|
|
15
15
|
"sort-react-dependency-arrays": sortReactDependencyArrays,
|
|
16
16
|
},
|
|
17
17
|
rules: {
|
|
@@ -43,6 +43,9 @@ export default [{ react: true }, ...configs, {
|
|
|
43
43
|
pascalCase: true,
|
|
44
44
|
},
|
|
45
45
|
}],
|
|
46
|
+
...version === "19" && {
|
|
47
|
+
"react/forward-ref-uses-ref": "off",
|
|
48
|
+
},
|
|
46
49
|
},
|
|
47
50
|
}, {
|
|
48
51
|
files: ["src/constants/**/*.{ts,cts,mts,tsx}", "**/constants.{ts,cts,mts,tsx}"],
|
|
@@ -53,11 +56,11 @@ export default [{ react: true }, ...configs, {
|
|
|
53
56
|
files: "**/*.{ts,cts,mts,tsx}",
|
|
54
57
|
rules: {
|
|
55
58
|
"perfectionist/sort-interfaces": ["error", {
|
|
56
|
-
customGroups: {
|
|
59
|
+
customGroups: [{ elementNamePattern: "^on[A-Z].*", groupName: "callback" }],
|
|
57
60
|
groups: ["unknown", "callback"],
|
|
58
61
|
}],
|
|
59
62
|
"perfectionist/sort-object-types": ["error", {
|
|
60
|
-
customGroups: {
|
|
63
|
+
customGroups: [{ elementNamePattern: "^on[A-Z].*", groupName: "callback" }],
|
|
61
64
|
groups: ["unknown", "callback"],
|
|
62
65
|
}],
|
|
63
66
|
},
|
package/src/tailwind.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import eslintPluginBetterTailwindcss from "eslint-plugin-better-tailwindcss";
|
|
2
2
|
|
|
3
|
-
/** @type {import('xo').FlatXoConfig} */
|
|
4
|
-
export default [{
|
|
3
|
+
/** @type {({config}: {config: string}) => import('xo').FlatXoConfig} */
|
|
4
|
+
export default ({ config }) => [{
|
|
5
5
|
plugins: {
|
|
6
6
|
"better-tailwindcss": eslintPluginBetterTailwindcss,
|
|
7
7
|
},
|
|
@@ -12,12 +12,11 @@ export default [{
|
|
|
12
12
|
preferSingleLine: true,
|
|
13
13
|
printWidth: 120,
|
|
14
14
|
}],
|
|
15
|
-
"better-tailwindcss/enforce-shorthand-classes": "warn",
|
|
16
|
-
"better-tailwindcss/no-deprecated-classes": "warn",
|
|
17
15
|
},
|
|
18
16
|
settings: {
|
|
19
17
|
"better-tailwindcss": {
|
|
20
18
|
callees: ["clsx", "cn", "cnx", "cva", "cx", "tv", "twJoin", "twMerge"],
|
|
19
|
+
entryPoint: config, // v4 config path
|
|
21
20
|
},
|
|
22
21
|
},
|
|
23
22
|
}];
|
package/src/xo.js
CHANGED
|
@@ -42,7 +42,7 @@ export default [{
|
|
|
42
42
|
"@typescript-eslint/no-confusing-void-expression": ["error", { ignoreArrowShorthand: true }],
|
|
43
43
|
// https://github.com/xojs/eslint-config-xo-typescript/blob/v2.0.0/index.js#L707
|
|
44
44
|
"@typescript-eslint/prefer-regexp-exec": "off",
|
|
45
|
-
"perfectionist/sort-enums":
|
|
45
|
+
"perfectionist/sort-enums": "error",
|
|
46
46
|
"perfectionist/sort-heritage-clauses": "error",
|
|
47
47
|
"perfectionist/sort-interfaces": "error",
|
|
48
48
|
"perfectionist/sort-intersection-types": "error",
|