-
Notifications
You must be signed in to change notification settings - Fork 16
/
.eslintrc.js
61 lines (58 loc) · 1.96 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/**
* Specific eslint rules for this app/package, extends the base rules
* @see https://github.com/belgattitude/nextjs-monorepo-example/blob/main/docs/about-linters.md
*/
// Workaround for https://github.com/eslint/eslint/issues/3458 (re-export of @rushstack/eslint-patch)
require('@bibliotheca-dao/eslint-config-bases/patch/modern-module-resolution');
const {
getDefaultIgnorePatterns,
} = require('@bibliotheca-dao/eslint-config-bases/helpers');
module.exports = {
root: true,
parserOptions: {
tsconfigRootDir: __dirname,
project: 'tsconfig.json',
},
ignorePatterns: [...getDefaultIgnorePatterns(), '.next', '.out'],
extends: [
'@bibliotheca-dao/eslint-config-bases/typescript',
'@bibliotheca-dao/eslint-config-bases/sonar',
'@bibliotheca-dao/eslint-config-bases/regexp',
'@bibliotheca-dao/eslint-config-bases/jest',
'@bibliotheca-dao/eslint-config-bases/react',
'@bibliotheca-dao/eslint-config-bases/rtl',
'@bibliotheca-dao/eslint-config-bases/graphql-schema',
// Add specific rules for nextjs
'plugin:@next/next/core-web-vitals',
// Apply prettier and disable incompatible rules
'@bibliotheca-dao/eslint-config-bases/prettier',
],
rules: {
// https://github.com/vercel/next.js/discussions/16832
'@next/next/no-img-element': 'off',
// For the sake of example
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/HEAD/docs/rules/anchor-is-valid.md
'jsx-a11y/anchor-is-valid': 'off',
},
overrides: [
{
files: ['src/pages/\\_*.{ts,tsx}'],
rules: {
'react/display-name': 'off',
},
},
{
files: ['src/backend/**/*graphql*schema*.ts'],
rules: {
'@typescript-eslint/naming-convention': [
'error',
{
// Fine-tune naming convention for graphql resolvers and allow PascalCase
selector: ['objectLiteralProperty'],
format: ['camelCase', 'PascalCase'],
},
],
},
},
],
};