@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tommy-mitchell/eslint-config-xo",
3
- "version": "1.0.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.7.0",
33
- "eslint-plugin-react-refresh": "^0.4.18",
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
@@ -1,6 +1,7 @@
1
1
  import type { FlatXoConfig } from "xo";
2
2
 
3
3
  export declare const dprint: FlatXoConfig;
4
+ export declare const next: FlatXoConfig;
4
5
  export declare const react: FlatXoConfig;
5
6
  export declare const tailwind: FlatXoConfig;
6
7
  export declare const xo: FlatXoConfig;
package/src/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export { default as dprint } from "./dprint.js";
2
+ export { default as next } from "./next.js";
2
3
  export { default as react } from "./react.js";
3
4
  export { default as tailwind } from "./tailwind.js";
4
5
  export { default as xo } from "./xo.js";
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
+ ];
package/src/tailwind.js CHANGED
@@ -7,6 +7,7 @@ export default [...tailwind.configs["flat/recommended"], {
7
7
  },
8
8
  rules: {
9
9
  "readable-tailwind/multiline": ["warn", {
10
+ group: "newLine",
10
11
  indent: "tab",
11
12
  preferSingleLine: true,
12
13
  printWidth: 120,