@tommy-mitchell/eslint-config-xo 1.0.0-0 → 1.0.0-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 +5 -3
- package/readme.md +6 -5
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/next.js +22 -0
- package/src/tailwind.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-2",
|
|
4
4
|
"description": "Personal config for XO.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nodejs",
|
|
@@ -28,9 +28,11 @@
|
|
|
28
28
|
"test": "ava"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
32
|
+
"@next/eslint-plugin-next": "^15.1.6",
|
|
31
33
|
"eslint-plugin-jsx-a11y": "^6.10.2",
|
|
32
|
-
"eslint-plugin-perfectionist": "^4.
|
|
33
|
-
"eslint-plugin-react-refresh": "^0.4.
|
|
34
|
+
"eslint-plugin-perfectionist": "^4.8.0",
|
|
35
|
+
"eslint-plugin-react-refresh": "^0.4.19",
|
|
34
36
|
"eslint-plugin-readable-tailwind": "^1.9.0",
|
|
35
37
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
36
38
|
"eslint-plugin-sort-react-dependency-arrays": "^1.0.0",
|
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 xo
|
|
8
|
+
npm install --save-dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
<details>
|
|
@@ -13,7 +13,7 @@ npm install --save-dev @tommy-mitchell/eslint-config-xo xo
|
|
|
13
13
|
<p>
|
|
14
14
|
|
|
15
15
|
```sh
|
|
16
|
-
yarn add --dev @tommy-mitchell/eslint-config-xo xo
|
|
16
|
+
yarn add --dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
</p>
|
|
@@ -24,11 +24,11 @@ yarn add --dev @tommy-mitchell/eslint-config-xo xo
|
|
|
24
24
|
<p>
|
|
25
25
|
|
|
26
26
|
```sh
|
|
27
|
-
npm install --save-dev @tommy-mitchell/eslint-config-xo xo @tommy-mitchell/dprint-config dprint
|
|
27
|
+
npm install --save-dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest @tommy-mitchell/dprint-config dprint
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
```sh
|
|
31
|
-
yarn add --dev @tommy-mitchell/eslint-config-xo xo @tommy-mitchell/dprint-config dprint
|
|
31
|
+
yarn add --dev @tommy-mitchell/eslint-config-xo@beta xo@npm:@spence-s/flat-xo@latest @tommy-mitchell/dprint-config dprint
|
|
32
32
|
```
|
|
33
33
|
|
|
34
34
|
</p>
|
|
@@ -50,6 +50,7 @@ import * as configs from "@tommy-mitchell/eslint-config-xo";
|
|
|
50
50
|
export default [
|
|
51
51
|
...configs.xo,
|
|
52
52
|
...configs.react, // If using React
|
|
53
|
+
...configs.next, // If using Next.js
|
|
53
54
|
...configs.tailwind, // If using Tailwind CSS
|
|
54
55
|
...configs.dprint, // If using dprint (must be last to override stylistic rules)
|
|
55
56
|
// Plus any overrides
|
|
@@ -74,7 +75,7 @@ If formatting with `dprint`:
|
|
|
74
75
|
"editor.formatOnSave": true,
|
|
75
76
|
"editor.defaultFormatter": "dprint.dprint",
|
|
76
77
|
"editor.codeActionsOnSave": {
|
|
77
|
-
"source.fixAll": "explicit", // Will run lint autofixes
|
|
78
|
+
"source.fixAll.xo": "explicit", // Will run lint autofixes
|
|
78
79
|
},
|
|
79
80
|
},
|
|
80
81
|
```
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
package/src/next.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { FlatCompat } from "@eslint/eslintrc";
|
|
2
|
+
import next from "@next/eslint-plugin-next";
|
|
3
|
+
|
|
4
|
+
const compat = new FlatCompat({
|
|
5
|
+
baseDirectory: import.meta.dirname,
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
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
|
+
},
|
|
22
|
+
];
|