@mlaursen/eslint-config 8.0.0-next.1 → 8.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/README.md +33 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -69,6 +69,39 @@ The `config` export is the `typescript-eslint.config()` function to provide type
|
|
|
69
69
|
definitions and `gitignore` automatically ignores files from linting based on
|
|
70
70
|
your `.gitignore` rules.
|
|
71
71
|
|
|
72
|
+
## Next.js Setup
|
|
73
|
+
|
|
74
|
+
This is no longer included in this eslint-config since it requires the eslint plugin to be installed
|
|
75
|
+
in the project to work. Here are the setup steps:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
npm install -D @eslint/eslintrc @next/eslint-plugin-next
|
|
79
|
+
yarn add -D @eslint/eslintrc @next/eslint-plugin-next
|
|
80
|
+
pnpm add -D @eslint/eslintrc @next/eslint-plugin-next
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
```diff
|
|
84
|
+
// @ts-check
|
|
85
|
+
+import { FlatCompat } from "@eslint/eslintrc";
|
|
86
|
+
import { config, configs, gitignore } from "@mlaursen/eslint-config";
|
|
87
|
+
|
|
88
|
+
+const compat = new FlatCompat({
|
|
89
|
+
+ baseDirectory: import.meta.dirname,
|
|
90
|
+
+});
|
|
91
|
+
+
|
|
92
|
+
|
|
93
|
+
// somewhat strict type checking
|
|
94
|
+
export default config(
|
|
95
|
+
gitignore(import.meta.url),
|
|
96
|
+
+ ...compat.config({
|
|
97
|
+
+ extends: ["plugin:@next/next/recommended"],
|
|
98
|
+
+ // or with core-web-vitals
|
|
99
|
+
+ // extends: ["plugin:@next/next/core-web-vitals"],
|
|
100
|
+
+ }),
|
|
101
|
+
...configs.frontend("jest")
|
|
102
|
+
);
|
|
103
|
+
```
|
|
104
|
+
|
|
72
105
|
## Configs
|
|
73
106
|
|
|
74
107
|
I normally just use the `frontend` or `frontendTypeChecking` configs, but the
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlaursen/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.0.0
|
|
4
|
+
"version": "8.0.0",
|
|
5
5
|
"description": "An eslint config used by mlaursen for most projects.",
|
|
6
6
|
"repository": "https://github.com/mlaursen/eslint-config.git",
|
|
7
7
|
"author": "Mikkel Laursen <mlaursen03@gmail.com>",
|