Skip to content

Commit 3a1e3cd

Browse files
authored
Merge pull request #2359 from dxc-technology/PelayoFelgueroso/eslint-doc-fix
Fix pre-commit eslint errors on app/website
2 parents 96e2d7e + ea2003a commit 3a1e3cd

3 files changed

Lines changed: 25 additions & 7 deletions

File tree

package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/eslint-config/next.js

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,38 @@
11
import reactInternal from "./react-internal.js";
2-
import vercelNext from "@vercel/style-guide/eslint/next";
3-
import { FlatCompat } from "@eslint/eslintrc";
42
import tsPlugin from "@typescript-eslint/eslint-plugin";
53
import tsParser from "@typescript-eslint/parser";
64
import globals from "globals";
75
import { join } from "path";
86

9-
const compat = new FlatCompat();
10-
117
/**
128
* @param {{ tsconfigRootDir: string, tsconfigName?: string }} options
139
* @returns {import("eslint").Config[]}
1410
*/
1511
export default function nextConfig({ tsconfigRootDir, tsconfigName = "tsconfig.lint.json" } = {}) {
1612
return [
1713
...reactInternal,
18-
...compat.config(vercelNext),
14+
{
15+
files: ["**/*.{ts,tsx}"],
16+
plugins: { "@typescript-eslint": tsPlugin },
17+
languageOptions: {
18+
parser: tsParser,
19+
parserOptions: {
20+
project: join(tsconfigRootDir, tsconfigName),
21+
tsconfigRootDir,
22+
},
23+
globals: {
24+
...globals.browser,
25+
...globals.node,
26+
},
27+
},
28+
rules: {
29+
...tsPlugin.configs.recommended.rules,
30+
...tsPlugin.configs["recommended-requiring-type-checking"].rules,
31+
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
32+
"no-unused-vars": "off",
33+
"@typescript-eslint/triple-slash-reference": "off",
34+
},
35+
},
1936
{
2037
files: ["**/*.{ts,tsx}"],
2138
plugins: { "@typescript-eslint": tsPlugin },

packages/eslint-config/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
"react-internal.js"
1010
],
1111
"devDependencies": {
12-
"@vercel/style-guide": "^6.0.0",
1312
"eslint-config-turbo": "^2.6.1",
1413
"eslint-config-prettier": "^10.1.8",
14+
"eslint-config-next": "^16.0.5",
1515
"eslint-plugin-only-warn": "^1.1.0",
1616
"@typescript-eslint/parser": "^8.44.1",
1717
"@typescript-eslint/eslint-plugin": "^8.44.1",

0 commit comments

Comments
 (0)