-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy patheslint.config.js
More file actions
56 lines (55 loc) · 3.11 KB
/
eslint.config.js
File metadata and controls
56 lines (55 loc) · 3.11 KB
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
import tseslint from "@typescript-eslint/eslint-plugin";
import tsparser from "@typescript-eslint/parser";
import unusedImports from "eslint-plugin-unused-imports";
import nextPlugin from "@next/eslint-plugin-next";
import reactPlugin from "eslint-plugin-react";
import reactHooksPlugin from "eslint-plugin-react-hooks";
export default [
{ ignores: ["node_modules/", "dist/", "build/", ".next/", "coverage/", "*.config.js"] },
{
files: ["**/*.{ts,tsx,js,jsx}"],
languageOptions: {
parser: tsparser,
parserOptions: { ecmaVersion: "latest", sourceType: "module", ecmaFeatures: { jsx: true } }
},
plugins: {
"@typescript-eslint": tseslint,
"unused-imports": unusedImports,
"@next/next": nextPlugin,
"react": reactPlugin,
"react-hooks": reactHooksPlugin
},
rules: {
"prefer-const": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": ["warn", { args: "all", argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
"unused-imports/no-unused-imports": "error",
"no-trailing-spaces": "error",
"eol-last": ["error", "always"],
"quotes": ["error", "double", { avoidEscape: true, allowTemplateLiterals: true }],
"semi": ["error", "always"],
"comma-dangle": ["error", "never"],
"indent": ["warn", 2, { SwitchCase: 1, ignoredNodes: ["JSXElement", "JSXElement > *", "JSXAttribute", "JSXIdentifier", "JSXNamespacedName", "JSXMemberExpression", "JSXSpreadAttribute", "JSXExpressionContainer", "JSXOpeningElement", "JSXClosingElement", "JSXFragment", "JSXOpeningFragment", "JSXClosingFragment", "JSXText", "JSXEmptyExpression", "JSXSpreadChild"] }],
"comma-spacing": ["error", { before: false, after: true }],
"key-spacing": ["error", { beforeColon: false, afterColon: true, mode: "strict" }],
"keyword-spacing": ["error", { before: true, after: true }],
"space-infix-ops": "error",
"no-multi-spaces": ["error", { ignoreEOLComments: true }],
"block-spacing": ["error", "always"],
"brace-style": ["error", "1tbs", { allowSingleLine: true }],
curly: ["error", "multi-line"],
"nonblock-statement-body-position": ["error", "beside"],
"object-curly-spacing": ["error", "always"],
"object-curly-newline": ["error", { ObjectExpression: { multiline: true }, ObjectPattern: { multiline: true }, ImportDeclaration: { multiline: true }, ExportDeclaration: { multiline: true } }],
"object-property-newline": ["error", { allowAllPropertiesOnSameLine: true }],
"array-bracket-spacing": ["error", "never"],
"array-bracket-newline": ["error", { multiline: true, minItems: 8 }],
"array-element-newline": ["error", { ArrayExpression: "consistent", ArrayPattern: { minItems: 8 } }],
"function-paren-newline": ["error", "consistent"],
"function-call-argument-newline": ["error", "consistent"],
"max-len": ["warn", { code: 250, ignoreStrings: true, ignoreTemplateLiterals: true, ignoreComments: true, ignoreUrls: true, ignoreRegExpLiterals: true }],
"@next/next/no-img-element": "off",
"react-hooks/exhaustive-deps": "off"
}
}
];