-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
42 lines (40 loc) · 1.43 KB
/
.eslintrc.js
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
const { resolve } = require('path')
const project = resolve(__dirname, 'tsconfig.json')
module.exports = {
root: true,
extends: [
'next/core-web-vitals',
'eslint:recommended',
'plugin:eslint-comments/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-type-checked',
require.resolve('@vercel/style-guide/eslint/react'),
require.resolve('@vercel/style-guide/eslint/next'),
require.resolve('@vercel/style-guide/eslint/typescript'),
],
rules: {
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-inferrable-types': 'error',
'@typescript-eslint/array-type': ['error', { default: 'array-simple' }],
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/consistent-type-definitions': 'off',
'react/function-component-definition': 'off',
'react/jsx-sort-props': 'off',
'react/jsx-no-leaked-render': [2, { validStrategies: ['coerce'] }],
'eslint-comments/no-unused-disable': 'error',
},
parserOptions: { project },
overrides: [
{
files: ['*.ts', '*.tsx'],
parserOptions: { project },
},
{
files: ['*.test.ts', '*.test.tsx'],
plugins: ['vitest'],
extends: ['plugin:vitest/recommended'],
},
],
settings: { 'import/resolver': { typescript: { project } } },
}