@tommy-mitchell/eslint-config-xo 2.0.0-beta.0 → 2.0.0-beta.2
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 +3 -2
- package/src/dprint.js +1 -2
- package/src/index.d.ts +1 -1
- package/src/react.js +17 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tommy-mitchell/eslint-config-xo",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"description": "Personal config for XO.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nodejs",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"test": "ava"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"@eslint-react/eslint-plugin": "^3.0.0",
|
|
31
32
|
"@next/eslint-plugin-next": "^16.0.5",
|
|
32
33
|
"eslint-plugin-better-tailwindcss": "^4.3.2",
|
|
33
34
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
@@ -41,11 +42,11 @@
|
|
|
41
42
|
"@tommy-mitchell/dprint-config": "0.6.0",
|
|
42
43
|
"ava": "^7.0.0",
|
|
43
44
|
"dprint": "0.x",
|
|
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
|
+
"typescript": "6.0.2",
|
|
49
50
|
"xo": "~2.0.2"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
package/src/dprint.js
CHANGED
|
@@ -5,12 +5,11 @@ const allowedReactRules = new Set([
|
|
|
5
5
|
"jsx-newline",
|
|
6
6
|
"jsx-pascal-case",
|
|
7
7
|
"jsx-self-closing-comp",
|
|
8
|
-
"jsx-sort-props",
|
|
9
8
|
]);
|
|
10
9
|
|
|
11
10
|
const disabledLegacyRules = Object.fromEntries(
|
|
12
11
|
Object.entries(stylistic.configs["disable-legacy"].rules)
|
|
13
|
-
.filter(([rule]) => !allowedReactRules.has(rule.replace("
|
|
12
|
+
.filter(([rule]) => !allowedReactRules.has(rule.replace("@stylistic/", ""))),
|
|
14
13
|
);
|
|
15
14
|
|
|
16
15
|
const allowedRules = new Set([
|
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:
|
|
5
|
+
export declare const react: FlatXoConfig;
|
|
6
6
|
export declare const tailwind: ({ config }: { config: string; }) => FlatXoConfig;
|
|
7
7
|
export declare const xo: FlatXoConfig;
|
package/src/react.js
CHANGED
|
@@ -1,28 +1,30 @@
|
|
|
1
|
+
import eslintReact from "@eslint-react/eslint-plugin";
|
|
1
2
|
import jsxA11y from "eslint-plugin-jsx-a11y";
|
|
2
|
-
import react from "eslint-plugin-react";
|
|
3
3
|
import { reactRefresh } from "eslint-plugin-react-refresh";
|
|
4
4
|
import sortReactDependencyArrays from "eslint-plugin-sort-react-dependency-arrays";
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
6
|
+
/** @type {import('xo').FlatXoConfig} */
|
|
7
|
+
export default [jsxA11y.flatConfigs.recommended, {
|
|
8
|
+
...eslintReact.configs.strict,
|
|
9
|
+
files: "**/*.{jsx}",
|
|
10
|
+
}, {
|
|
11
|
+
...eslintReact.configs["strict-type-checked"],
|
|
12
|
+
files: "**/*.{tsx}",
|
|
13
|
+
}, {
|
|
13
14
|
plugins: {
|
|
14
15
|
"react-refresh": reactRefresh.plugin,
|
|
15
16
|
"sort-react-dependency-arrays": sortReactDependencyArrays,
|
|
16
17
|
},
|
|
18
|
+
// TODO: boolean-prop-naming
|
|
17
19
|
rules: {
|
|
18
|
-
"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
"perfectionist/sort-jsx-props": ["error", {
|
|
21
|
+
customGroups: [
|
|
22
|
+
{ elementNamePattern: "^on[A-Z].*", groupName: "callback" },
|
|
23
|
+
{ elementNamePattern: "^(children|dangerouslySetInnerHTML|key|ref)$", groupName: "reserved" },
|
|
24
|
+
],
|
|
25
|
+
groups: ["reserved", "shorthand-prop", "unknown", "callback"],
|
|
24
26
|
}],
|
|
25
|
-
"react/
|
|
27
|
+
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
|
26
28
|
"simple-import-sort/imports": ["error", {
|
|
27
29
|
groups: [[
|
|
28
30
|
String.raw`^\u0000`,
|
|
@@ -43,9 +45,6 @@ export default ({ version = "detect" } = {}) => [{ react: true, settings: { reac
|
|
|
43
45
|
pascalCase: true,
|
|
44
46
|
},
|
|
45
47
|
}],
|
|
46
|
-
...version === "19" && {
|
|
47
|
-
"react/forward-ref-uses-ref": "off",
|
|
48
|
-
},
|
|
49
48
|
},
|
|
50
49
|
}, {
|
|
51
50
|
files: ["src/constants/**/*.{ts,cts,mts,tsx}", "**/constants.{ts,cts,mts,tsx}"],
|