forked from rapidpages/rapidpages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
56 lines (55 loc) · 1.59 KB
/
.eslintrc.cjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/** @type {import("eslint").Linter.Config} */
const config = {
parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
plugins: ["@typescript-eslint"],
extends: ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
rules: {
"@typescript-eslint/consistent-type-imports": [
"warn",
{
prefer: "type-imports",
fixStyle: "inline-type-imports",
},
],
"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_" }],
"@typescript-eslint/no-explicit-any": ["error", { ignoreRestArgs: true }],
"no-console": ["error", { allow: ["warn", "error"] }],
// Not all images have to be optimized. Some are already optimized.
"@next/next/no-img-element": "off",
/*
* I don't have a strong opinoion about this, but I think it's better to
* have a consistent way to export modules.
*/
"import/no-default-export": "error",
/*
* I don't have a strong opinoion about this, but I think it's better to
* have a consistent way to name functions.
*/
"react/function-component-definition": [
2,
{ namedComponents: "arrow-function" },
],
},
overrides: [
/**
* We want to have default exports for Next.js pages.
*/
{
files: [
"src/pages/**/*.ts",
"src/pages/**/*.tsx",
"next.config.mjs",
"tailwind.config.ts",
],
rules: {
"import/no-default-export": "off",
"import/prefer-default-export": "error",
},
},
],
ignorePatterns: ["public", "node_modules"],
};
module.exports = config;