forked from vercel/og-image
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
51 lines (51 loc) · 2.38 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
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: [
'import', // cf. https://github.com/alexgorbatchev/eslint-import-resolver-typescript#configuration
'@typescript-eslint'
],
extends: [
'eslint:recommended', // cf. https://typescript-eslint.io/docs/linting/linting#configuration
'next/core-web-vitals',
'plugin:react/jsx-runtime', // cf. https://github.com/yannickcr/eslint-plugin-react#configuration
'plugin:jsx-a11y/recommended', // cf. https://github.com/jsx-eslint/eslint-plugin-jsx-a11y#usage
'plugin:eslint-comments/recommended', // cf. https://mysticatea.github.io/eslint-plugin-eslint-comments/
'plugin:import/recommended', // cf. https://github.com/import-js/eslint-plugin-import
'plugin:import/typescript', // cf. https://github.com/import-js/eslint-plugin-import#typescript
'plugin:@typescript-eslint/recommended', //cf. https://typescript-eslint.io/docs/linting/linting/#configuration
'plugin:@typescript-eslint/recommended-requiring-type-checking', // cf. https://typescript-eslint.io/docs/linting/type-linting
// At last, Extending "prettier" turns off a bunch of core ESLint rules, as well as a few rules:
'prettier' // cf. https://github.com/prettier/eslint-config-prettier#readme
],
parserOptions: {
// cf. https://typescript-eslint.io/docs/linting/type-linting -------------
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
// ------------------------------------------------------------------------
// Only ESLint 6.2.0 and later support ES2020.
ecmaVersions: 2021
},
settings: {
react: { version: 'detect' },
// eslint-import-resolver-typescript ---------------------------------------------------
// cf. https://github.com/alexgorbatchev/eslint-import-resolver-typescript#configuration
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx']
},
'import/resolver': {
typescript: {
// use a glob pattern
// cf. https://github.com/alexgorbatchev/eslint-import-resolver-typescript#configuration
"project": "./tsconfig.json",
// project: "packages/*/tsconfig.json",
}
}
// -------------------------------------------------------------------------------------
},
rules: {
// turn on errors for missing imports
'import/no-unresolved': 'error',
'@next/next/no-img-element': 'off'
}
}